diff options
| author | Larry Meaney <larry_meaney@iname.com> | 2011-05-05 06:01:58 +0000 |
|---|---|---|
| committer | Larry Meaney <larry_meaney@iname.com> | 2011-05-05 06:01:58 +0000 |
| commit | fa19a5e01e127459f845acce02aa797827a688b5 (patch) | |
| tree | dfb88d701e321b610d3e6767d64a1ab17f3c1eff /repo.php | |
| parent | 4c9e9b2ed4bdea97bd167a69e0f9ee93f74a0d81 (diff) | |
| download | webtrees-fa19a5e01e127459f845acce02aa797827a688b5.tar.gz webtrees-fa19a5e01e127459f845acce02aa797827a688b5.tar.bz2 webtrees-fa19a5e01e127459f845acce02aa797827a688b5.zip | |
* move privacy checks from controller to view level
* tidy up code
Diffstat (limited to 'repo.php')
| -rw-r--r-- | repo.php | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -39,26 +39,31 @@ $nonfacts = array(); $controller=new WT_Controller_Repository(); $controller->init(); -// Tell addmedia.php what to link to -$linkToID=$controller->rid; - print_header($controller->getPageTitle()); -// LightBox -if (WT_USE_LIGHTBOX) { - require WT_ROOT.WT_MODULES_DIR.'lightbox/lb_defaultconfig.php'; - require WT_ROOT.WT_MODULES_DIR.'lightbox/functions/lb_call_js.php'; +if (!$controller->repository) { + echo '<b>', WT_I18N::translate('Unable to find record with ID'), '</b><br /><br />'; + print_footer(); + exit; } -if (!$controller->repository) { - echo "<b>", WT_I18N::translate('Unable to find record with ID'), "</b><br /><br />"; +if (!$controller->repository->canDisplayDetails()) { + print_privacy_error(); print_footer(); exit; } -else if ($controller->repository->isMarkedDeleted()) { + +if ($controller->repository->isMarkedDeleted()) { echo '<span class="error">', WT_I18N::translate('This record has been marked for deletion upon admin approval.'), '</span>'; } +if (WT_USE_LIGHTBOX) { + require WT_ROOT.WT_MODULES_DIR.'lightbox/lb_defaultconfig.php'; + require WT_ROOT.WT_MODULES_DIR.'lightbox/functions/lb_call_js.php'; +} + +$linkToID=$controller->rid; // Tell addmedia.php what to link to + echo WT_JS_START; echo 'function show_gedcom_record() {'; echo ' var recwin=window.open("gedrecord.php?pid=', $controller->rid, '", "_blank", "top=0, left=0, width=600, height=400, scrollbars=1, scrollable=1, resizable=1");'; |
