input; $user = JFactory::getUser(); if (!$user->authorise('core.admin', 'com_vikbooking')) { wp_die( '

' . JText::translate('FATAL_ERROR') . '

' . '

' . JText::translate('RESOURCE_AUTH_ERROR') . '

', 403 ); } $return = $input->getBase64('return', ''); $active = $input->getString('activerole', ''); // get roles $roles = array(); foreach (wp_roles()->roles as $slug => $role) { $roles[$slug] = $role['name']; } // reverse the roles (from the lowest to the highest) $roles = array_reverse($roles); // get actions $actions = JAccess::getActions('vikbooking'); if (empty($active)) { if (count($user->roles)) { $active = $user->roles[0]; } else { $keys = array_keys($roles); $active = array_shift($keys); } } $this->roles = $roles; $this->actions = $actions; $this->user = $user; $this->returnLink = $return; $this->activeRole = $active; $this->addToolbar(); // display parent parent::display($tpl); } /** * Helper method to setup the toolbar. * * @return void */ public function addToolbar() { JToolbarHelper::title(JText::translate('VBOACLMENUTITLE')); JToolbarHelper::apply('acl.save'); JToolbarHelper::save('acl.saveclose'); JToolbarHelper::cancel('acl.cancel'); } }