load('printer_navigation', 'navigator', true); $navigator->add_top_link(T('Home'), '../index.php'); $navigator->add_top_link(T('Logout'), '../login.php?do=cplogout'); $navigator->add_component('tab', 'options', null, T('Options'), 'index.php'); $navigator->add_component('tab', 'products', null, T('Products'), 'product.php'); $navigator->add_component('tab', 'fields', null, T('Fields'), 'field.php'); $navigator->add_component('tab', 'users', null, T('Users & Permissions'), 'user.php'); require_once('./includes/class_admin_navigation.php'); // ################################################################### // continue loading $bugsys->load('printer', 'admin', true); $admin->setRealm(T('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(T('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(T('Login to Bugdar')); $admin->row_input(T('Email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle'); $admin->row_input(T('Password'), 'password', '', 2, 35, false, true, 'middle'); $admin->row_submit('', T('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(T('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 .= '' . T('First') . ' ...'; } if ($show['prev']) { $return .= '' . T('Prev') . ' ...'; } $return .= $pagebits; if ($show['next']) { $return .= '... ' . T('Next') . ''; } if ($show['last']) { $return .= '... ' . T('Last') . ''; } return '