require_once('./includes/init.php');
require_once('./includes/functions.php');
+require_once('./includes/functions_admin.php');
// ###################################################################
// setup admin templates
// ###################################################################
-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') . "'");
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 '<strong>' . $number . '</strong>' . "\n";
- }
- else
- {
- return '<a href="' . $baselink . 'p=' . $number . '&pp=' . $paginator->getPerPage() . '">' . $number . '</a>' . "\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 .= '<a href="' . $baselink . 'p=1&pp=' . $paginator->getPerPage() . '">' . T('First') . '</a> ...';
- }
- if ($show['prev'])
- {
- $return .= '<a href="' . $baselink . 'p=' . $prevpage . '&pp=' . $paginator->getPerPage() . '">' . T('Prev') . '</a> ...';
- }
-
- $return .= $pagebits;
-
- if ($show['next'])
- {
- $return .= '... <a href="' . $baselink . 'p=' . $nextpage . '&pp=' . $paginator->getPerPage() . '">' . T('Next') . '</a>';
- }
- if ($show['last'])
- {
- $return .= '... <a href="' . $baselink . 'p=' . $paginator->getPageCount() . '&pp=' . $paginator->getPerPage() . '">' . T('Last') . '</a>';
- }
- return '<div style="margin-top: 15px; float: ' . $stylevar['right'] . '">' . $return . '</div>';
-}
-
?>
\ No newline at end of file
--- /dev/null
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # Bugdar
+|| # Copyright (c)2004-2009 Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version 2 of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+/**
+ * Fetches, evaluates, and returns the footer template
+ *
+ * @return string Footer template code
+ */
+function admin_footer()
+{
+ return BSTemplate::fetch('footer')->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 '<strong>' . $number . '</strong>' . "\n";
+ }
+ else
+ {
+ return '<a href="' . $baselink . 'p=' . $number . '&pp=' . $paginator->getPerPage() . '">' . $number . '</a>' . "\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 .= '<a href="' . $baselink . 'p=1&pp=' . $paginator->getPerPage() . '">' . T('First') . '</a> ...';
+ }
+ if ($show['prev'])
+ {
+ $return .= '<a href="' . $baselink . 'p=' . $prevpage . '&pp=' . $paginator->getPerPage() . '">' . T('Prev') . '</a> ...';
+ }
+
+ $return .= $pagebits;
+
+ if ($show['next'])
+ {
+ $return .= '... <a href="' . $baselink . 'p=' . $nextpage . '&pp=' . $paginator->getPerPage() . '">' . T('Next') . '</a>';
+ }
+ if ($show['last'])
+ {
+ $return .= '... <a href="' . $baselink . 'p=' . $paginator->getPageCount() . '&pp=' . $paginator->getPerPage() . '">' . T('Last') . '</a>';
+ }
+ return '<div style="margin-top: 15px; float: ' . $stylevar['right'] . '">' . $return . '</div>';
+}
+
+?>
\ No newline at end of file