public function html_permissions($result) { if (is_post()) { if ($result === false) { Backend::addError('Could not update Permissions'); } else { Backend::addSuccess($result . ' Permissions Updated'); } Controller::redirect('previous'); } //GET if (!empty(Controller::$parameters[0])) { Backend::add('Sub Title', class_name(Controller::$parameters[0]) . ' Permissions'); Links::add('All Permissions', '?q=gate_manager/permissions', 'secondary'); } else { Backend::add('Sub Title', ConfigValue::get('Title') . ' Permissions'); } Backend::addContent(Render::renderFile('gate_manager.permissions.tpl.php', (array) $result)); }
public static function hook_post_display($data, $controller) { $user = BackendUser::check(); if ($user && count(array_intersect(array('superadmin', 'admin'), $user->roles))) { Links::add('Manage Application', '?q=admin', 'secondary'); } return $data; }
function html_manage($result) { Backend::add('Sub Title', 'Manage Components'); Backend::add('result', $result); Links::add('Admin', '?q=admin/index', 'secondary'); Backend::addScript(SITE_LINK . 'js/jquery.js'); Backend::addScript(SITE_LINK . 'js/component.manage.js'); Backend::addContent(Render::file('component.manage.tpl.php')); }