From cf35984f1c0202eb213b689a64b9485749a56f6e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 10 Jan 2009 15:21:11 -0500 Subject: [PATCH] Move some functions that were previously declared in admin/global.php to a new includes/functions_admin.php * admin/global.php: Moved functions out of this, and into... * includes/functions_admin.php: New file --- admin/global.php | 80 +-------------------------- includes/functions_admin.php | 103 +++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 79 deletions(-) create mode 100644 includes/functions_admin.php diff --git a/admin/global.php b/admin/global.php index 2f8a485..8bcc915 100755 --- a/admin/global.php +++ b/admin/global.php @@ -23,6 +23,7 @@ chdir('./../'); require_once('./includes/init.php'); require_once('./includes/functions.php'); +require_once('./includes/functions_admin.php'); // ################################################################### // setup admin templates @@ -55,19 +56,6 @@ BSTemplate::$globalVars = array( // ################################################################### -function admin_footer() -{ - return BSTemplate::fetch('footer')->evaluate()->getTemplate(); -} - -function admin_login() -{ - BSTemplate::fetch('login')->evaluate()->flush(); - exit; -} - -// ################################################################### - if (can_perform('canadminpanel')) { $session = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $input->inputEscape(COOKIE_PREFIX . 'adminsession') . "'"); @@ -88,70 +76,4 @@ else admin_login(); } -// ################################################################### - -// ################################################################### -/** -* Callback function for the Pagination->BitProcessor() -* -* @param string Base link -* @param bool Do not show this as a link -* @param integer Page number -* @param object Page navigator framework -* -* @return string Processed HTML -*/ -function AdminPageNavigatorBitCallback($baselink, $nolink, $number, $paginator) -{ - if ($nolink) - { - return '' . $number . '' . "\n"; - } - else - { - return '' . $number . '' . "\n"; - } -} - -// ################################################################### -/** -* Callback function for the Pagination->NavigatorProcessor() -* -* @param string Base URL -* @param integer Next page number -* @param integer Previous page number -* @param array Show information -* @param string Individual page bits -* @param object Page navigator framework -* -* @return string Processed HTML -*/ -function AdminPageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pagebits, $paginator) -{ - global $stylevar; - - $return = ''; - - if ($show['first']) - { - $return .= '' . T('First') . ' ...'; - } - if ($show['prev']) - { - $return .= '' . T('Prev') . ' ...'; - } - - $return .= $pagebits; - - if ($show['next']) - { - $return .= '... ' . T('Next') . ''; - } - if ($show['last']) - { - $return .= '... ' . T('Last') . ''; - } - return '
' . $return . '
'; -} - ?> \ No newline at end of file diff --git a/includes/functions_admin.php b/includes/functions_admin.php new file mode 100644 index 0000000..6778235 --- /dev/null +++ b/includes/functions_admin.php @@ -0,0 +1,103 @@ +evaluate()->getTemplate(); +} + +/** + * Displays the login screen and ends execution of the script + */ +function admin_login() +{ + BSTemplate::fetch('login')->evaluate()->flush(); + exit; +} + +/** + * Callback function for the Pagination->BitProcessor() + * + * @param string Base link + * @param bool Do not show this as a link + * @param integer Page number + * @param object Page navigator framework + * + * @return string Processed HTML + */ +function AdminPageNavigatorBitCallback($baselink, $nolink, $number, $paginator) +{ + if ($nolink) + { + return '' . $number . '' . "\n"; + } + else + { + return '' . $number . '' . "\n"; + } +} + +/** + * Callback function for the Pagination->NavigatorProcessor() + * + * @param string Base URL + * @param integer Next page number + * @param integer Previous page number + * @param array Show information + * @param string Individual page bits + * @param object Page navigator framework + * + * @return string Processed HTML + */ +function AdminPageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pagebits, $paginator) +{ + global $stylevar; + + $return = ''; + + if ($show['first']) + { + $return .= '' . T('First') . ' ...'; + } + if ($show['prev']) + { + $return .= '' . T('Prev') . ' ...'; + } + + $return .= $pagebits; + + if ($show['next']) + { + $return .= '... ' . T('Next') . ''; + } + if ($show['last']) + { + $return .= '... ' . T('Last') . ''; + } + return '
' . $return . '
'; +} + +?> \ No newline at end of file -- 2.22.5