Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
admin.php
Go to the documentation of this file.
1 <?php
35 function elgg_get_admins(array $options = array()) {
36  global $CONFIG;
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/site/regenerate_secret', '', 'admin');
230 
231  elgg_register_action('admin/menu/save', '', 'admin');
232 
233  elgg_register_action('admin/delete_admin_notice', '', 'admin');
234 
235  elgg_register_action('profile/fields/reset', '', 'admin');
236  elgg_register_action('profile/fields/add', '', 'admin');
237  elgg_register_action('profile/fields/edit', '', 'admin');
238  elgg_register_action('profile/fields/delete', '', 'admin');
239  elgg_register_action('profile/fields/reorder', '', 'admin');
240 
241  elgg_register_simplecache_view('admin.css');
242 
243  elgg_load_css('lightbox');
244 
245  elgg_register_js('jquery.jeditable', elgg_get_simplecache_url('jquery.jeditable.js'));
246 
247  // administer
248  // dashboard
249  elgg_register_menu_item('page', array(
250  'name' => 'dashboard',
251  'href' => 'admin/dashboard',
252  'text' => elgg_echo('admin:dashboard'),
253  'context' => 'admin',
254  'priority' => 10,
255  'section' => 'administer'
256  ));
257  // statistics
258  elgg_register_admin_menu_item('administer', 'statistics', null, 20);
259  elgg_register_admin_menu_item('administer', 'overview', 'statistics');
260  elgg_register_admin_menu_item('administer', 'server', 'statistics');
261  //utilities
262  elgg_register_admin_menu_item('administer', 'maintenance', 'administer_utilities');
263 
264  // users
265  elgg_register_admin_menu_item('administer', 'users', null, 20);
266  elgg_register_admin_menu_item('administer', 'online', 'users', 10);
267  elgg_register_admin_menu_item('administer', 'admins', 'users', 20);
268  elgg_register_admin_menu_item('administer', 'newest', 'users', 30);
269  elgg_register_admin_menu_item('administer', 'add', 'users', 40);
270 
271  // configure
272  // upgrades
273  elgg_register_menu_item('page', array(
274  'name' => 'upgrades',
275  'href' => 'admin/upgrades',
276  'text' => elgg_echo('admin:upgrades'),
277  'context' => 'admin',
278  'priority' => 10,
279  'section' => 'configure'
280  ));
281 
282  // plugins
283  elgg_register_menu_item('page', array(
284  'name' => 'plugins',
285  'href' => 'admin/plugins',
286  'text' => elgg_echo('admin:plugins'),
287  'context' => 'admin',
288  'priority' => 75,
289  'section' => 'configure'
290  ));
291 
292  // settings
293  elgg_register_admin_menu_item('configure', 'appearance', null, 50);
294  elgg_register_admin_menu_item('configure', 'settings', null, 100);
295  elgg_register_admin_menu_item('configure', 'basic', 'settings', 10);
296  elgg_register_admin_menu_item('configure', 'advanced', 'settings', 20);
297  // plugin settings are added in _elgg_admin_add_plugin_settings_menu() via the admin page handler
298  // for performance reasons.
299 
300  // appearance
301  elgg_register_admin_menu_item('configure', 'menu_items', 'appearance', 30);
302  elgg_register_admin_menu_item('configure', 'profile_fields', 'appearance', 40);
303  // default widgets is added via an event handler elgg_default_widgets_init() in widgets.php
304  // because it requires additional setup.
305 
306  // configure utilities
307  elgg_register_admin_menu_item('configure', 'robots', 'configure_utilities');
308 
309  // we want plugin settings menu items to be sorted alphabetical
310  if (elgg_in_context('admin')) {
311  elgg_register_plugin_hook_handler('prepare', 'menu:page', '_elgg_admin_sort_page_menu');
312  }
313 
314  if (elgg_is_admin_logged_in()) {
315  elgg_register_menu_item('topbar', array(
316  'name' => 'administration',
317  'href' => 'admin',
318  'text' => elgg_view_icon('settings') . elgg_echo('admin'),
319  'priority' => 100,
320  'section' => 'alt',
321  ));
322  }
323 
324  // widgets
325  $widgets = array('online_users', 'new_users', 'content_stats', 'banned_users', 'admin_welcome', 'control_panel', 'cron_status');
326  foreach ($widgets as $widget) {
328  $widget,
329  elgg_echo("admin:widget:$widget"),
330  elgg_echo("admin:widget:$widget:help"),
331  array('admin')
332  );
333  }
334 
335  // automatic adding of widgets for admin
336  elgg_register_event_handler('make_admin', 'user', '_elgg_add_admin_widgets');
337 
338  // Add notice about pending upgrades
339  elgg_register_event_handler('create', 'object', '_elgg_create_notice_of_pending_upgrade');
340 
341  elgg_register_page_handler('admin', '_elgg_admin_page_handler');
342  elgg_register_page_handler('admin_plugin_text_file', '_elgg_admin_markdown_page_handler');
343  elgg_register_page_handler('robots.txt', '_elgg_robots_page_handler');
344 }
345 
352 function _elgg_admin_ready() {
353  // if a plugin has extended the deprecated admin.js view, register it for simplecache loading.
354  if (elgg_view_exists('admin.js')) {
355  elgg_register_simplecache_view('admin.js');
356  }
357 }
358 
366  if (elgg_in_context('admin')) {
367  $url = elgg_get_simplecache_url('admin.css');
368  elgg_register_css('elgg.admin', $url);
369  elgg_load_css('elgg.admin');
370  elgg_unregister_css('elgg');
371 
373 
374  // setup header menu
375  elgg_register_menu_item('admin_header', array(
376  'name' => 'admin_logout',
377  'href' => 'action/logout',
378  'text' => elgg_echo('logout'),
379  'is_trusted' => true,
380  'priority' => 1000,
381  ));
382 
383  elgg_register_menu_item('admin_header', array(
384  'name' => 'view_site',
385  'href' => elgg_get_site_url(),
386  'text' => elgg_echo('admin:view_site'),
387  'is_trusted' => true,
388  'priority' => 900,
389  ));
390 
391  elgg_register_menu_item('admin_header', array(
392  'name' => 'admin_profile',
393  'href' => false,
394  'text' => elgg_echo('admin:loggedin', array($admin->name)),
395  'priority' => 800,
396  ));
397 
398  if (elgg_get_config('elgg_maintenance_mode', null)) {
399  elgg_register_menu_item('admin_header', array(
400  'name' => 'maintenance',
401  'href' => 'admin/administer_utilities/maintenance',
402  'text' => elgg_echo('admin:administer_utilities:maintenance'),
403  'link_class' => 'elgg-maintenance-mode-warning',
404  'priority' => 700,
405  ));
406  }
407 
408  // setup footer menu
409  elgg_register_menu_item('admin_footer', array(
410  'name' => 'faq',
411  'text' => elgg_echo('admin:footer:faq'),
412  'href' => 'http://learn.elgg.org/en/stable/appendix/faqs.html',
413  ));
414 
415  elgg_register_menu_item('admin_footer', array(
416  'name' => 'manual',
417  'text' => elgg_echo('admin:footer:manual'),
418  'href' => 'http://learn.elgg.org/en/stable/admin/index.html',
419  ));
420 
421  elgg_register_menu_item('admin_footer', array(
422  'name' => 'community_forums',
423  'text' => elgg_echo('admin:footer:community_forums'),
424  'href' => 'http://community.elgg.org/groups/all/',
425  ));
426 
427  elgg_register_menu_item('admin_footer', array(
428  'name' => 'blog',
429  'text' => elgg_echo('admin:footer:blog'),
430  'href' => 'https://community.elgg.org/blog/all',
431  ));
432  }
433 }
434 
446 
447  $active_plugins = elgg_get_plugins('active');
448  if (!$active_plugins) {
449  // nothing added because no items
450  return;
451  }
452 
453  foreach ($active_plugins as $plugin) {
454  $plugin_id = $plugin->getID();
455  $settings_view_old = 'settings/' . $plugin_id . '/edit';
456  $settings_view_new = 'plugins/' . $plugin_id . '/settings';
458  elgg_register_menu_item('page', array(
459  'name' => $plugin_id,
460  'href' => "admin/plugin_settings/$plugin_id",
461  'text' => $plugin->getManifest()->getName(),
462  'parent_name' => 'settings',
463  'context' => 'admin',
464  'section' => 'configure',
465  ));
466  }
467  }
468 }
469 
483  $configure_items = $return['configure'];
484  if (is_array($configure_items)) {
485  /* @var \ElggMenuItem[] $configure_items */
486  foreach ($configure_items as $menu_item) {
487  if ($menu_item->getName() == 'settings') {
488  $settings = $menu_item;
489  }
490  }
491 
492  if (!empty($settings) && $settings instanceof \ElggMenuItem) {
493  // keep the basic and advanced settings at the top
494  /* @var \ElggMenuItem $settings */
495  $children = $settings->getChildren();
496  $site_settings = array_splice($children, 0, 2);
497  usort($children, [\ElggMenuBuilder::class, 'compareByText']);
498  array_splice($children, 0, 0, $site_settings);
499  $settings->setChildren($children);
500  }
501  }
502 }
503 
512 function _elgg_admin_page_handler($page) {
513  elgg_admin_gatekeeper();
515  elgg_set_context('admin');
516 
517  elgg_unregister_css('elgg');
518  elgg_require_js('elgg/admin');
519 
520  // if a plugin has extended the deprecated admin.js view, add it to the page
521  if (elgg_view_exists('admin.js')) {
522  elgg_deprecated_notice("The view admin.js (AKA js/admin) is deprecated", "2.0");
523  elgg_register_js('elgg.deprecated.admin', elgg_get_simplecache_url('admin.js'));
524  elgg_load_js('elgg.deprecated.admin');
525  }
526 
527  elgg_load_js('jquery.jeditable');
528 
529  // default to dashboard
530  if (!isset($page[0]) || empty($page[0])) {
531  $page = array('dashboard');
532  }
533 
534  // was going to fix this in the page_handler() function but
535  // it's commented to explicitly return a string if there's a trailing /
536  if (empty($page[count($page) - 1])) {
537  array_pop($page);
538  }
539 
540  $vars = array('page' => $page);
541 
542  // special page for plugin settings since we create the form for them
543  if ($page[0] == 'plugin_settings') {
544  if (isset($page[1]) && (elgg_view_exists("settings/{$page[1]}/edit") ||
545  elgg_view_exists("plugins/{$page[1]}/settings"))) {
546 
547  $view = 'admin/plugin_settings';
548  $plugin = elgg_get_plugin_from_id($page[1]);
549  $vars['plugin'] = $plugin;
550 
551  $title = elgg_echo("admin:{$page[0]}");
552  } else {
553  forward('', '404');
554  }
555  } else {
556  $view = 'admin/' . implode('/', $page);
557  $title = elgg_echo("admin:{$page[0]}");
558  if (count($page) > 1) {
559  $title .= ' : ' . elgg_echo('admin:' . implode(':', $page));
560  }
561  }
562 
563  // gets content and prevents direct access to 'components' views
564  if ($page[0] == 'components' || !($content = elgg_view($view, $vars))) {
565  $title = elgg_echo('admin:unknown_section');
566  $content = elgg_echo('admin:unknown_section');
567  }
568 
569  $body = elgg_view_layout('admin', array('content' => $content, 'title' => $title));
570  echo elgg_view_page($title, $body, 'admin');
571  return true;
572 }
573 
591  elgg_set_context('admin');
592 
593  echo elgg_view_resource('admin/plugin_text_file', [
594  'plugin_id' => elgg_extract(0, $pages),
595  'filename' => elgg_extract(1, $pages),
596  ]);
597  return true;
598 }
599 
606  echo elgg_view_resource('robots.txt');
607  return true;
608 }
609 
618 function _elgg_admin_maintenance_allow_url($current_url) {
619  $site_path = preg_replace('~^https?~', '', elgg_get_site_url());
620  $current_path = preg_replace('~^https?~', '', $current_url);
621  if (0 === strpos($current_path, $site_path)) {
622  $current_path = ($current_path === $site_path) ? '' : substr($current_path, strlen($site_path));
623  } else {
624  $current_path = false;
625  }
626 
627  // allow plugins to control access for specific URLs/paths
628  $params = array(
629  'current_path' => $current_path,
630  'current_url' => $current_url,
631  );
632  return (bool)elgg_trigger_plugin_hook('maintenance:allow', 'url', $params, false);
633 }
634 
641  if (elgg_is_admin_logged_in()) {
642  return;
643  }
644 
645  if ($info['identifier'] == 'action' && $info['segments'][0] == 'login') {
646  return;
647  }
648 
650  return;
651  }
652 
653  elgg_unregister_plugin_hook_handler('register', 'menu:login', '_elgg_login_menu_setup');
654 
655  echo elgg_view_resource('maintenance');
656 
657  return false;
658 }
659 
670  if (elgg_is_admin_logged_in()) {
671  return true;
672  }
673 
674  if ($type == 'login') {
675  $username = get_input('username');
676 
678 
679  if (!$user) {
681  if ($users) {
682  $user = $users[0];
683  }
684  }
685 
686  if ($user && $user->isAdmin()) {
687  return true;
688  }
689  }
690 
692  return true;
693  }
694 
695  register_error(elgg_echo('actionunauthorized'));
696 
697  return false;
698 }
699 
710 function _elgg_add_admin_widgets($event, $type, $user) {
712 
713  // check if the user already has widgets
714  if (elgg_get_widgets($user->getGUID(), 'admin')) {
715  return true;
716  }
717 
718  // In the form column => array of handlers in order, top to bottom
719  $adminWidgets = array(
720  1 => array('control_panel', 'admin_welcome'),
721  2 => array('online_users', 'new_users', 'content_stats'),
722  );
723 
724  foreach ($adminWidgets as $column => $handlers) {
725  foreach ($handlers as $position => $handler) {
726  $guid = elgg_create_widget($user->getGUID(), $handler, 'admin');
727  if ($guid) {
729  /* @var \ElggWidget $widget */
730  $widget->move($column, $position);
731  }
732  }
733  }
734  elgg_set_ignore_access(false);
735 }
736 
737 return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
738  $events->registerHandler('init', 'system', '_elgg_admin_init');
739  $events->registerHandler('ready', 'system', '_elgg_admin_ready');
740 };
_elgg_add_admin_widgets($event, $type, $user)
Adds default admin widgets to the admin dashboard.
Definition: admin.php:710
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:299
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:1447
$widgets
Definition: dashboard.php:10
$settings_view_new
Definition: full.php:169
$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:730
$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:618
$username
Definition: delete.php:22
_elgg_admin_markdown_page_handler($pages)
Formats and serves out markdown files from plugins.
Definition: admin.php:590
$settings_view_old
Definition: full.php:168
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:500
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:259
_elgg_admin_page_handler($page)
Handle admin pages.
Definition: admin.php:512
$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:679
current_page_url()
Returns the current page's complete URL.
Definition: input.php:65
$guid
Removes an admin notice.
$site_path
Definition: details.php:87
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Definition: elgglib.php:715
_elgg_admin_pagesetup()
Handles any set up required for administration pages.
Definition: admin.php:365
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
register_error($error)
Display an error on next page load.
Definition: elgglib.php:452
$params
Definition: login.php:72
elgg_unregister_css($name)
Unregister a CSS file.
Definition: elgglib.php:271
elgg_require_js($name)
Request that Elgg load an AMD module onto the page.
Definition: elgglib.php:220
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:286
$limit
Definition: userpicker.php:38
_elgg_admin_maintenance_action_check($hook, $type)
Prevent non-admins from using actions.
Definition: admin.php:669
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
Definition: elgglib.php:143
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'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:3
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_get_entities(array $options=array())
Returns an array of entities with optional filtering.
Definition: entities.php:316
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Definition: elgglib.php:801
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1070
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:605
_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:1310
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Definition: elgglib.php:538
_elgg_admin_ready()
Setup after plugins are initialized.
Definition: admin.php:352
$content
Definition: admin.php:30
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_sort_page_menu($hook, $type, $return, $params)
Sort the plugin settings menu items.
Definition: admin.php:482
forward($location="", $reason= 'system')
Forward to $location.
Definition: elgglib.php:93
if($item->getSelected()) $children
Definition: item.php:21
elgg_load_js($name)
Load a JavaScript resource on this page.
Definition: elgglib.php:208
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:85
_elgg_admin_maintenance_handler($hook, $type, $info)
Handle requests when in maintenance mode.
Definition: admin.php:640
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:445
$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:437
if(!$display_name) $type
Definition: delete.php:27