42 $options[
'joins'][] =
"join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid";
44 $options[
'joins'] = array(
"join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid");
51 $options[
'wheres'][] =
"u.admin = 'yes'";
53 $options[
'wheres'][] =
"u.admin = 'yes'";
149 $href =
"admin/$parent_id/$menu_id";
156 $name =
"$parent_id:$name";
163 'context' =>
'admin',
164 'parent_name' => $parent_id,
166 'section' => $section
182 'href' =>
'admin/upgrades',
183 'text' =>
elgg_echo(
'admin:view_upgrades'),
208 'name' =>
'maintenance_mode',
209 'href' =>
'admin/administer_utilities/maintenance',
210 'text' =>
elgg_echo(
'admin:maintenance_mode:indicator_menu_item'),
251 'name' =>
'dashboard',
252 'href' =>
'admin/dashboard',
254 'context' =>
'admin',
256 'section' =>
'administer' 275 'name' =>
'upgrades',
276 'href' =>
'admin/upgrades',
278 'context' =>
'admin',
280 'section' =>
'configure' 286 'href' =>
'admin/plugins',
288 'context' =>
'admin',
290 'section' =>
'configure' 317 'name' =>
'administration',
326 $widgets = array(
'online_users',
'new_users',
'content_stats',
'banned_users',
'admin_welcome',
'control_panel',
'cron_status');
360 'list' =>
elgg_view(
'admin/plugins', [
'list_only' =>
true]),
395 'name' =>
'admin_logout',
396 'href' =>
'action/logout',
398 'is_trusted' =>
true,
403 'name' =>
'view_site',
406 'is_trusted' =>
true,
411 'name' =>
'admin_profile',
419 'name' =>
'maintenance',
420 'href' =>
'admin/administer_utilities/maintenance',
421 'text' =>
elgg_echo(
'admin:administer_utilities:maintenance'),
422 'link_class' =>
'elgg-maintenance-mode-warning',
431 'href' =>
'http://learn.elgg.org/en/stable/appendix/faqs.html',
436 'text' =>
elgg_echo(
'admin:footer:manual'),
437 'href' =>
'http://learn.elgg.org/en/stable/admin/index.html',
441 'name' =>
'community_forums',
442 'text' =>
elgg_echo(
'admin:footer:community_forums'),
443 'href' =>
'http://community.elgg.org/groups/all/',
448 'text' =>
elgg_echo(
'admin:footer:blog'),
449 'href' =>
'https://community.elgg.org/blog/all',
467 if (!$active_plugins) {
472 foreach ($active_plugins as
$plugin) {
479 'href' =>
"admin/plugin_settings/$plugin_id",
480 'text' => $plugin->getManifest()->getName(),
481 'parent_name' =>
'settings',
482 'context' =>
'admin',
483 'section' =>
'configure',
502 $configure_items =
$return[
'configure'];
503 if (is_array($configure_items)) {
505 foreach ($configure_items as $menu_item) {
506 if ($menu_item->getName() ==
'settings') {
515 $site_settings = array_splice(
$children, 0, 2);
517 array_splice(
$children, 0, 0, $site_settings);
549 if (!isset($page[0]) || empty($page[0])) {
550 $page = array(
'dashboard');
555 if (empty($page[count($page) - 1])) {
559 $vars = array(
'page' => $page);
562 if ($page[0] ==
'plugin_settings') {
566 $view =
'admin/plugin_settings';
575 $view =
'admin/' . implode(
'/', $page);
577 if (count($page) > 1) {
639 $current_path = preg_replace(
'~^https?~',
'', $current_url);
640 if (0 === strpos($current_path,
$site_path)) {
641 $current_path = ($current_path ===
$site_path) ?
'' : substr($current_path, strlen(
$site_path));
643 $current_path =
false;
648 'current_path' => $current_path,
649 'current_url' => $current_url,
664 if (
$info[
'identifier'] ==
'action' &&
$info[
'segments'][0] ==
'login') {
693 if (
$type ==
'login') {
738 $adminWidgets = array(
739 1 => array(
'control_panel',
'admin_welcome'),
740 2 => array(
'online_users',
'new_users',
'content_stats'),
743 foreach ($adminWidgets as
$column => $handlers) {
757 $events->registerHandler(
'init',
'system',
'_elgg_admin_init');
758 $events->registerHandler(
'ready',
'system',
'_elgg_admin_ready');
_elgg_add_admin_widgets($event, $type, $user)
Adds default admin widgets to the admin dashboard.
elgg_admin_notice_exists($id)
Check if an admin notice is currently active.
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
elgg_delete_admin_notice($id)
Remove an admin notice by ID.
$object
These two snippets demonstrates triggering an event and how to register for that event.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_view_icon($name, $vars=array())
View one of the icons.
get_user_by_email($email)
Get an array of users from an email address.
elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback)
Unregister a callback as a plugin hook.
_elgg_admin_maintenance_allow_url($current_url)
When in maintenance mode, should the given URL be handled normally?
_elgg_admin_markdown_page_handler($pages)
Formats and serves out markdown files from plugins.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
if($guid==elgg_get_logged_in_user_guid()) $name
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
elgg_is_menu_item_registered($menu_name, $item_name)
Check if a menu item has been registered.
elgg_view_resource($name, array $vars=[])
Render a resource view.
elgg_get_admin_notices($limit=10)
Get admin notices.
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
elgg_add_admin_notice($id, $message)
Write a persistent message to the admin view.
_elgg_create_notice_of_pending_upgrade($event, $type, $object)
Add an admin notice when a new object is created.
elgg_register_css($name, $url, $priority=null)
Register a CSS file for inclusion in the HTML head.
_elgg_admin_page_handler($page)
Handle admin pages.
$vars['type']
Install create admin account page.
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
$guid
Removes an admin notice.
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
_elgg_admin_pagesetup()
Handles any set up required for administration pages.
get_user_by_username($username)
Get user by username.
elgg_unregister_css($name)
Unregister a CSS file.
elgg_require_js($name)
Request that Elgg load an AMD module onto the page.
elgg_register_admin_menu_item($section, $menu_id, $parent_id=null, $priority=100)
Add an admin area section or child section.
elgg_load_css($name)
Load a CSS file for this page.
_elgg_admin_maintenance_action_check($hook, $type)
Prevent non-admins from using actions.
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
_elgg_admin_init()
Initialize the admin backend.
elgg_set_context($context)
Sets the page context.
elgg_in_context($context)
Check if this context exists anywhere in the stack.
elgg echo
Translates a string.
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
elgg global
Pointer to the global context.
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
_elgg_robots_page_handler()
Handle request for robots.txt.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
_elgg_admin_ready()
Setup after plugins are initialized.
elgg_ok_response($content= '', $message= '', $forward_url=null, $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_get_plugins($status= 'active', $site_guid=null)
Returns an ordered list of plugins.
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
elgg_admin_gatekeeper()
Used at the top of a page to mark it as admin only.
_elgg_admin_sort_page_menu($hook, $type, $return, $params)
Sort the plugin settings menu items.
elgg register_error
Wrapper function for system_messages.
elgg_load_js($name)
Load a JavaScript resource on this page.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_get_admins(array $options=array())
Get the admin users.
elgg_register_action($action, $filename="", $access= 'logged_in')
Registers an action.
_elgg_admin_maintenance_handler($hook, $type, $info)
Handle requests when in maintenance mode.
_elgg_ajax_plugins_update()
Returns plugin listing and admin menu to the client (used after plugin (de)activation) ...
if(!$collection_name) $id
_elgg_admin_add_plugin_settings_menu()
Create the plugin settings page menu.
elgg_get_plugin_from_id($plugin_id)
Returns an object with the path $path.
get_entity($guid)
Loads and returns an entity object from a guid.
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.