summaryrefslogtreecommitdiff
path: root/modules_v3
diff options
context:
space:
mode:
Diffstat (limited to 'modules_v3')
-rw-r--r--modules_v3/GEDFact_assistant/MEDIA_ctrl.php2
-rw-r--r--modules_v3/GEDFact_assistant/_CENS/census_3_find.php23
-rw-r--r--modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php10
-rw-r--r--modules_v3/GEDFact_assistant/module.php27
-rw-r--r--modules_v3/batch_update/admin_batch_update.php5
-rw-r--r--modules_v3/batch_update/module.php4
-rw-r--r--modules_v3/clippings/index.php3
-rw-r--r--modules_v3/faq/module.php18
-rw-r--r--modules_v3/googlemap/admin_editconfig.php23
-rw-r--r--modules_v3/googlemap/admin_placecheck.php18
-rw-r--r--modules_v3/googlemap/admin_places.php6
-rw-r--r--modules_v3/googlemap/flags.php9
-rw-r--r--modules_v3/googlemap/pedigree_map.php10
-rw-r--r--modules_v3/googlemap/places_edit.php10
-rw-r--r--modules_v3/lightbox/admin_config.php14
-rw-r--r--modules_v3/sitemap/admin_index.php17
-rw-r--r--modules_v3/stories/module.php71
-rw-r--r--modules_v3/tree/module.php7
18 files changed, 123 insertions, 154 deletions
diff --git a/modules_v3/GEDFact_assistant/MEDIA_ctrl.php b/modules_v3/GEDFact_assistant/MEDIA_ctrl.php
index 02ef06d7da..b941f931a8 100644
--- a/modules_v3/GEDFact_assistant/MEDIA_ctrl.php
+++ b/modules_v3/GEDFact_assistant/MEDIA_ctrl.php
@@ -35,8 +35,6 @@ global $GEDCOM, $ABBREVIATE_CHART_LABELS;
global $show_full;
global $famid, $censyear, $censdate;
-// print_simple_header("Census");
-
$summary=$controller->record->format_first_major_fact(WT_EVENTS_BIRT, 2);
if (!($controller->record->isDead())) {
// If alive display age
diff --git a/modules_v3/GEDFact_assistant/_CENS/census_3_find.php b/modules_v3/GEDFact_assistant/_CENS/census_3_find.php
index 8024bb860a..df30536b62 100644
--- a/modules_v3/GEDFact_assistant/_CENS/census_3_find.php
+++ b/modules_v3/GEDFact_assistant/_CENS/census_3_find.php
@@ -23,6 +23,8 @@
//
// $Id$
+$controller=new WT_Controller_Simple();
+
global $MEDIA_DIRECTORY, $MEDIA_DIRECTORY_LEVELS, $TEXT_DIRECTION, $ABBREVIATE_CHART_LABELS;
$type =safe_GET('type', WT_REGEX_ALPHA, 'indi');
@@ -108,43 +110,44 @@ require WT_ROOT.'includes/specialchars.php';
switch ($type) {
case "indi":
- print_simple_header(WT_I18N::translate('Find individual ID'));
+ $controller->setPageTitle(WT_I18N::translate('Find individual ID'));
break;
case "fam":
- print_simple_header(WT_I18N::translate('Find Family List'));
+ $controller->setPageTitle(WT_I18N::translate('Find Family List'));
break;
case "media":
- print_simple_header(WT_I18N::translate('Find media'));
+ $controller->setPageTitle(WT_I18N::translate('Find media'));
$action="filter";
break;
case "place":
- print_simple_header(WT_I18N::translate('Find Place'));
+ $controller->setPageTitle(WT_I18N::translate('Find Place'));
$action="filter";
break;
case "repo":
- print_simple_header(WT_I18N::translate('Repositories'));
+ $controller->setPageTitle(WT_I18N::translate('Repositories'));
$action="filter";
break;
case "note":
- print_simple_header(WT_I18N::translate('Find Shared Note'));
+ $controller->setPageTitle(WT_I18N::translate('Find Shared Note'));
$action="filter";
break;
case "source":
- print_simple_header(WT_I18N::translate('Find Source'));
+ $controller->setPageTitle(WT_I18N::translate('Find Source'));
$action="filter";
break;
case "specialchar":
- print_simple_header(WT_I18N::translate('Find Special Characters'));
+ $controller->setPageTitle(WT_I18N::translate('Find Special Characters'));
$action="filter";
break;
case "facts":
- print_simple_header(WT_I18N::translate('Find fact tags'));
+ $controller->setPageTitle(WT_I18N::translate('Find fact tags'));
echo
WT_JS_START,
'jQuery(document).ready(function(){ initPickFact(); });',
WT_JS_END;
break;
}
+$controller->pageHeader();
echo WT_JS_START;
?>
@@ -1081,5 +1084,3 @@ echo "</div>"; // Close div that centers table
// Set focus to the input field
if ($type!='facts') echo WT_JS_START, 'document.filter', $type, '.filter.focus();', WT_JS_END;
-
-print_simple_footer();
diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php
index 80587a04eb..54957d3f51 100644
--- a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php
+++ b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php
@@ -50,12 +50,6 @@ if (empty($linktoid) || empty($linkto)) {
break;
}
}
-if (WT_USER_IS_ADMIN) {
- print_simple_header(WT_I18N::translate('Link media')." ".$toitems);
-} else {
- print_simple_header(WT_I18N::translate('Administration'));
- echo WT_I18N::translate('Unable to authenticate user.');
-}
if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm';
@@ -699,7 +693,6 @@ function shiftlinks() {
echo '</table>';
echo '</form>';
echo '<br/><br/><center><a href="javascript:;" onclick="if (window.opener.showchanges) window.opener.showchanges(); window.close(); winNav.close(); ">', WT_I18N::translate('Close Window'), '</a><br /></center>';
- // print_simple_footer();
} elseif ($action == "update" && $paramok) {
@@ -744,10 +737,7 @@ function shiftlinks() {
}
echo '<br/><br/><center><a href="javascript:;" onclick="if (window.opener.showchanges) window.opener.showchanges(); window.close(); winNav.close(); ">', WT_I18N::translate('Close Window'), '</a><br /></center>';
- print_simple_footer();
-
} else {
// echo '<center>You must be logged in as an Administrator<center>';
echo '<br/><br/><center><a href="javascript:;" onclick="if (window.opener.showchanges) window.opener.showchanges(); window.close(); winNav.close();">', WT_I18N::translate('Close Window'), '</a><br /></center>';
- //print_simple_footer();
}
diff --git a/modules_v3/GEDFact_assistant/module.php b/modules_v3/GEDFact_assistant/module.php
index 589ce4f115..6572b66095 100644
--- a/modules_v3/GEDFact_assistant/module.php
+++ b/modules_v3/GEDFact_assistant/module.php
@@ -60,6 +60,8 @@ class GEDFact_assistant_WT_Module extends WT_Module {
private static function media_3_find() {
global $MEDIA_DIRECTORY, $MEDIA_DIRECTORY_LEVELS, $TEXT_DIRECTION, $ABBREVIATE_CHART_LABELS;
+
+ $controller=new WT_Controller_Simple();
$type =safe_GET('type', WT_REGEX_ALPHA, 'indi');
$filter =safe_GET('filter');
@@ -124,36 +126,37 @@ class GEDFact_assistant_WT_Module extends WT_Module {
switch ($type) {
case "indi":
- print_simple_header(WT_I18N::translate('Find individual ID'));
+ $controller->setPageTitle(WT_I18N::translate('Find individual ID'));
break;
case "fam":
- print_simple_header(WT_I18N::translate('Find Family List'));
+ $controller->setPageTitle(WT_I18N::translate('Find Family List'));
break;
case "media":
- print_simple_header(WT_I18N::translate('Find media'));
+ $controller->setPageTitle(WT_I18N::translate('Find media'));
$action="filter";
break;
case "place":
- print_simple_header(WT_I18N::translate('Find Place'));
+ $controller->setPageTitle(WT_I18N::translate('Find Place'));
$action="filter";
break;
case "repo":
- print_simple_header(WT_I18N::translate('Repositories'));
+ $controller->setPageTitle(WT_I18N::translate('Repositories'));
$action="filter";
break;
case "note":
- print_simple_header(WT_I18N::translate('Find Shared Note'));
+ $controller->setPageTitle(WT_I18N::translate('Find Shared Note'));
$action="filter";
break;
case "source":
- print_simple_header(WT_I18N::translate('Find Source'));
+ $controller->setPageTitle(WT_I18N::translate('Find Source'));
$action="filter";
break;
case "specialchar":
- print_simple_header(WT_I18N::translate('Find Special Characters'));
+ $controller->setPageTitle(WT_I18N::translate('Find Special Characters'));
$action="filter";
break;
}
+ $controller->pageHeader();
echo WT_JS_START;
?>
@@ -826,14 +829,14 @@ class GEDFact_assistant_WT_Module extends WT_Module {
// Set focus to the input field
echo WT_JS_START, 'document.filter', $type, '.filter.focus();', WT_JS_END;
-
- print_simple_footer();
}
private static function media_query_3a() {
$iid2 = safe_GET('iid');
-
- print_simple_header(WT_I18N::translate('Link media'));
+
+ $controller=new WT_Controller_Simple();
+ $controller->setPageTitle(WT_I18N::translate('Link media'));
+ $controller->pageHeader();
$record=WT_GedcomRecord::getInstance($iid2);
if ($record) {
diff --git a/modules_v3/batch_update/admin_batch_update.php b/modules_v3/batch_update/admin_batch_update.php
index 785b91c167..f8d6d6e3db 100644
--- a/modules_v3/batch_update/admin_batch_update.php
+++ b/modules_v3/batch_update/admin_batch_update.php
@@ -52,7 +52,6 @@ class batch_update {
function main() {
// HTML common to all pages
$html=
- print_header(WT_I18N::translate('Batch update')).
self::getJavascript().
'<form id="batch_update_form" action="module.php" method="get">'.
'<input type="hidden" name="mod" value="batch_update">'.
@@ -116,9 +115,7 @@ class batch_update {
}
}
$html.='</table></form>';
- ob_start();
- print_footer();
- return $html.ob_get_clean();
+ return $html;
}
// Constructor - initialise variables and validate user-input
diff --git a/modules_v3/batch_update/module.php b/modules_v3/batch_update/module.php
index 3561a811b5..b34f092661 100644
--- a/modules_v3/batch_update/module.php
+++ b/modules_v3/batch_update/module.php
@@ -40,6 +40,10 @@ class batch_update_WT_Module extends WT_Module implements WT_Module_Config{
public function modAction($mod_action) {
switch($mod_action) {
case 'admin_batch_update':
+ $controller=new WT_Controller_Base();
+ $controller->setPageTitle(WT_I18N::translate('Batch update')).
+ $controller->pageHeader();
+
// TODO: these files should be methods in this class
require WT_ROOT.WT_MODULES_DIR.$this->getName().'/'.$mod_action.'.php';
$mod=new batch_update;
diff --git a/modules_v3/clippings/index.php b/modules_v3/clippings/index.php
index 2f70d4f933..2a9c8d2179 100644
--- a/modules_v3/clippings/index.php
+++ b/modules_v3/clippings/index.php
@@ -35,7 +35,7 @@ global $ENABLE_AUTOCOMPLETE, $cart, $MAX_PEDIGREE_GENERATIONS, $TEXT_DIRECTION,
require_once WT_ROOT.WT_MODULES_DIR.'clippings/clippings_ctrl.php';
$controller=new WT_Controller_Clippings();
-print_header(WT_I18N::translate('Clippings cart'));
+$controller->pageHeader();
if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm';
@@ -310,4 +310,3 @@ if ($ct==0) {
<?php
}
if (isset($_SESSION["cart"])) $_SESSION["cart"]=$cart;
-print_footer();
diff --git a/modules_v3/faq/module.php b/modules_v3/faq/module.php
index 1c1b1f981a..50ba7f6622 100644
--- a/modules_v3/faq/module.php
+++ b/modules_v3/faq/module.php
@@ -134,8 +134,9 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf
$this->config();
} else {
$block_id=safe_GET('block_id');
+ $controller=new WT_Controller_Base();
if ($block_id) {
- print_header(WT_I18N::translate('Edit FAQ item'));
+ $controller->setPageTitle(WT_I18N::translate('Edit FAQ item'));
$header=get_block_setting($block_id, 'header');
$faqbody=get_block_setting($block_id, 'faqbody');
$block_order=WT_DB::prepare(
@@ -145,7 +146,7 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf
"SELECT gedcom_id FROM `##block` WHERE block_id=?"
)->execute(array($block_id))->fetchOne();
} else {
- print_header(WT_I18N::translate('Add FAQ item'));
+ $controller->setPageTitle(WT_I18N::translate('Add FAQ item'));
$header='';
$faqbody='';
$block_order=WT_DB::prepare(
@@ -153,6 +154,7 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf
)->execute(array($this->getName()))->fetchOne();
$gedcom_id=WT_GED_ID;
}
+ $controller->pageHeader();
// "Help for this page" link
echo '<div id="page_help">', help_link('add_faq_item', $this->getName()), '</div>';
@@ -203,8 +205,6 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf
echo '<p><input type="submit" value="', WT_I18N::translate('Save'), '" tabindex="5"/>';
echo '&nbsp;<input type="button" value="', WT_I18N::translate('Cancel'), '" onclick="window.location=\''.$this->getConfigLink().'\';" tabindex="6" /></p>';
echo '</form>';
-
- print_footer();
exit;
}
}
@@ -276,7 +276,9 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf
}
private function show() {
- print_header($this->getTitle());
+ $controller=new WT_Controller_Base();
+ $controller->setPageTitle($this->getTitle());
+ $controller->pageHeader();
$faqs=WT_DB::prepare(
"SELECT block_id, bs1.setting_value AS header, bs2.setting_value AS body".
@@ -334,13 +336,14 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf
echo '<hr />';
}
}
- print_footer();
}
private function config() {
global $WT_IMAGES;
- print_header($this->getTitle());
+ $controller=new WT_Controller_Base();
+ $controller->setPageTitle($this->getTitle());
+ $controller->pageHeader();
$faqs=WT_DB::prepare(
"SELECT block_id, block_order, gedcom_id, bs1.setting_value AS header, bs2.setting_value AS faqbody".
@@ -410,6 +413,5 @@ class faq_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_Conf
}
echo '</table>';
}
- print_footer();
}
}
diff --git a/modules_v3/googlemap/admin_editconfig.php b/modules_v3/googlemap/admin_editconfig.php
index e273d1df43..defe075fdc 100644
--- a/modules_v3/googlemap/admin_editconfig.php
+++ b/modules_v3/googlemap/admin_editconfig.php
@@ -21,7 +21,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// @version $Id$
+// $Id$
if (!defined('WT_WEBTREES')) {
header('HTTP/1.0 403 Forbidden');
@@ -87,20 +87,16 @@ function print_level_config_table($level) {
<?php
}
-print_header(WT_I18N::translate('Google Maps configuration'));
+$controller=new WT_Controller_Base();
+$controller->requireAdminLogin();
+$controller->setPageTitle(WT_I18N::translate('Google Maps configuration'));
+$controller->pageHeader();
-
-if (!WT_USER_IS_ADMIN) {
- echo '<div>', WT_I18N::translate('Page only for Administrators'), '</div>';
- print_footer();
- exit;
-} else {
- echo '<table id="gm_config"><tr>',
- '<th><a ', (safe_GET('mod_action')=="admin_editconfig" ? 'class="current" ' : ''), 'href="module.php?mod=googlemap&mod_action=admin_editconfig">', WT_I18N::translate('Google Maps configuration'), '</a>', '</th>',
- '<th><a ', (safe_GET('mod_action')=="admin_places" ? 'class="current" ' : ''), 'href="module.php?mod=googlemap&mod_action=admin_places">', WT_I18N::translate('Edit geographic place locations'), '</a>', '</th>',
- '<th><a ', (safe_GET('mod_action')=="admin_placecheck" ? 'class="current" ' : ''), 'href="module.php?mod=googlemap&mod_action=admin_placecheck">', WT_I18N::translate('Place Check'), '</a>', help_link('GOOGLEMAP_PLACECHECK','googlemap'), '</th>',
+echo '<table id="gm_config"><tr>',
+ '<th><a ', (safe_GET('mod_action')=="admin_editconfig" ? 'class="current" ' : ''), 'href="module.php?mod=googlemap&mod_action=admin_editconfig">', WT_I18N::translate('Google Maps configuration'), '</a>', '</th>',
+ '<th><a ', (safe_GET('mod_action')=="admin_places" ? 'class="current" ' : ''), 'href="module.php?mod=googlemap&mod_action=admin_places">', WT_I18N::translate('Edit geographic place locations'), '</a>', '</th>',
+ '<th><a ', (safe_GET('mod_action')=="admin_placecheck" ? 'class="current" ' : ''), 'href="module.php?mod=googlemap&mod_action=admin_placecheck">', WT_I18N::translate('Place Check'), '</a>', help_link('GOOGLEMAP_PLACECHECK','googlemap'), '</th>',
'</tr></table>';
-}
if ($action=="update" && !isset($security_user)) {
set_module_setting('googlemap', 'GM_MAP_TYPE', $_POST['NEW_GM_MAP_TYPE']);
@@ -400,7 +396,6 @@ echo '<div id="tabs">',
<?php
if (empty($SEARCH_SPIDER)) {
- print_footer();
} else {
echo WT_I18N::translate('Search Engine Spider Detected'), ": ", $SEARCH_SPIDER;
echo "</div></body></html>";
diff --git a/modules_v3/googlemap/admin_placecheck.php b/modules_v3/googlemap/admin_placecheck.php
index c41e7d32c3..9bce83368a 100644
--- a/modules_v3/googlemap/admin_placecheck.php
+++ b/modules_v3/googlemap/admin_placecheck.php
@@ -29,11 +29,6 @@ if (!defined('WT_WEBTREES')) {
exit;
}
-if (!WT_USER_IS_ADMIN) {
- header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.'admin.php');
- exit;
-}
-
$action =safe_POST ('action' );
$gedcom_id=safe_POST ('gedcom_id', array_keys(get_all_gedcoms()), WT_GED_ID );
$openinnew=safe_POST_bool('openinnew' );
@@ -73,12 +68,10 @@ if ($show_changes && !empty($_SESSION['placecheck_state'])) {
$_SESSION['placecheck_state'] = $state;
}
-// Must be an admin user to use this module
-if (!WT_USER_GEDCOM_ADMIN) {
- header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.'login.php?url=placelist.php');
- exit;
-}
-print_header(WT_I18N::translate('Place Check').' - '.WT_GEDCOM);
+$controller=new WT_Controller_Base();
+$controller->requireAdminLogin();
+$controller->setPageTitle(WT_I18N::translate('Place Check'));
+$controller->pageHeader();
$target=$openinnew ? 'target="_blank"' : '';
@@ -374,6 +367,3 @@ default:
echo "<div class=\"gm_check_top accepted\">", WT_I18N::translate('This will list all the places from the selected GEDCOM file. By default this will NOT INCLUDE places that are fully matched between the GEDCOM file and the GoogleMap tables'), "</div>";
break;
}
-
-//echo footers
-print_footer();
diff --git a/modules_v3/googlemap/admin_places.php b/modules_v3/googlemap/admin_places.php
index b1ffb4662e..0240055632 100644
--- a/modules_v3/googlemap/admin_places.php
+++ b/modules_v3/googlemap/admin_places.php
@@ -170,7 +170,9 @@ if ($action=='ExportFile' && WT_USER_IS_ADMIN) {
exit;
}
-print_header(WT_I18N::translate('Edit geographic place locations'));
+$controller=new WT_Controller_Base();
+$controller->setPageTitle(WT_I18N::translate('Edit geographic place locations'));
+$controller->pageHeader();
echo '<table id="gm_config"><tr>',
'<th><a ', (safe_GET('mod_action')=='admin_editconfig' ? 'class="current" ' : ''), 'href="module.php?mod=googlemap&mod_action=admin_editconfig">', WT_I18N::translate('Google Maps configuration'), '</a>', '</th>',
@@ -344,7 +346,6 @@ if ($action=='ImportFile') {
<input id="savebutton" type="submit" value="<?php echo WT_I18N::translate('Continue Adding'); ?>" /><br />
</form>
<?php
- print_footer();
exit;
}
@@ -653,7 +654,6 @@ foreach ($placelist as $place) {
echo help_link('PL_EXPORT_ALL_FILE','googlemap');
echo '</td></tr></table>';
if (empty($SEARCH_SPIDER)) {
- print_footer();
} else {
echo WT_I18N::translate('Search Engine Spider Detected'), ': ', $SEARCH_SPIDER;
echo '</div></body></html>';
diff --git a/modules_v3/googlemap/flags.php b/modules_v3/googlemap/flags.php
index 3c2ad64a60..9d03d1262f 100644
--- a/modules_v3/googlemap/flags.php
+++ b/modules_v3/googlemap/flags.php
@@ -31,6 +31,10 @@ if (!defined('WT_WEBTREES')) {
require WT_ROOT.WT_MODULES_DIR.'googlemap/defaultconfig.php';
require WT_ROOT.'includes/functions/functions_edit.php';
+$controller=new WT_Controller_Simple();
+$controller->setPageTitle(WT_I18N::translate('Select flag'));
+$controller->pageHeader();
+
$countries=WT_Stats::get_all_countries();
$action=safe_REQUEST($_REQUEST, 'action');
@@ -39,8 +43,6 @@ if (!isset($countrySelected)) $countrySelected='Countries';
if (isset($_REQUEST['stateSelected'])) $stateSelected = $_REQUEST['stateSelected'];
if (!isset($stateSelected)) $stateSelected='States';
-print_simple_header(WT_I18N::translate('Select flag'));
-
$country = array();
$rep = opendir(WT_ROOT.WT_MODULES_DIR.'googlemap/places/flags/');
while ($file = readdir($rep)) {
@@ -102,7 +104,6 @@ if ($action == 'ChangeFlag') {
echo "\n<script type=\"text/javascript\">\n<!--\nedit_close();\n//-->\n</script>";
}
echo "<div class=\"center\"><a href=\"javascript:;\" onclick=\"edit_close();\">", WT_I18N::translate('Close Window'), "</a></div><br />\n";
- print_simple_footer();
exit;
}
else {
@@ -244,5 +245,3 @@ else {
</form>
<?php
echo '<div class="center"><a href="javascript:;" onclick="edit_close();">', WT_I18N::translate('Close Window'), '</a></div><br />';
-
-print_simple_footer();
diff --git a/modules_v3/googlemap/pedigree_map.php b/modules_v3/googlemap/pedigree_map.php
index 2a36491e43..50f164f32c 100644
--- a/modules_v3/googlemap/pedigree_map.php
+++ b/modules_v3/googlemap/pedigree_map.php
@@ -35,7 +35,8 @@ if (!defined('WT_WEBTREES')) {
require WT_ROOT.WT_MODULES_DIR.'googlemap/defaultconfig.php';
-global $PEDIGREE_GENERATIONS, $MAX_PEDIGREE_GENERATIONS, $ENABLE_AUTOCOMPLETE, $SHOW_HIGHLIGHT_IMAGES, $WT_IMAGES;
+global $PEDIGREE_GENERATIONS, $MAX_PEDIGREE_GENERATIONS, $ENABLE_AUTOCOMPLETE, $SHOW_HIGHLIGHT_IMAGES, $WT_IMAGES, $TEXT_DIRECTION;
+
// Default is show for both of these.
$hideflags = safe_GET('hideflags');
@@ -60,15 +61,14 @@ $MAX_PEDIGREE_GENERATIONS = min($MAX_PEDIGREE_GENERATIONS, 8);
// End of internal configuration variables
-global $TEXT_DIRECTION;
-
-print_header(/* I18N: %s is a person's name */ WT_I18N::translate('Pedigree map of %s', $controller->getPersonName()));
+$controller->setPageTitle(/* I18N: %s is a person's name */ WT_I18N::translate('Pedigree map of %s', $controller->getPersonName()));
+$controller->pageHeader();
echo '<link type="text/css" href ="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/css/googlemap_style.css" rel="stylesheet" />';
if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm';
echo '<div><table><tr><td valign="middle">';
-echo '<h2>', WT_I18N::translate('Pedigree map of %s', $controller->getPersonName()), '</h2>';
+echo '<h2>', $controller->getPageTitle(), '</h2>';
// -- print the form to change the number of displayed generations
?>
diff --git a/modules_v3/googlemap/places_edit.php b/modules_v3/googlemap/places_edit.php
index 9bf2b72936..1f0d509648 100644
--- a/modules_v3/googlemap/places_edit.php
+++ b/modules_v3/googlemap/places_edit.php
@@ -35,14 +35,15 @@ $action=safe_REQUEST($_REQUEST, 'action');
if (isset($_REQUEST['placeid'])) $placeid = $_REQUEST['placeid'];
if (isset($_REQUEST['place_name'])) $place_name = $_REQUEST['place_name'];
-print_simple_header(WT_I18N::translate('Edit geographic place locations'));
+$controller=new WT_Controller_Simple();
+$controller->setPageTitle(WT_I18N::translate('Edit geographic place locations'));
+$controller->pageHeader();
if (!WT_USER_IS_ADMIN) {
echo "<table class=\"facts_table\">\n";
echo "<tr><td colspan=\"2\" class=\"facts_value\">", WT_I18N::translate('Page only for Administrators');
echo "</td></tr></table>\n";
echo "<br /><br /><br />\n";
- print_simple_footer();
exit;
}
echo '<link type="text/css" href="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/css/googlemap_style.css" rel="stylesheet" />';
@@ -102,7 +103,6 @@ if ($action=='addrecord' && WT_USER_IS_ADMIN) {
echo "\n<script type=\"text/javascript\">\n<!--\nedit_close('');\n//-->\n</script>";
}
echo "<div class=\"center\"><a href=\"javascript:;\" onclick=\"edit_close('');return false;\">", WT_I18N::translate('Close Window'), "</a></div><br />\n";
- print_simple_footer();
exit;
}
@@ -121,7 +121,6 @@ if ($action=='updaterecord' && WT_USER_IS_ADMIN) {
echo "\n<script type=\"text/javascript\">\n<!--\nedit_close('');\n//-->\n</script>";
}
echo "<div class=\"center\"><a href=\"javascript:;\" onclick=\"edit_close('');return false;\">", WT_I18N::translate('Close Window'), "</a></div><br />\n";
- print_simple_footer();
exit;
}
@@ -142,7 +141,6 @@ if ($action=='update_sv_params' && WT_USER_IS_ADMIN) {
echo "\n<script type=\"text/javascript\">\n<!--\nedit_close();\n//-->\n</script>";
}
echo "<div class=\"center\"><a href=\"javascript:;\" onclick=\"edit_close();return false;\">", WT_I18N::translate('Close Window'), "</a></div><br />\n";
- print_simple_footer();
exit;
}
@@ -363,5 +361,3 @@ $api="v3";
</form>
<?php
echo "<center><a href=\"javascript:;\" onclick=\"edit_close('')\">", WT_I18N::translate('Close Window'), "</a><br /></center>\n";
-
-print_simple_footer();
diff --git a/modules_v3/lightbox/admin_config.php b/modules_v3/lightbox/admin_config.php
index ddd3dcdddc..539f1e780c 100644
--- a/modules_v3/lightbox/admin_config.php
+++ b/modules_v3/lightbox/admin_config.php
@@ -28,15 +28,12 @@ if (!defined('WT_WEBTREES')) {
exit;
}
-$action = safe_POST('action');
-
-print_header(WT_I18N::translate('Lightbox-Album Configuration'));
+$controller=new WT_Controller_Base();
+$controller->requireAdminLogin();
+$controller->setPageTitle(WT_I18N::translate('Lightbox-Album Configuration'));
+$controller->pageHeader();
-if (!WT_USER_IS_ADMIN) {
- echo'<div class="warning">', WT_I18N::translate('Page only for Administrators'), '</div>';
- print_footer();
- exit;
-}
+$action = safe_POST('action');
if ($action=='update' && !isset($security_user)) {
set_module_setting('lightbox', 'LB_MUSIC_FILE', $_POST['NEW_LB_MUSIC_FILE']);
@@ -117,4 +114,3 @@ $LB_URL_HEIGHT=get_module_setting('lightbox', 'LB_URL_HEIGHT', '600'); // URL W
&nbsp;&nbsp;
<input type="reset" value="<?php echo WT_I18N::translate('Reset'); ?>" />
</form>
-<?php print_footer();
diff --git a/modules_v3/sitemap/admin_index.php b/modules_v3/sitemap/admin_index.php
index 036404eab3..054c15403d 100644
--- a/modules_v3/sitemap/admin_index.php
+++ b/modules_v3/sitemap/admin_index.php
@@ -30,17 +30,9 @@ if (!defined('WT_WEBTREES')) {
exit;
}
-//-- make sure that they have admin status before they can use this page
-//-- otherwise have them login again
-if (!WT_USER_IS_ADMIN) {
- if (WT_USER_ID) {
- header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH);
- exit;
- } else {
- header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.'login.php?url=module.php?mod=sitemap');
- exit;
- }
-}
+$controller=new WT_Controller_Base();
+$controller->requireAdminLogin();
+$controller->setPageTitle(WT_I18N::translate('Generate Sitemap files'));
global $GEDCOM, $SHOW_MARRIED_NAMES;
@@ -181,7 +173,7 @@ if ($action=="sendIndex") {
exit;
}
-print_header(WT_I18N::translate('Generate Sitemap files'));
+$controller->pageHeader();
if ($action=="generate") {
echo "<h3>";
@@ -400,4 +392,3 @@ if ($action=="") {
<?php
}
-print_footer();
diff --git a/modules_v3/stories/module.php b/modules_v3/stories/module.php
index b7b12e7546..e9ed947623 100644
--- a/modules_v3/stories/module.php
+++ b/modules_v3/stories/module.php
@@ -207,8 +207,10 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_
$this->config();
} else {
$block_id=safe_GET('block_id');
+
+ $controller=new WT_Controller_Base();
if ($block_id) {
- print_header(WT_I18N::translate('Edit story'));
+ $controller->setPageTitle(WT_I18N::translate('Edit story'));
$title=get_block_setting($block_id, 'title');
$story_body=get_block_setting($block_id, 'story_body');
$gedcom_id=WT_DB::prepare(
@@ -218,12 +220,13 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_
"SELECT xref FROM `##block` WHERE block_id=?"
)->execute(array($block_id))->fetchOne();
} else {
- print_header(WT_I18N::translate('Add story'));
+ $controller->setPageTitle(WT_I18N::translate('Add story'));
$title='';
$story_body='';
$gedcom_id=WT_GED_ID;
$xref=safe_GET('xref', WT_REGEX_XREF);
}
+ $controller->pageHeader();
?>
<script type="text/javascript">
var pastefield;
@@ -288,7 +291,6 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_
echo '</p>';
echo '</form>';
- print_footer();
exit;
}
} else {
@@ -322,7 +324,10 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_
global $WT_IMAGES, $TEXT_DIRECTION;
if (WT_USER_GEDCOM_ADMIN) {
- print_header($this->getTitle());
+
+ $controller=new WT_Controller_Base();
+ $controller->setPageTitle($this->getTitle());
+ $controller->pageHeader();
$stories=WT_DB::prepare(
"SELECT block_id, xref".
@@ -360,7 +365,6 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_
</tr>';
}
echo '</table>';
- print_footer();
} else {
header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH);
exit;
@@ -370,39 +374,40 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_
private function show_list() {
global $WT_IMAGES, $TEXT_DIRECTION;
- print_header($this->getTitle());
+ $controller=new WT_Controller_Base();
+ $controller->setPageTitle($this->getTitle());
+ $controller->pageHeader();
- $stories=WT_DB::prepare(
- "SELECT block_id, xref".
- " FROM `##block` b".
- " WHERE module_name=?".
- " AND gedcom_id=?".
- " ORDER BY xref"
- )->execute(array($this->getName(), WT_GED_ID))->fetchAll();
+ $stories=WT_DB::prepare(
+ "SELECT block_id, xref".
+ " FROM `##block` b".
+ " WHERE module_name=?".
+ " AND gedcom_id=?".
+ " ORDER BY xref"
+ )->execute(array($this->getName(), WT_GED_ID))->fetchAll();
- echo '<table class="list_table width90">';
- if (count($stories)>0) {
+ echo '<table class="list_table width90">';
+ if (count($stories)>0) {
+ echo '<tr>
+ <th class="list_label">', WT_I18N::translate('Story title'), '</th>
+ <th class="list_label">', WT_I18N::translate('Individual'), '</th>
+ </tr>';
+ }
+ foreach ($stories as $story) {
+ $indi=WT_Person::getInstance($story->xref);
+ if ($indi) {
+ $name="<a href=\"".$indi->getHtmlUrl()."#stories\">".$indi->getFullName()."</a>";
+ } else {
+ $name=$story->xref;
+ }
+ if ($indi->canDisplayDetails()) {
echo '<tr>
- <th class="list_label">', WT_I18N::translate('Story title'), '</th>
- <th class="list_label">', WT_I18N::translate('Individual'), '</th>
+ <td class="list_value">', get_block_setting($story->block_id, 'title'), '</td>
+ <td class="list_value wrap">', $name, '</td>
</tr>';
}
- foreach ($stories as $story) {
- $indi=WT_Person::getInstance($story->xref);
- if ($indi) {
- $name="<a href=\"".$indi->getHtmlUrl()."#stories\">".$indi->getFullName()."</a>";
- } else {
- $name=$story->xref;
- }
- if ($indi->canDisplayDetails()) {
- echo '<tr>
- <td class="list_value">', get_block_setting($story->block_id, 'title'), '</td>
- <td class="list_value wrap">', $name, '</td>
- </tr>';
- }
- }
- echo '</table>';
- print_footer();
+ }
+ echo '</table>';
}
// Implement WT_Module_Menu
diff --git a/modules_v3/tree/module.php b/modules_v3/tree/module.php
index a1db93c254..546d36a5ca 100644
--- a/modules_v3/tree/module.php
+++ b/modules_v3/tree/module.php
@@ -113,7 +113,11 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab {
$tv = new TreeView('tv');
ob_start();
$person=WT_Person::getInstance($rootid);
- print_header(WT_I18N::translate('Interactive tree of %s', $person->getFullName()));
+
+ $controller=new WT_Controller_Base();
+ $controller->setPageTitle(WT_I18N::translate('Interactive tree of %s', $person->getFullName()));
+ $controller->pageHeader();
+
if (WT_USE_LIGHTBOX) {
require WT_MODULES_DIR.'lightbox/functions/lb_call_js.php';
}
@@ -128,7 +132,6 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab {
$header = str_replace('</head>', $this->js.$this->css.'</head>', $header);
echo $header;
echo $tv->drawViewport($rootid, 4, $this->style);
- print_footer();
break;
case 'getDetails':