From 11aaacbee50790c2d5a2c10e97307da213d6320d Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Fri, 15 May 2015 17:05:23 +0200 Subject: Revert "Show a relevant page title for other actions" This reverts commit c2fbf98617ceed35a8d735fbc917627e001f225b. --- inc/template.php | 63 ++++---------------------------------------------------- 1 file changed, 4 insertions(+), 59 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index fd8bff11a..3859065bc 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1035,8 +1035,6 @@ function tpl_pageinfo($ret = false) { * @return bool|string */ function tpl_pagetitle($id = null, $ret = false) { - global $ACT, $INPUT, $lang; - if(is_null($id)) { global $ID; $id = $ID; @@ -1044,67 +1042,14 @@ function tpl_pagetitle($id = null, $ret = false) { $name = $id; if(useHeading('navigation')) { - $first_heading = p_get_first_heading($id); - if($first_heading) $name = $first_heading; - } - - // default page title is the page name, modify with the current action - switch ($ACT) { - // admin functions - case 'admin' : - $page_title = $lang['btn_admin']; - // try to get the plugin name - // retrieve admin plugin name from $_REQUEST['page'] - if (($page = $INPUT->str('page', '', true)) != '') { - $pluginlist = plugin_list('admin'); - if (in_array($page, $pluginlist)) { - // attempt to load the plugin - - if (($plugin = plugin_load('admin',$page)) !== null){ - $plugin_title = $plugin->getMenuText(); - $page_title = $plugin_title ? $plugin_title : $page; - } - } - } - break; - - // user functions - case 'login' : - case 'profile' : - case 'register' : - case 'resendpwd' : - $page_title = $lang['btn_'.$ACT]; - break; - - // wiki functions - case 'search' : - case 'index' : - $page_title = $lang['btn_'.$ACT]; - break; - - // page functions - case 'edit' : - $page_title = "✎ ".$name; - break; - - case 'revisions' : - $page_title = $name . ' - ' . $lang['btn_revs']; - break; - - case 'backlink' : - case 'recent' : - case 'subscribe' : - $page_title = $name . ' - ' . $lang['btn_'.$ACT]; - break; - - default : // SHOW and anything else not included - $page_title = $name; + $title = p_get_first_heading($id); + if($title) $name = $title; } if($ret) { - return hsc($page_title); + return hsc($name); } else { - print hsc($page_title); + print hsc($name); return true; } } -- cgit v1.2.3