38 $options[
'metadata_name_value_pairs'][
'admin'] =
'yes';
117 'href' =>
'admin/upgrades',
118 'text' =>
elgg_echo(
'admin:view_upgrades'),
156 'name' =>
'maintenance_mode',
157 'href' =>
'admin/configure_utilities/maintenance',
158 'text' =>
elgg_echo(
'admin:maintenance_mode:indicator_menu_item'),
167 $widgets = [
'online_users',
'new_users',
'content_stats',
'banned_users',
'admin_welcome',
'control_panel',
'cron_status'];
203 'list' =>
elgg_view(
'admin/plugins', [
'list_only' =>
true]),
230 'text' =>
$admin->getDisplayName(),
231 'href' =>
$admin->getURL(),
233 'src' =>
$admin->getIconURL(
'small'),
234 'alt' =>
$admin->getDisplayName(),
236 'link_class' =>
'elgg-avatar-small',
241 'name' =>
'admin_logout',
242 'href' =>
'action/logout',
248 'name' =>
'view_site',
256 'name' =>
'maintenance',
257 'href' =>
'admin/configure_utilities/maintenance',
258 'text' =>
elgg_echo(
'admin:configure_utilities:maintenance'),
259 'link_class' =>
'elgg-maintenance-mode-warning',
288 'href' =>
'http://learn.elgg.org/en/stable/appendix/faqs.html',
293 'text' =>
elgg_echo(
'admin:footer:manual'),
294 'href' =>
'http://learn.elgg.org/en/stable/admin/index.html',
298 'name' =>
'community_forums',
299 'text' =>
elgg_echo(
'admin:footer:community_forums'),
300 'href' =>
'http://elgg.org/groups/all/',
305 'text' =>
elgg_echo(
'admin:footer:blog'),
306 'href' =>
'https://elgg.org/blog/all',
327 $return = $hook->getValue();
331 'name' =>
'dashboard',
335 'section' =>
'administer',
340 'href' =>
'admin/plugins',
343 'section' =>
'administer',
350 'section' =>
'administer',
353 'name' =>
'users:online',
354 'text' =>
elgg_echo(
'admin:users:online'),
355 'href' =>
'admin/users/online',
357 'section' =>
'administer',
358 'parent_name' =>
'users',
361 'name' =>
'users:admins',
362 'text' =>
elgg_echo(
'admin:users:admins'),
363 'href' =>
'admin/users/admins',
365 'section' =>
'administer',
366 'parent_name' =>
'users',
369 'name' =>
'users:newest',
370 'text' =>
elgg_echo(
'admin:users:newest'),
371 'href' =>
'admin/users/newest',
373 'section' =>
'administer',
374 'parent_name' =>
'users',
377 'name' =>
'users:add',
379 'href' =>
'admin/users/add',
381 'section' =>
'administer',
382 'parent_name' =>
'users',
386 'name' =>
'users:unvalidated',
387 'text' =>
elgg_echo(
'admin:users:unvalidated'),
388 'href' =>
'admin/users/unvalidated',
390 'section' =>
'administer',
391 'parent_name' =>
'users',
394 'name' =>
'upgrades',
395 'href' =>
'admin/upgrades',
398 'section' =>
'administer',
402 'name' =>
'administer_utilities',
403 'text' =>
elgg_echo(
'admin:administer_utilities'),
405 'section' =>
'administer',
410 'name' =>
'settings:basic',
411 'href' =>
'admin/settings/basic',
412 'text' =>
elgg_echo(
'admin:settings:basic'),
414 'section' =>
'configure',
417 'name' =>
'settings:advanced',
418 'href' =>
'admin/settings/advanced',
419 'text' =>
elgg_echo(
'admin:settings:advanced'),
421 'section' =>
'configure',
424 'name' =>
'security',
425 'href' =>
'admin/security',
428 'section' =>
'configure',
432 'name' =>
'configure_utilities',
433 'text' =>
elgg_echo(
'admin:configure_utilities'),
435 'section' =>
'configure',
438 'name' =>
'configure_utilities:maintenance',
439 'text' =>
elgg_echo(
'admin:configure_utilities:maintenance'),
440 'href' =>
'admin/configure_utilities/maintenance',
441 'section' =>
'configure',
442 'parent_name' =>
'configure_utilities',
445 'name' =>
'configure_utilities:menu_items',
446 'text' =>
elgg_echo(
'admin:configure_utilities:menu_items'),
447 'href' =>
'admin/configure_utilities/menu_items',
448 'section' =>
'configure',
449 'parent_name' =>
'configure_utilities',
452 'name' =>
'configure_utilities:robots',
453 'text' =>
elgg_echo(
'admin:configure_utilities:robots'),
454 'href' =>
'admin/configure_utilities/robots',
455 'section' =>
'configure',
456 'parent_name' =>
'configure_utilities',
461 'name' =>
'statistics',
462 'href' =>
'admin/statistics',
464 'section' =>
'information',
468 'href' =>
'admin/server',
470 'section' =>
'information',
494 if (empty($active_plugins)) {
499 $plugins_with_settings = [];
501 foreach ($active_plugins as
$plugin) {
510 'href' =>
"admin/plugin_settings/$plugin_id",
512 'parent_name' =>
'plugin_settings',
513 'section' =>
'configure',
517 if (empty($plugins_with_settings)) {
521 $return = $hook->getValue();
524 'name' =>
'plugin_settings',
525 'text' =>
elgg_echo(
'admin:plugin_settings'),
526 'section' =>
'configure',
529 ksort($plugins_with_settings);
531 foreach ($plugins_with_settings as $plugin_item) {
558 $return = $hook->getValue();
561 'name' =>
'select_all',
563 'name' =>
'select_all',
565 'id' =>
'admin-users-unvalidated-bulk-select',
569 'deps' =>
'admin/users/unvalidated',
573 'id' =>
'admin-users-unvalidated-bulk-validate',
574 'name' =>
'bulk_validate',
576 'href' =>
'action/admin/user/bulk/validate',
579 'section' =>
'right',
580 'deps' =>
'admin/users/unvalidated',
584 'id' =>
'admin-users-unvalidated-bulk-delete',
585 'name' =>
'bulk_delete',
587 'href' =>
'action/admin/user/bulk/delete',
588 'confirm' =>
elgg_echo(
'deleteconfirm:plural'),
590 'section' =>
'right',
591 'deps' =>
'admin/users/unvalidated',
614 $page = [
'dashboard'];
626 if (
$page[0] ==
'plugin_settings') {
628 $view =
'admin/plugin_settings';
640 if (count(
$page) > 1) {
666 $current_path = preg_replace(
'~^https?~',
'', $current_url);
667 if (0 === strpos($current_path,
$site_path)) {
668 $current_path = ($current_path ===
$site_path) ?
'' : substr($current_path, strlen(
$site_path));
670 $current_path =
false;
675 'current_path' => $current_path,
676 'current_url' => $current_url,
697 if (
$info[
'identifier'] ==
'action' &&
$info[
'segments'][0] ==
'login') {
725 if (
$type ==
'login') {
732 if (!empty($users)) {
772 1 => [
'control_panel',
'admin_welcome'],
773 2 => [
'online_users',
'new_users',
'content_stats'],
776 foreach ($adminWidgets as
$column => $handlers) {
779 if (
$guid !==
false) {
807 if (!$event instanceof \
Elgg\Notifications\SubscriptionNotificationEvent) {
811 if (!in_array($event->getAction(), [
'make_admin',
'remove_admin'])) {
815 $user = $event->getObject();
832 foreach ($admin_batch as
$admin) {
833 $return_value[$admin->guid] = [
'email'];
836 return $return_value;
851 if (!($return_value instanceof \
Elgg\Notifications\Notification)) {
860 if (!($recipient instanceof
ElggUser) || !(
$object instanceof ElggUser) || !($actor instanceof ElggUser)) {
864 if ($recipient->getGUID() ===
$object->getGUID()) {
871 $return_value->subject =
elgg_echo(
'admin:notification:make_admin:admin:subject', [
$site->getDisplayName()],
$language);
872 $return_value->body =
elgg_echo(
'admin:notification:make_admin:admin:body', [
873 $recipient->getDisplayName(),
874 $actor->getDisplayName(),
876 $site->getDisplayName(),
883 return $return_value;
898 if (!($return_value instanceof \
Elgg\Notifications\Notification)) {
907 if (!($recipient instanceof
ElggUser) || !(
$object instanceof ElggUser) || !($actor instanceof ElggUser)) {
911 if ($recipient->getGUID() ===
$object->getGUID()) {
918 $return_value->subject =
elgg_echo(
'admin:notification:remove_admin:admin:subject', [
$site->getDisplayName()],
$language);
919 $return_value->body =
elgg_echo(
'admin:notification:remove_admin:admin:body', [
920 $recipient->getDisplayName(),
921 $actor->getDisplayName(),
923 $site->getDisplayName(),
930 return $return_value;
950 if (!$event instanceof \
Elgg\Notifications\SubscriptionNotificationEvent) {
954 if (!in_array($event->getAction(), [
'make_admin',
'remove_admin'])) {
958 $user = $event->getObject();
963 $return_value[
$user->guid] = [
'email'];
965 return $return_value;
980 if (!($return_value instanceof \
Elgg\Notifications\Notification)) {
989 if (!($recipient instanceof
ElggUser) || !(
$object instanceof ElggUser) || !($actor instanceof ElggUser)) {
993 if ($recipient->getGUID() !==
$object->getGUID()) {
1000 $return_value->subject =
elgg_echo(
'admin:notification:make_admin:user:subject', [
$site->getDisplayName()],
$language);
1001 $return_value->body =
elgg_echo(
'admin:notification:make_admin:user:body', [
1002 $recipient->getDisplayName(),
1003 $actor->getDisplayName(),
1004 $site->getDisplayName(),
1010 return $return_value;
1025 if (!($return_value instanceof \
Elgg\Notifications\Notification)) {
1034 if (!($recipient instanceof
ElggUser) || !(
$object instanceof ElggUser) || !($actor instanceof ElggUser)) {
1038 if ($recipient->getGUID() !==
$object->getGUID()) {
1045 $return_value->subject =
elgg_echo(
'admin:notification:remove_admin:user:subject', [
$site->getDisplayName()],
$language);
1046 $return_value->body =
elgg_echo(
'admin:notification:remove_admin:user:body', [
1047 $recipient->getDisplayName(),
1048 $actor->getDisplayName(),
1049 $site->getDisplayName(),
1053 $return_value->url =
'';
1055 return $return_value;
1070 $selected = $hook->getParam(
'filter_value');
1073 'name' =>
'pending',
1074 'text' =>
elgg_echo(
'admin:upgrades:menu:pending'),
1075 'href' =>
'admin/upgrades',
1077 'selected' => $selected ===
'pending',
1081 'name' =>
'completed',
1082 'text' =>
elgg_echo(
'admin:upgrades:menu:completed'),
1083 'href' =>
'admin/upgrades/finished',
1085 'selected' => $selected ===
'completed',
1090 'text' =>
elgg_echo(
'admin:upgrades:menu:db'),
1091 'href' =>
'admin/upgrades/db',
1093 'selected' => $selected ===
'db',
1103 $events->registerHandler(
'init',
'system',
'_elgg_admin_init');
_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.
if(!$item instanceof ElggRiverItem) $object
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_header_menu($hook, $type, $return, $params)
Register menu items for the admin_header menu.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
get_user_by_email($email)
Get an array of users from an email address.
elgg_define_js($name, $config)
Defines a JS lib as an AMD module.
elgg_view_resource($name, array $vars=[])
Render a resource view.
_elgg_admin_prepare_admin_notification_make_admin($hook, $type, $return_value, $params)
Prepare the notification content for site admins about making a site admin.
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.
Database abstraction query builder.
$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_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
if(!$item instanceof ElggEntity) $link
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
elgg_get_admin_notices(array $options=[])
Get admin notices.
_elgg_admin_page_menu(\Elgg\Hook $hook)
Register menu items for the page menu.
elgg_get_admins(array $options=[])
Get the admin users.
get_user_by_username($username)
Get user by username.
_elgg_admin_prepare_admin_notification_remove_admin($hook, $type, $return_value, $params)
Prepare the notification content for site admins about removing a site admin.
elgg_unregister_css($name)
Unregister a CSS file.
_elgg_admin_prepare_user_notification_make_admin($hook, $type, $return_value, $params)
Prepare the notification content for the user being made as a site admins.
elgg_require_js($name)
Request that Elgg load an AMD module onto the page.
_elgg_admin_footer_menu($hook, $type, $return, $params)
Register menu items for the admin_footer menu.
_elgg_admin_maintenance_action_check($hook, $type)
Prevent non-admins from using actions.
$id
River item delete action.
if(!$owner||!$owner->canEdit()) if(!$owner->hasIcon('master')) if(!$owner->saveIconFromElggFile($owner->getIcon('master'), 'icon', $coords)) $view
Base class for events and hooks.
_elgg_admin_upgrades_menu(\Elgg\Hook $hook)
Add menu items to the filter menu on the admin upgrades page.
elgg_get_entities(array $options=[])
Fetches/counts entities or performs a calculation on their properties.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
_elgg_admin_user_unvalidated_bulk_menu(\Elgg\Hook $hook)
Register menu items to the bulk actions for unvalidated users.
_elgg_admin_init()
Initialize the admin backend.
elgg_set_context($context)
Sets the page context.
_elgg_admin_get_admin_subscribers_admin_action($hook, $type, $return_value, $params)
Add the current site admins to the subscribers when making/removing an admin user.
elgg_in_context($context)
Check if this context exists anywhere in the stack.
compare($x, $comparison, $y=null, $type=null, $case_sensitive=null)
Build value comparison clause.
elgg echo
Translates a string.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
if(!empty($screenshots)) $info
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
_elgg_admin_prepare_user_notification_remove_admin($hook, $type, $return_value, $params)
Prepare the notification content for the user being removed as a site admins.
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
elgg_extend_view($view, $view_extension, $priority=501)
Extends a view with another view.
elgg_get_site_entity()
Get the current site entity.
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_get_plugins($status= 'active')
Returns an ordered list of plugins.
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_admin_get_user_subscriber_admin_action($hook, $type, $return_value, $params)
Add the user to the subscribers when making/removing the admin role.
_elgg_config()
Get the Elgg config service.
elgg_admin_gatekeeper()
Used at the top of a page to mark it as admin only.
elgg_register_notification_event($object_type, $object_subtype, array $actions=[])
Register a notification event.
elgg register_error
Wrapper function for system_messages.
elgg_view_layout($layout_name, $vars=[])
Displays a layout with optional parameters.
$content
Set robots.txt action.
_elgg_services()
Get the global service provider.
if(!$plugin) $plugin_name
_elgg_admin_page_menu_plugin_settings(\Elgg\Hook $hook)
Register plugin settings menu items for the admin page menu.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
_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) ...
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
elgg_get_config($name, $default=null)
Get an Elgg configuration value.
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.