load('printer_navigation', 'navigator', true); $navigator->add_top_link(_('Home'), '../index.php'); $navigator->add_top_link(_('Logout'), '../login.php?do=cplogout'); $navigator->add_component('tab', 'options', null, _('Options'), 'index.php'); $navigator->add_component('tab', 'products', null, _('Products'), 'product.php'); $navigator->add_component('tab', 'fields', null, _('Fields'), 'field.php'); $navigator->add_component('tab', 'users', null, _('Users & Permissions'), 'user.php'); require_once('./includes/class_admin_navigation.php'); // ################################################################### // continue loading $bugsys->load('printer', 'admin', true); $admin->setRealm(_('Administration')); $admin->setLanguageInformation($language); $admin->css_link('../framework/printer.css.php'); // ################################################################### function admin_login() { global $admin, $bugsys; define('ISSO_PRINTER_NO_NAVIGATION', 1); $admin->page_start(_('Login'), null, '', 'document.cplogin.' . ($bugsys->userinfo['email'] ? 'password' : 'email') . '.focus();'); $admin->form_start('../login.php', 'cplogin', false, 'cplogin'); $admin->table_start(true, '425'); $admin->table_head(_('Login to Bugdar')); $admin->row_input(_('Email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle'); $admin->row_input(_('Password'), 'password', '', 2, 35, false, true, 'middle'); $admin->row_submit('', _('Login')); $admin->table_end(); $admin->form_end(); $admin->page_end(); } // ################################################################### if (can_perform('canadminpanel')) { $session = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'"); if ($session AND $session['userid'] == $bugsys->userinfo['userid'] AND $session['dateline'] >= (TIMENOW - 3600)) { // renew the cookie $funct->cookie(COOKIE_PREFIX . 'adminsession', $session['sessionid'], false); } else { $funct->cookie(COOKIE_PREFIX . 'adminsession', null); admin_login(); // do we need this message? $admin->error(_('Invalid admin session has been terminated.')); } } else { $funct->cookie(COOKIE_PREFIX . 'adminsession', null); 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 .= '' . _('First') . ' ...'; } if ($show['prev']) { $return .= '' . _('Prev') . ' ...'; } $return .= $pagebits; if ($show['next']) { $return .= '... ' . _('Next') . ''; } if ($show['last']) { $return .= '... ' . _('Last') . ''; } return '