Elgg  Version 2.3
admin.php
Go to the documentation of this file.
1 <?php
35 function elgg_get_admins(array $options = array()) {
37 
38  if (isset($options['joins'])) {
39  if (!is_array($options['joins'])) {
40  $options['joins'] = array($options['joins']);
41  }
42  $options['joins'][] = "join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid";
43  } else {
44  $options['joins'] = array("join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid");
45  }
46 
47  if (isset($options['wheres'])) {
48  if (!is_array($options['wheres'])) {
49  $options['wheres'] = array($options['wheres']);
50  }
51  $options['wheres'][] = "u.admin = 'yes'";
52  } else {
53  $options['wheres'][] = "u.admin = 'yes'";
54  }
55 
57 }
58 
76  return _elgg_services()->adminNotices->add($id, $message);
77 }
78 
93  return _elgg_services()->adminNotices->delete($id);
94 }
95 
105  return _elgg_services()->adminNotices->find($limit);
106 }
107 
117  return _elgg_services()->adminNotices->exists($id);
118 }
119 
140 function elgg_register_admin_menu_item($section, $menu_id, $parent_id = null, $priority = 100) {
141 
142  // make sure parent is registered
143  if ($parent_id && !elgg_is_menu_item_registered('page', $parent_id)) {
144  elgg_register_admin_menu_item($section, $parent_id);
145  }
146 
147  // in the admin section parents never have links
148  if ($parent_id) {
149  $href = "admin/$parent_id/$menu_id";
150  } else {
151  $href = null;
152  }
153 
154  $name = $menu_id;
155  if ($parent_id) {
156  $name = "$parent_id:$name";
157  }
158 
159  return elgg_register_menu_item('page', array(
160  'name' => $name,
161  'href' => $href,
162  'text' => elgg_echo("admin:$name"),
163  'context' => 'admin',
164  'parent_name' => $parent_id,
165  'priority' => $priority,
166  'section' => $section
167  ));
168 }
169 
179  if ($object instanceof \ElggUpgrade) {
180  // Link to the Upgrades section
181  $link = elgg_view('output/url', array(
182  'href' => 'admin/upgrades',
183  'text' => elgg_echo('admin:view_upgrades'),
184  ));
185 
186  $message = elgg_echo('admin:pending_upgrades');
187 
188  elgg_add_admin_notice('pending_upgrades', "$message $link");
189  }
190 }
191 
197 function _elgg_admin_init() {
198 
199  elgg_register_event_handler('pagesetup', 'system', '_elgg_admin_pagesetup', 1000);
200 
201  // maintenance mode
202  if (elgg_get_config('elgg_maintenance_mode', null)) {
203  elgg_register_plugin_hook_handler('route', 'all', '_elgg_admin_maintenance_handler', 600);
204  elgg_register_plugin_hook_handler('action', 'all', '_elgg_admin_maintenance_action_check', 600);
205  elgg_register_css('maintenance', elgg_get_simplecache_url('maintenance.css'));
206 
207  elgg_register_menu_item('topbar', array(
208  'name' => 'maintenance_mode',
209  'href' => 'admin/administer_utilities/maintenance',
210  'text' => elgg_echo('admin:maintenance_mode:indicator_menu_item'),
211  'priority' => 900,
212  ));
213  }
214 
215  elgg_register_action('admin/user/ban', '', 'admin');
216  elgg_register_action('admin/user/unban', '', 'admin');
217  elgg_register_action('admin/user/delete', '', 'admin');
218  elgg_register_action('admin/user/resetpassword', '', 'admin');
219  elgg_register_action('admin/user/makeadmin', '', 'admin');
220  elgg_register_action('admin/user/removeadmin', '', 'admin');
221 
222  elgg_register_action('admin/site/update_basic', '', 'admin');
223  elgg_register_action('admin/site/update_advanced', '', 'admin');
224  elgg_register_action('admin/site/flush_cache', '', 'admin');
225  elgg_register_action('admin/site/unlock_upgrade', '', 'admin');
226  elgg_register_action('admin/site/set_robots', '', 'admin');
227  elgg_register_action('admin/site/set_maintenance_mode', '', 'admin');
228 
229  elgg_register_action('admin/upgrades/upgrade_database_guid_columns', '', 'admin');
230  elgg_register_action('admin/site/regenerate_secret', '', 'admin');
231 
232  elgg_register_action('admin/menu/save', '', 'admin');
233 
234  elgg_register_action('admin/delete_admin_notice', '', 'admin');
235 
236  elgg_register_action('profile/fields/reset', '', 'admin');
237  elgg_register_action('profile/fields/add', '', 'admin');
238  elgg_register_action('profile/fields/edit', '', 'admin');
239  elgg_register_action('profile/fields/delete', '', 'admin');
240  elgg_register_action('profile/fields/reorder', '', 'admin');
241 
242  elgg_register_simplecache_view('admin.css');
243 
244  elgg_load_css('lightbox');
245 
246  elgg_register_js('jquery.jeditable', elgg_get_simplecache_url('jquery.jeditable.js'));
247 
248  // administer
249  // dashboard
250  elgg_register_menu_item('page', array(
251  'name' => 'dashboard',
252  'href' => 'admin/dashboard',
253  'text' => elgg_echo('admin:dashboard'),
254  'context' => 'admin',
255  'priority' => 10,
256  'section' => 'administer'
257  ));
258  // statistics
259  elgg_register_admin_menu_item('administer', 'statistics', null, 20);
260  elgg_register_admin_menu_item('administer', 'overview', 'statistics');
261  elgg_register_admin_menu_item('administer', 'server', 'statistics');
262  //utilities
263  elgg_register_admin_menu_item('administer', 'maintenance', 'administer_utilities');
264 
265  // users
266  elgg_register_admin_menu_item('administer', 'users', null, 20);
267  elgg_register_admin_menu_item('administer', 'online', 'users', 10);
268  elgg_register_admin_menu_item('administer', 'admins', 'users', 20);
269  elgg_register_admin_menu_item('administer', 'newest', 'users', 30);
270  elgg_register_admin_menu_item('administer', 'add', 'users', 40);
271 
272  // configure
273  // upgrades
274  elgg_register_menu_item('page', array(
275  'name' => 'upgrades',
276  'href' => 'admin/upgrades',
277  'text' => elgg_echo('admin:upgrades'),
278  'context' => 'admin',
279  'priority' => 10,
280  'section' => 'configure'
281  ));
282 
283  // plugins
284  elgg_register_menu_item('page', array(
285  'name' => 'plugins',
286  'href' => 'admin/plugins',
287  'text' => elgg_echo('admin:plugins'),
288  'context' => 'admin',
289  'priority' => 75,
290  'section' => 'configure'
291  ));
292 
293  // settings
294  elgg_register_admin_menu_item('configure', 'appearance', null, 50);
295  elgg_register_admin_menu_item('configure', 'settings', null, 100);
296  elgg_register_admin_menu_item('configure', 'basic', 'settings', 10);
297  elgg_register_admin_menu_item('configure', 'advanced', 'settings', 20);
298  // plugin settings are added in _elgg_admin_add_plugin_settings_menu() via the admin page handler
299  // for performance reasons.
300 
301  // appearance
302  elgg_register_admin_menu_item('configure', 'menu_items', 'appearance', 30);
303  elgg_register_admin_menu_item('configure', 'profile_fields', 'appearance', 40);
304  // default widgets is added via an event handler elgg_default_widgets_init() in widgets.php
305  // because it requires additional setup.
306 
307  // configure utilities
308  elgg_register_admin_menu_item('configure', 'robots', 'configure_utilities');
309 
310  // we want plugin settings menu items to be sorted alphabetical
311  if (elgg_in_context('admin') && elgg_is_admin_logged_in()) {
312  elgg_register_plugin_hook_handler('prepare', 'menu:page', '_elgg_admin_sort_page_menu');
313  }
314 
315  if (elgg_is_admin_logged_in()) {
316  elgg_register_menu_item('topbar', array(
317  'name' => 'administration',
318  'href' => 'admin',
319  'text' => elgg_view_icon('settings') . elgg_echo('admin'),
320  'priority' => 100,
321  'section' => 'alt',
322  ));
323  }
324 
325  // widgets
326  $widgets = array('online_users', 'new_users', 'content_stats', 'banned_users', 'admin_welcome', 'control_panel', 'cron_status');
327  foreach ($widgets as $widget) {
329  $widget,
330  elgg_echo("admin:widget:$widget"),
331  elgg_echo("admin:widget:$widget:help"),
332  array('admin')
333  );
334  }
335 
336  // automatic adding of widgets for admin
337  elgg_register_event_handler('make_admin', 'user', '_elgg_add_admin_widgets');
338 
339  // Add notice about pending upgrades
340  elgg_register_event_handler('create', 'object', '_elgg_create_notice_of_pending_upgrade');
341 
342  elgg_register_page_handler('admin', '_elgg_admin_page_handler');
343  elgg_register_page_handler('admin_plugin_text_file', '_elgg_admin_markdown_page_handler');
344  elgg_register_page_handler('robots.txt', '_elgg_robots_page_handler');
345  elgg_register_page_handler('admin_plugins_refresh', '_elgg_ajax_plugins_update');
346 }
347 
357  elgg_set_context('admin');
358 
359  return elgg_ok_response([
360  'list' => elgg_view('admin/plugins', ['list_only' => true]),
361  'sidebar' => elgg_view('admin/sidebar'),
362  ]);
363 }
364 
371 function _elgg_admin_ready() {
372  // if a plugin has extended the deprecated admin.js view, register it for simplecache loading.
373  if (elgg_view_exists('admin.js')) {
374  elgg_register_simplecache_view('admin.js');
375  }
376 }
377 
385  if (elgg_in_context('admin') && elgg_is_admin_logged_in()) {
386  $url = elgg_get_simplecache_url('admin.css');
387  elgg_register_css('elgg.admin', $url);
388  elgg_load_css('elgg.admin');
389  elgg_unregister_css('elgg');
390 
392 
393  // setup header menu
394  elgg_register_menu_item('admin_header', array(
395  'name' => 'admin_logout',
396  'href' => 'action/logout',
397  'text' => elgg_echo('logout'),
398  'is_trusted' => true,
399  'priority' => 1000,
400  ));
401 
402  elgg_register_menu_item('admin_header', array(
403  'name' => 'view_site',
404  'href' => elgg_get_site_url(),
405  'text' => elgg_echo('admin:view_site'),
406  'is_trusted' => true,
407  'priority' => 900,
408  ));
409 
410  elgg_register_menu_item('admin_header', array(
411  'name' => 'admin_profile',
412  'href' => false,
413  'text' => elgg_echo('admin:loggedin', array($admin->name)),
414  'priority' => 800,
415  ));
416 
417  if (elgg_get_config('elgg_maintenance_mode', null)) {
418  elgg_register_menu_item('admin_header', array(
419  'name' => 'maintenance',
420  'href' => 'admin/administer_utilities/maintenance',
421  'text' => elgg_echo('admin:administer_utilities:maintenance'),
422  'link_class' => 'elgg-maintenance-mode-warning',
423  'priority' => 700,
424  ));
425  }
426 
427  // setup footer menu
428  elgg_register_menu_item('admin_footer', array(
429  'name' => 'faq',
430  'text' => elgg_echo('admin:footer:faq'),
431  'href' => 'http://learn.elgg.org/en/stable/appendix/faqs.html',
432  ));
433 
434  elgg_register_menu_item('admin_footer', array(
435  'name' => 'manual',
436  'text' => elgg_echo('admin:footer:manual'),
437  'href' => 'http://learn.elgg.org/en/stable/admin/index.html',
438  ));
439 
440  elgg_register_menu_item('admin_footer', array(
441  'name' => 'community_forums',
442  'text' => elgg_echo('admin:footer:community_forums'),
443  'href' => 'http://community.elgg.org/groups/all/',
444  ));
445 
446  elgg_register_menu_item('admin_footer', array(
447  'name' => 'blog',
448  'text' => elgg_echo('admin:footer:blog'),
449  'href' => 'https://community.elgg.org/blog/all',
450  ));
451  }
452 }
453 
465 
466  $active_plugins = elgg_get_plugins('active');
467  if (!$active_plugins) {
468  // nothing added because no items
469  return;
470  }
471 
472  foreach ($active_plugins as $plugin) {
473  $plugin_id = $plugin->getID();
474  $settings_view_old = 'settings/' . $plugin_id . '/edit';
475  $settings_view_new = 'plugins/' . $plugin_id . '/settings';
477  elgg_register_menu_item('page', array(
478  'name' => $plugin_id,
479  'href' => "admin/plugin_settings/$plugin_id",
480  'text' => $plugin->getManifest()->getName(),
481  'parent_name' => 'settings',
482  'context' => 'admin',
483  'section' => 'configure',
484  ));
485  }
486  }
487 }
488 
502  $configure_items = $return['configure'];
503  if (is_array($configure_items)) {
504  /* @var \ElggMenuItem[] $configure_items */
505  foreach ($configure_items as $menu_item) {
506  if ($menu_item->getName() == 'settings') {
507  $settings = $menu_item;
508  }
509  }
510 
511  if (!empty($settings) && $settings instanceof \ElggMenuItem) {
512  // keep the basic and advanced settings at the top
513  /* @var \ElggMenuItem $settings */
514  $children = $settings->getChildren();
515  $site_settings = array_splice($children, 0, 2);
516  usort($children, [\ElggMenuBuilder::class, 'compareByText']);
517  array_splice($children, 0, 0, $site_settings);
518  $settings->setChildren($children);
519  }
520  }
521 }
522 
531 function _elgg_admin_page_handler($page) {
534  elgg_set_context('admin');
535 
536  elgg_unregister_css('elgg');
537  elgg_require_js('elgg/admin');
538 
539  // if a plugin has extended the deprecated admin.js view, add it to the page
540  if (elgg_view_exists('admin.js')) {
541  elgg_deprecated_notice("The view admin.js (AKA js/admin) is deprecated", "2.0");
542  elgg_register_js('elgg.deprecated.admin', elgg_get_simplecache_url('admin.js'));
543  elgg_load_js('elgg.deprecated.admin');
544  }
545 
546  elgg_load_js('jquery.jeditable');
547 
548  // default to dashboard
549  if (!isset($page[0]) || empty($page[0])) {
550  $page = array('dashboard');
551  }
552 
553  // was going to fix this in the page_handler() function but
554  // it's commented to explicitly return a string if there's a trailing /
555  if (empty($page[count($page) - 1])) {
556  array_pop($page);
557  }
558 
559  $vars = array('page' => $page);
560 
561  // special page for plugin settings since we create the form for them
562  if ($page[0] == 'plugin_settings') {
563  if (isset($page[1]) && (elgg_view_exists("settings/{$page[1]}/edit") ||
564  elgg_view_exists("plugins/{$page[1]}/settings"))) {
565 
566  $view = 'admin/plugin_settings';
567  $plugin = elgg_get_plugin_from_id($page[1]);
568  $vars['plugin'] = $plugin;
569 
570  $title = elgg_echo("admin:{$page[0]}");
571  } else {
572  forward('', '404');
573  }
574  } else {
575  $view = 'admin/' . implode('/', $page);
576  $title = elgg_echo("admin:{$page[0]}");
577  if (count($page) > 1) {
578  $title .= ' : ' . elgg_echo('admin:' . implode(':', $page));
579  }
580  }
581 
582  // gets content and prevents direct access to 'components' views
583  if ($page[0] == 'components' || !($content = elgg_view($view, $vars))) {
584  $title = elgg_echo('admin:unknown_section');
585  $content = elgg_echo('admin:unknown_section');
586  }
587 
588  $body = elgg_view_layout('admin', array('content' => $content, 'title' => $title));
589  echo elgg_view_page($title, $body, 'admin');
590  return true;
591 }
592 
610  elgg_set_context('admin');
611 
612  echo elgg_view_resource('admin/plugin_text_file', [
613  'plugin_id' => elgg_extract(0, $pages),
614  'filename' => elgg_extract(1, $pages),
615  ]);
616  return true;
617 }
618 
625  echo elgg_view_resource('robots.txt');
626  return true;
627 }
628 
637 function _elgg_admin_maintenance_allow_url($current_url) {
638  $site_path = preg_replace('~^https?~', '', elgg_get_site_url());
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));
642  } else {
643  $current_path = false;
644  }
645 
646  // allow plugins to control access for specific URLs/paths
647  $params = array(
648  'current_path' => $current_path,
649  'current_url' => $current_url,
650  );
651  return (bool)elgg_trigger_plugin_hook('maintenance:allow', 'url', $params, false);
652 }
653 
660  if (elgg_is_admin_logged_in()) {
661  return;
662  }
663 
664  if ($info['identifier'] == 'action' && $info['segments'][0] == 'login') {
665  return;
666  }
667 
669  return;
670  }
671 
672  elgg_unregister_plugin_hook_handler('register', 'menu:login', '_elgg_login_menu_setup');
673 
674  echo elgg_view_resource('maintenance');
675 
676  return false;
677 }
678 
689  if (elgg_is_admin_logged_in()) {
690  return true;
691  }
692 
693  if ($type == 'login') {
694  $username = get_input('username');
695 
697 
698  if (!$user) {
700  if ($users) {
701  $user = $users[0];
702  }
703  }
704 
705  if ($user && $user->isAdmin()) {
706  return true;
707  }
708  }
709 
711  return true;
712  }
713 
714  register_error(elgg_echo('actionunauthorized'));
715 
716  return false;
717 }
718 
729 function _elgg_add_admin_widgets($event, $type, $user) {
731 
732  // check if the user already has widgets
733  if (elgg_get_widgets($user->getGUID(), 'admin')) {
734  return true;
735  }
736 
737  // In the form column => array of handlers in order, top to bottom
738  $adminWidgets = array(
739  1 => array('control_panel', 'admin_welcome'),
740  2 => array('online_users', 'new_users', 'content_stats'),
741  );
742 
743  foreach ($adminWidgets as $column => $handlers) {
744  foreach ($handlers as $position => $handler) {
745  $guid = elgg_create_widget($user->getGUID(), $handler, 'admin');
746  if ($guid) {
748  /* @var \ElggWidget $widget */
749  $widget->move($column, $position);
750  }
751  }
752  }
753  elgg_set_ignore_access(false);
754 }
755 
756 return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
757  $events->registerHandler('init', 'system', '_elgg_admin_init');
758  $events->registerHandler('ready', 'system', '_elgg_admin_ready');
759 };
_elgg_add_admin_widgets($event, $type, $user)
Adds default admin widgets to the admin dashboard.
Definition: admin.php:729
elgg_admin_notice_exists($id)
Check if an admin notice is currently active.
Definition: admin.php:116
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:293
elgg_delete_admin_notice($id)
Remove an admin notice by ID.
Definition: admin.php:92
$object
These two snippets demonstrates triggering an event and how to register for that event.
Definition: trigger.php:7
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
$view
Definition: crop.php:34
elgg_view_icon($name, $vars=array())
View one of the icons.
Definition: views.php:1582
$widgets
Definition: dashboard.php:10
$settings_view_new
Definition: full.php:179
$plugin
get_user_by_email($email)
Get an array of users from an email address.
Definition: users.php:120
elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback)
Unregister a callback as a plugin hook.
Definition: elgglib.php:755
$body
Definition: admin.php:34
_elgg_admin_maintenance_allow_url($current_url)
When in maintenance mode, should the given URL be handled normally?
Definition: admin.php:637
$username
Definition: delete.php:22
_elgg_admin_markdown_page_handler($pages)
Formats and serves out markdown files from plugins.
Definition: admin.php:609
$settings_view_old
Definition: full.php:178
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:60
if($guid==elgg_get_logged_in_user_guid()) $name
Definition: delete.php:21
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_resource($name, array $vars=[])
Render a resource view.
Definition: views.php:510
elgg_get_admin_notices($limit=10)
Get admin notices.
Definition: admin.php:104
$admin
Definition: useradd.php:22
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
Definition: cache.php:108
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
Definition: cache.php:136
elgg_add_admin_notice($id, $message)
Write a persistent message to the admin view.
Definition: admin.php:75
_elgg_create_notice_of_pending_upgrade($event, $type, $object)
Add an admin notice when a new object is created.
Definition: admin.php:178
$column
Definition: add.php:13
$widget
Definition: delete.php:9
elgg_register_css($name, $url, $priority=null)
Register a CSS file for inclusion in the HTML head.
Definition: elgglib.php:271
_elgg_admin_page_handler($page)
Handle admin pages.
Definition: admin.php:531
$vars['type']
Install create admin account page.
Definition: admin.php:8
$return
Definition: opendd.php:15
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:689
current_page_url()
Returns the current page&#39;s complete URL.
Definition: input.php:65
$guid
Removes an admin notice.
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:425
$link
Definition: container.php:14
$site_path
Definition: details.php:87
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Definition: elgglib.php:740
_elgg_admin_pagesetup()
Handles any set up required for administration pages.
Definition: admin.php:384
if($screenshots) $info
Definition: details.php:58
$title
Definition: save.php:22
$position
Definition: move.php:10
$options
Elgg admin footer.
Definition: footer.php:6
get_user_by_username($username)
Get user by username.
Definition: users.php:98
$params
Definition: login.php:72
elgg_unregister_css($name)
Unregister a CSS file.
Definition: elgglib.php:283
elgg_require_js($name)
Request that Elgg load an AMD module onto the page.
Definition: elgglib.php:232
elgg_register_admin_menu_item($section, $menu_id, $parent_id=null, $priority=100)
Add an admin area section or child section.
Definition: admin.php:140
elgg_load_css($name)
Load a CSS file for this page.
Definition: elgglib.php:298
$limit
Definition: userpicker.php:38
_elgg_admin_maintenance_action_check($hook, $type)
Prevent non-admins from using actions.
Definition: admin.php:688
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
Definition: elgglib.php:155
elgg_get_widgets($owner_guid, $context)
Get widgets for a particular context.
Definition: widgets.php:24
elgg_set_ignore_access($ignore=true)
Set if Elgg&#39;s access system should be ignored.
Definition: access.php:43
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$plugin_id
Definition: save.php:16
$users
Definition: newest.php:8
global $CONFIG
_elgg_admin_init()
Initialize the admin backend.
Definition: admin.php:197
$url
Definition: admin.php:10
elgg_set_context($context)
Sets the page context.
Definition: pageowner.php:192
$user
Definition: ban.php:13
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:241
elgg echo
Translates a string.
Definition: languages.js:48
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
Definition: entities.php:326
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Definition: elgglib.php:826
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
Definition: pagehandler.php:34
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1098
elgg global
Pointer to the global context.
Definition: elgglib.js:12
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.
Definition: admin.php:624
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
Definition: autoloader.php:17
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1375
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Definition: elgglib.php:550
_elgg_admin_ready()
Setup after plugins are initialized.
Definition: admin.php:371
$content
Definition: admin.php:30
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.
Definition: plugins.php:132
$pages
Definition: pagination.php:62
elgg_admin_gatekeeper()
Used at the top of a page to mark it as admin only.
Definition: pagehandler.php:83
_elgg_admin_sort_page_menu($hook, $type, $return, $params)
Sort the plugin settings menu items.
Definition: admin.php:501
if($item->getSelected()) $children
Definition: item.php:21
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:399
elgg_load_js($name)
Load a JavaScript resource on this page.
Definition: elgglib.php:220
class
Definition: placeholder.php:21
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:32
$handler
Definition: add.php:10
elgg_get_admins(array $options=array())
Get the admin users.
Definition: admin.php:35
elgg_register_action($action, $filename="", $access= 'logged_in')
Registers an action.
Definition: actions.php:96
_elgg_admin_maintenance_handler($hook, $type, $info)
Handle requests when in maintenance mode.
Definition: admin.php:659
_elgg_ajax_plugins_update()
Returns plugin listing and admin menu to the client (used after plugin (de)activation) ...
Definition: admin.php:354
if(!$collection_name) $id
Definition: add.php:17
$settings
elgg_register_widget_type($handler, $name=null, $description=null, $context=array('all'), $multiple=false)
Register a widget type.
Definition: widgets.php:74
_elgg_admin_add_plugin_settings_menu()
Create the plugin settings page menu.
Definition: admin.php:464
$priority
elgg_create_widget($owner_guid, $handler, $context, $access_id=null)
Create a new widget instance.
Definition: widgets.php:39
elgg_get_plugin_from_id($plugin_id)
Returns an object with the path $path.
Definition: plugins.php:82
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:204
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:447
if(!$display_name) $type
Definition: delete.php:27