public function __construct($page) { admin_gatekeeper(); global $CONFIG; $cshop = new stdClass(); $this->controller = GLOBAL_IZAP_CURRENT_CONTROLLER; $this->action = 'action' . ucfirst($page[0]); $this->_page = $page; $this->url_vars = $this->_page; $this->page_layout = $this->page_shell = 'admin'; $cshop->view = $this->_view = 'admin/' . implode('/', $page); $this->page_elements['title'] = elgg_echo("admin:{$page[0]}"); if (count($page) > 1) { $this->page_elements['title'] .= ' : ' . elgg_echo('admin:' . implode(':', $page)); } if (method_exists($this, $this->action)) { elgg_admin_add_plugin_settings_menu(); elgg_set_context('admin'); elgg_unregister_css('elgg'); $url = elgg_get_simplecache_url('js', 'admin'); elgg_register_js('elgg.admin', $url); elgg_load_js('elgg.admin'); elgg_register_js('jquery.jeditable', 'vendors/jquery/jquery.jeditable.mini.js'); elgg_load_js('jquery.jeditable'); } $CONFIG->cshop = $cshop; }
function importUsersPageHandler($page) { admin_gatekeeper(); elgg_admin_add_plugin_settings_menu(); elgg_set_context('admin'); elgg_unregister_css('elgg'); elgg_load_js('elgg.admin'); elgg_load_js('jquery.jeditable'); $vars = array('page' => $page); $view = 'import/' . implode('/', $page); $title = "Import Users"; $content = elgg_view($view); $body = elgg_view_layout('admin', array('content' => $content, 'title' => $title)); echo elgg_view_page($title, $body, 'admin'); return true; }
* The standard HTML page shell that everything else fits into * * @package Elgg * @subpackage Core * * @uses $vars['title'] The page title * @uses $vars['body'] The main content of the page * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages() */ // backward compatability support for plugins that are not using the new approach // of routing through admin. See reportedcontent plugin for a simple example. if (elgg_get_context() == 'admin') { if (get_input('handler') != 'admin') { elgg_deprecated_notice("admin plugins should route through 'admin'.", 1.8); } elgg_admin_add_plugin_settings_menu(); elgg_unregister_css('elgg'); echo elgg_view('page/admin', $vars); return true; } // render content before head so that JavaScript and CSS can be loaded. See #4032 $topbar = elgg_view('page/elements/topbar', $vars); $messages = elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); $header = elgg_view('page/elements/header', $vars); $body = elgg_view('page/elements/body', $vars); $footer = elgg_view('page/elements/footer', $vars); // Set the content type header("Content-type: text/html; charset=UTF-8"); $lang = get_current_language(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
/** * Handle admin pages. Expects corresponding views as admin/section/subsection * * @param array $page Array of pages * * @return bool * @access private */ function admin_page_handler($page) { admin_gatekeeper(); elgg_admin_add_plugin_settings_menu(); elgg_set_context('admin'); elgg_unregister_css('elgg'); elgg_load_js('elgg.admin'); elgg_load_js('jquery.jeditable'); // default to dashboard if (!isset($page[0]) || empty($page[0])) { $page = array('dashboard'); } // was going to fix this in the page_handler() function but // it's commented to explicitly return a string if there's a trailing / if (empty($page[count($page) - 1])) { array_pop($page); } $vars = array('page' => $page); // special page for plugin settings since we create the form for them if ($page[0] == 'plugin_settings' && isset($page[1]) && (elgg_view_exists("settings/{$page[1]}/edit") || elgg_view_exists("plugins/{$page[1]}/settings"))) { $view = 'admin/plugin_settings'; $plugin = elgg_get_plugin_from_id($page[1]); $vars['plugin'] = $plugin; $title = elgg_echo("admin:{$page[0]}"); } else { $view = 'admin/' . implode('/', $page); $title = elgg_echo("admin:{$page[0]}"); if (count($page) > 1) { $title .= ' : ' . elgg_echo('admin:' . implode(':', $page)); } } // gets content and prevents direct access to 'components' views if ($page[0] == 'components' || !($content = elgg_view($view, $vars))) { $title = elgg_echo('admin:unknown_section'); $content = elgg_echo('admin:unknown_section'); } $body = elgg_view_layout('admin', array('content' => $content, 'title' => $title)); echo elgg_view_page($title, $body, 'admin'); return true; }
function userManagementPageHandler($page) { switch ($page[0]) { case 'users': include elgg_get_plugins_path() . 'userManagement/pages/users.php'; break; case 'deactivate': $userMgmt = new UserManagement(); $userMgmt->getInactiveUsers(); $userMgmt->deactivateUsers(); break; //activate account form //activate account form case 'activate': $userMgmt = new UserManagement(); //check if user doesnt have forces email send them to different form if ($userMgmt->validEmail(get_input('email'))) { include elgg_get_plugins_path() . 'userManagement/pages/activate.php'; } else { include elgg_get_plugins_path() . 'userManagement/pages/changeEmail.php'; } break; //activate account action //activate account action case 'activation': $userMgmt = new UserManagement(); $userGuid = get_input('u'); $code = get_input('c'); $user = get_entity($userGuid); if (!$user) { register_error(elgg_echo('activate:error')); forward(REFERER); } $userMgmt->setUser($user); if (!$userMgmt->validateCode($code)) { register_error(elgg_echo('activate:error')); forward(REFERER); } //activate user if ($userMgmt->activateUser()) { system_message(elgg_echo('activate:success')); forward(REFERER); } break; case 'import': admin_gatekeeper(); elgg_admin_add_plugin_settings_menu(); elgg_set_context('admin'); elgg_unregister_css('elgg'); elgg_load_js('elgg.admin'); elgg_load_js('jquery.jeditable'); $vars = array('page' => $page); $view = 'usermanagement/' . implode('/', $page); $title = "Import Users"; $content = elgg_view($view); $body = elgg_view_layout('admin', array('content' => $content, 'title' => $title)); echo elgg_view_page($title, $body, 'admin'); break; case 'resetPassword': set_input('guid', $_SESSION['userId']); include elgg_get_plugins_path() . "userManagement/pages/resetPassword.php"; break; case 'registerEmails': include elgg_get_plugins_path() . "userManagement/pages/registerEmails.php"; break; case 'admin': if ($page[1] == activate) { include elgg_get_plugins_path() . "userManagement/pages/admin/activate.php"; } break; default: return false; } return true; }