Elgg  Version 1.11
admin.php
Go to the documentation of this file.
1 <?php
37 function elgg_get_admins(array $options = array()) {
39 
40  if (isset($options['joins'])) {
41  if (!is_array($options['joins'])) {
42  $options['joins'] = array($options['joins']);
43  }
44  $options['joins'][] = "join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid";
45  } else {
46  $options['joins'] = array("join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid");
47  }
48 
49  if (isset($options['wheres'])) {
50  if (!is_array($options['wheres'])) {
51  $options['wheres'] = array($options['wheres']);
52  }
53  $options['wheres'][] = "u.admin = 'yes'";
54  } else {
55  $options['wheres'][] = "u.admin = 'yes'";
56  }
57 
59 }
60 
78  return _elgg_services()->adminNotices->add($id, $message);
79 }
80 
95  return _elgg_services()->adminNotices->delete($id);
96 }
97 
107  return _elgg_services()->adminNotices->find($limit);
108 }
109 
119  return _elgg_services()->adminNotices->exists($id);
120 }
121 
142 function elgg_register_admin_menu_item($section, $menu_id, $parent_id = null, $priority = 100) {
143 
144  // make sure parent is registered
145  if ($parent_id && !elgg_is_menu_item_registered('page', $parent_id)) {
146  elgg_register_admin_menu_item($section, $parent_id);
147  }
148 
149  // in the admin section parents never have links
150  if ($parent_id) {
151  $href = "admin/$parent_id/$menu_id";
152  } else {
153  $href = null;
154  }
155 
156  $name = $menu_id;
157  if ($parent_id) {
158  $name = "$parent_id:$name";
159  }
160 
161  return elgg_register_menu_item('page', array(
162  'name' => $name,
163  'href' => $href,
164  'text' => elgg_echo("admin:$name"),
165  'context' => 'admin',
166  'parent_name' => $parent_id,
167  'priority' => $priority,
168  'section' => $section
169  ));
170 }
171 
181  if ($object instanceof \ElggUpgrade) {
182  // Link to the Upgrades section
183  $link = elgg_view('output/url', array(
184  'href' => 'admin/upgrades',
185  'text' => elgg_echo('admin:view_upgrades'),
186  ));
187 
188  $message = elgg_echo('admin:pending_upgrades');
189 
190  elgg_add_admin_notice('pending_upgrades', "$message $link");
191  }
192 }
193 
199 function _elgg_admin_init() {
200 
201  elgg_register_event_handler('pagesetup', 'system', '_elgg_admin_pagesetup', 1000);
202 
203  // maintenance mode
204  if (elgg_get_config('elgg_maintenance_mode', null)) {
205  elgg_register_plugin_hook_handler('route', 'all', '_elgg_admin_maintenance_handler');
206  elgg_register_plugin_hook_handler('action', 'all', '_elgg_admin_maintenance_action_check');
207  elgg_register_css('maintenance', elgg_get_simplecache_url('css', 'maintenance'));
208 
209  elgg_register_menu_item('topbar', array(
210  'name' => 'maintenance_mode',
211  'href' => 'admin/administer_utilities/maintenance',
212  'text' => elgg_echo('admin:maintenance_mode:indicator_menu_item'),
213  'priority' => 900,
214  ));
215  }
216 
217  elgg_register_action('admin/user/ban', '', 'admin');
218  elgg_register_action('admin/user/unban', '', 'admin');
219  elgg_register_action('admin/user/delete', '', 'admin');
220  elgg_register_action('admin/user/resetpassword', '', 'admin');
221  elgg_register_action('admin/user/makeadmin', '', 'admin');
222  elgg_register_action('admin/user/removeadmin', '', 'admin');
223 
224  elgg_register_action('admin/site/update_basic', '', 'admin');
225  elgg_register_action('admin/site/update_advanced', '', 'admin');
226  elgg_register_action('admin/site/flush_cache', '', 'admin');
227  elgg_register_action('admin/site/unlock_upgrade', '', 'admin');
228  elgg_register_action('admin/site/set_robots', '', 'admin');
229  elgg_register_action('admin/site/set_maintenance_mode', '', 'admin');
230 
231  elgg_register_action('admin/upgrades/upgrade_comments', '', 'admin');
232  elgg_register_action('admin/upgrades/upgrade_datadirs', '', 'admin');
233  elgg_register_action('admin/upgrades/upgrade_discussion_replies', '', 'admin');
234  elgg_register_action('admin/upgrades/upgrade_comments_access', '', 'admin');
235  elgg_register_action('admin/site/regenerate_secret', '', 'admin');
236 
237  elgg_register_action('admin/menu/save', '', 'admin');
238 
239  elgg_register_action('admin/delete_admin_notice', '', 'admin');
240 
241  elgg_register_action('profile/fields/reset', '', 'admin');
242  elgg_register_action('profile/fields/add', '', 'admin');
243  elgg_register_action('profile/fields/edit', '', 'admin');
244  elgg_register_action('profile/fields/delete', '', 'admin');
245  elgg_register_action('profile/fields/reorder', '', 'admin');
246 
247  elgg_register_simplecache_view('css/admin');
248  $url = elgg_get_simplecache_url('js', 'admin');
249  elgg_register_js('elgg.admin', $url);
250  elgg_register_js('elgg.upgrades', 'js/lib/upgrades.js');
251  elgg_register_js('jquery.jeditable', 'vendors/jquery/jquery.jeditable.mini.js');
252 
253  // administer
254  // dashboard
255  elgg_register_menu_item('page', array(
256  'name' => 'dashboard',
257  'href' => 'admin/dashboard',
258  'text' => elgg_echo('admin:dashboard'),
259  'context' => 'admin',
260  'priority' => 10,
261  'section' => 'administer'
262  ));
263  // statistics
264  elgg_register_admin_menu_item('administer', 'statistics', null, 20);
265  elgg_register_admin_menu_item('administer', 'overview', 'statistics');
266  elgg_register_admin_menu_item('administer', 'server', 'statistics');
267  //utilities
268  elgg_register_admin_menu_item('administer', 'maintenance', 'administer_utilities');
269 
270  // users
271  elgg_register_admin_menu_item('administer', 'users', null, 20);
272  elgg_register_admin_menu_item('administer', 'online', 'users', 10);
273  elgg_register_admin_menu_item('administer', 'admins', 'users', 20);
274  elgg_register_admin_menu_item('administer', 'newest', 'users', 30);
275  elgg_register_admin_menu_item('administer', 'add', 'users', 40);
276 
277  // configure
278  // upgrades
279  elgg_register_menu_item('page', array(
280  'name' => 'upgrades',
281  'href' => 'admin/upgrades',
282  'text' => elgg_echo('admin:upgrades'),
283  'context' => 'admin',
284  'priority' => 10,
285  'section' => 'configure'
286  ));
287 
288  // plugins
289  elgg_register_menu_item('page', array(
290  'name' => 'plugins',
291  'href' => 'admin/plugins',
292  'text' => elgg_echo('admin:plugins'),
293  'context' => 'admin',
294  'priority' => 75,
295  'section' => 'configure'
296  ));
297 
298  // settings
299  elgg_register_admin_menu_item('configure', 'appearance', null, 50);
300  elgg_register_admin_menu_item('configure', 'settings', null, 100);
301  elgg_register_admin_menu_item('configure', 'basic', 'settings', 10);
302  elgg_register_admin_menu_item('configure', 'advanced', 'settings', 20);
303  // plugin settings are added in _elgg_admin_add_plugin_settings_menu() via the admin page handler
304  // for performance reasons.
305 
306  // appearance
307  elgg_register_admin_menu_item('configure', 'menu_items', 'appearance', 30);
308  elgg_register_admin_menu_item('configure', 'profile_fields', 'appearance', 40);
309  // default widgets is added via an event handler elgg_default_widgets_init() in widgets.php
310  // because it requires additional setup.
311 
312  // configure utilities
313  elgg_register_admin_menu_item('configure', 'robots', 'configure_utilities');
314 
315  // we want plugin settings menu items to be sorted alphabetical
316  if (elgg_in_context('admin')) {
317  elgg_register_plugin_hook_handler('prepare', 'menu:page', '_elgg_admin_sort_page_menu');
318  }
319 
320  if (elgg_is_admin_logged_in()) {
321  elgg_register_menu_item('topbar', array(
322  'name' => 'administration',
323  'href' => 'admin',
324  'text' => elgg_view_icon('settings') . elgg_echo('admin'),
325  'priority' => 100,
326  'section' => 'alt',
327  ));
328  }
329 
330  // widgets
331  $widgets = array('online_users', 'new_users', 'content_stats', 'banned_users', 'admin_welcome', 'control_panel', 'cron_status');
332  foreach ($widgets as $widget) {
334  $widget,
335  elgg_echo("admin:widget:$widget"),
336  elgg_echo("admin:widget:$widget:help"),
337  array('admin')
338  );
339  }
340 
341  // automatic adding of widgets for admin
342  elgg_register_event_handler('make_admin', 'user', '_elgg_add_admin_widgets');
343 
344  // Add notice about pending upgrades
345  elgg_register_event_handler('create', 'object', '_elgg_create_notice_of_pending_upgrade');
346 
347  elgg_register_page_handler('admin', '_elgg_admin_page_handler');
348  elgg_register_page_handler('admin_plugin_screenshot', '_elgg_admin_plugin_screenshot_page_handler');
349  elgg_register_page_handler('admin_plugin_text_file', '_elgg_admin_markdown_page_handler');
350  elgg_register_page_handler('robots.txt', '_elgg_robots_page_handler');
351 }
352 
360  if (elgg_in_context('admin')) {
361  $url = elgg_get_simplecache_url('css', 'admin');
362  elgg_register_css('elgg.admin', $url);
363  elgg_load_css('elgg.admin');
364  elgg_unregister_css('elgg');
365 
367 
368  // setup header menu
369  elgg_register_menu_item('admin_header', array(
370  'name' => 'admin_logout',
371  'href' => 'action/logout',
372  'text' => elgg_echo('logout'),
373  'is_trusted' => true,
374  'priority' => 1000,
375  ));
376 
377  elgg_register_menu_item('admin_header', array(
378  'name' => 'view_site',
379  'href' => elgg_get_site_url(),
380  'text' => elgg_echo('admin:view_site'),
381  'is_trusted' => true,
382  'priority' => 900,
383  ));
384 
385  elgg_register_menu_item('admin_header', array(
386  'name' => 'admin_profile',
387  'href' => false,
388  'text' => elgg_echo('admin:loggedin', array($admin->name)),
389  'priority' => 800,
390  ));
391 
392  if (elgg_get_config('elgg_maintenance_mode', null)) {
393  elgg_register_menu_item('admin_header', array(
394  'name' => 'maintenance',
395  'href' => 'admin/administer_utilities/maintenance',
396  'text' => elgg_echo('admin:administer_utilities:maintenance'),
397  'link_class' => 'elgg-maintenance-mode-warning',
398  'priority' => 700,
399  ));
400  }
401 
402  // setup footer menu
403  elgg_register_menu_item('admin_footer', array(
404  'name' => 'faq',
405  'text' => elgg_echo('admin:footer:faq'),
406  'href' => 'http://learn.elgg.org/en/stable/appendix/faqs.html',
407  ));
408 
409  elgg_register_menu_item('admin_footer', array(
410  'name' => 'manual',
411  'text' => elgg_echo('admin:footer:manual'),
412  'href' => 'http://learn.elgg.org/en/stable/admin/index.html',
413  ));
414 
415  elgg_register_menu_item('admin_footer', array(
416  'name' => 'community_forums',
417  'text' => elgg_echo('admin:footer:community_forums'),
418  'href' => 'http://community.elgg.org/groups/all/',
419  ));
420 
421  elgg_register_menu_item('admin_footer', array(
422  'name' => 'blog',
423  'text' => elgg_echo('admin:footer:blog'),
424  'href' => 'https://community.elgg.org/blog/all',
425  ));
426  }
427 }
428 
440 
441  $active_plugins = elgg_get_plugins('active');
442  if (!$active_plugins) {
443  // nothing added because no items
444  return;
445  }
446 
447  foreach ($active_plugins as $plugin) {
448  $plugin_id = $plugin->getID();
449  $settings_view_old = 'settings/' . $plugin_id . '/edit';
450  $settings_view_new = 'plugins/' . $plugin_id . '/settings';
452  elgg_register_menu_item('page', array(
453  'name' => $plugin_id,
454  'href' => "admin/plugin_settings/$plugin_id",
455  'text' => $plugin->getManifest()->getName(),
456  'parent_name' => 'settings',
457  'context' => 'admin',
458  'section' => 'configure',
459  ));
460  }
461  }
462 }
463 
477  $configure_items = $return['configure'];
478  if (is_array($configure_items)) {
479  /* @var \ElggMenuItem[] $configure_items */
480  foreach ($configure_items as $menu_item) {
481  if ($menu_item->getName() == 'settings') {
482  $settings = $menu_item;
483  }
484  }
485 
486  if (!empty($settings) && $settings instanceof \ElggMenuItem) {
487  // keep the basic and advanced settings at the top
488  /* @var \ElggMenuItem $settings */
489  $children = $settings->getChildren();
490  $site_settings = array_splice($children, 0, 2);
491  usort($children, array('\ElggMenuBuilder', 'compareByText'));
492  array_splice($children, 0, 0, $site_settings);
493  $settings->setChildren($children);
494  }
495  }
496 }
497 
506 function _elgg_admin_page_handler($page) {
507 
510  elgg_set_context('admin');
511 
512  elgg_unregister_css('elgg');
513  elgg_load_js('elgg.admin');
514  elgg_load_js('jquery.jeditable');
515 
516  // default to dashboard
517  if (!isset($page[0]) || empty($page[0])) {
518  $page = array('dashboard');
519  }
520 
521  // was going to fix this in the page_handler() function but
522  // it's commented to explicitly return a string if there's a trailing /
523  if (empty($page[count($page) - 1])) {
524  array_pop($page);
525  }
526 
527  $vars = array('page' => $page);
528 
529  // special page for plugin settings since we create the form for them
530  if ($page[0] == 'plugin_settings') {
531  if (isset($page[1]) && (elgg_view_exists("settings/{$page[1]}/edit") ||
532  elgg_view_exists("plugins/{$page[1]}/settings"))) {
533 
534  $view = 'admin/plugin_settings';
535  $plugin = elgg_get_plugin_from_id($page[1]);
536  $vars['plugin'] = $plugin;
537 
538  $title = elgg_echo("admin:{$page[0]}");
539  } else {
540  forward('', '404');
541  }
542  } else {
543  $view = 'admin/' . implode('/', $page);
544  $title = elgg_echo("admin:{$page[0]}");
545  if (count($page) > 1) {
546  $title .= ' : ' . elgg_echo('admin:' . implode(':', $page));
547  }
548  }
549 
550  // gets content and prevents direct access to 'components' views
551  if ($page[0] == 'components' || !($content = elgg_view($view, $vars))) {
552  $title = elgg_echo('admin:unknown_section');
553  $content = elgg_echo('admin:unknown_section');
554  }
555 
556  $body = elgg_view_layout('admin', array('content' => $content, 'title' => $title));
557  echo elgg_view_page($title, $body, 'admin');
558  return true;
559 }
560 
570  // only admins can use this for security
572 
574  // only thumbnail or full.
575  $size = elgg_extract(1, $pages, 'thumbnail');
576 
577  // the rest of the string is the filename
578  $filename_parts = array_slice($pages, 2);
579  $filename = implode('/', $filename_parts);
581 
583  if (!$plugin) {
584  $file = elgg_get_root_path() . '_graphics/icons/default/medium.png';
585  } else {
586  $file = $plugin->getPath() . $filename;
587  if (!file_exists($file)) {
588  $file = elgg_get_root_path() . '_graphics/icons/default/medium.png';
589  }
590  }
591 
592  header("Content-type: image/jpeg");
593 
594  // resize to 100x100 for thumbnails
595  switch ($size) {
596  case 'thumbnail':
597  echo get_resized_image_from_existing_file($file, 100, 100, true);
598  break;
599 
600  case 'full':
601  default:
602  echo file_get_contents($file);
603  break;
604  }
605  return true;
606 }
607 
627  elgg_set_context('admin');
628 
629  elgg_unregister_css('elgg');
630  elgg_load_js('elgg.admin');
631  elgg_load_js('jquery.jeditable');
632  elgg_load_library('elgg:markdown');
633 
637 
638  $error = false;
639  if (!$plugin) {
640  $error = elgg_echo('admin:plugins:markdown:unknown_plugin');
641  $body = elgg_view_layout('admin', array('content' => $error, 'title' => $error));
642  echo elgg_view_page($error, $body, 'admin');
643  return true;
644  }
645 
646  $text_files = $plugin->getAvailableTextFiles();
647 
648  if (!array_key_exists($filename, $text_files)) {
649  $error = elgg_echo('admin:plugins:markdown:unknown_file');
650  }
651 
652  $file = $text_files[$filename];
653  $file_contents = file_get_contents($file);
654 
655  if (!$file_contents) {
656  $error = elgg_echo('admin:plugins:markdown:unknown_file');
657  }
658 
659  if ($error) {
660  $title = $error;
661  $body = elgg_view_layout('admin', array('content' => $error, 'title' => $title));
662  echo elgg_view_page($title, $body, 'admin');
663  return true;
664  }
665 
666  $title = $plugin->getManifest()->getName() . ": $filename";
667  $text = Markdown($file_contents);
668 
669  $body = elgg_view_layout('admin', array(
670  // setting classes here because there's no way to pass classes
671  // to the layout
672  'content' => '<div class="elgg-markdown">' . $text . '</div>',
673  'title' => $title
674  ));
675 
676  echo elgg_view_page($title, $body, 'admin');
677  return true;
678 }
679 
687  header("Content-type: text/plain");
688  $content = $site->getPrivateSetting('robots.txt');
689  $plugin_content = elgg_trigger_plugin_hook('robots.txt', 'site', array('site' => $site), '');
690  if ($plugin_content) {
691  $content = $content . "\n\n" . $plugin_content;
692  }
693  echo $content;
694 
695  return true;
696 }
697 
706 function _elgg_admin_maintenance_allow_url($current_url) {
707  $site_path = preg_replace('~^https?~', '', elgg_get_site_url());
708  $current_path = preg_replace('~^https?~', '', $current_url);
709  if (0 === strpos($current_path, $site_path)) {
710  $current_path = ($current_path === $site_path) ? '' : substr($current_path, strlen($site_path));
711  } else {
712  $current_path = false;
713  }
714 
715  // allow plugins to control access for specific URLs/paths
716  $params = array(
717  'current_path' => $current_path,
718  'current_url' => $current_url,
719  );
720  return (bool)elgg_trigger_plugin_hook('maintenance:allow', 'url', $params, false);
721 }
722 
728 function _elgg_admin_maintenance_handler($hook, $type, $info) {
729  if (elgg_is_admin_logged_in()) {
730  return;
731  }
732 
733  if ($info['identifier'] == 'action' && $info['segments'][0] == 'login') {
734  return;
735  }
736 
738  return;
739  }
740 
741  elgg_unregister_plugin_hook_handler('register', 'menu:login', '_elgg_login_menu_setup');
742 
744  $message = $site->getPrivateSetting('elgg_maintenance_message');
745  if (!$message) {
746  $message = elgg_echo('admin:maintenance_mode:default_message');
747  }
748 
749  elgg_load_css('maintenance');
750 
751  header("HTTP/1.1 503 Service Unavailable");
752 
753  $body = elgg_view_layout('maintenance', array(
754  'message' => $message,
755  'site' => $site,
756  ));
757  echo elgg_view_page($site->name, $body, 'maintenance');
758 
759  return false;
760 }
761 
772  if (elgg_is_admin_logged_in()) {
773  return true;
774  }
775 
776  if ($type == 'login') {
777  $username = get_input('username');
778 
780 
781  if (!$user) {
783  if ($users) {
784  $user = $users[0];
785  }
786  }
787 
788  if ($user && $user->isAdmin()) {
789  return true;
790  }
791  }
792 
794  return true;
795  }
796 
797  register_error(elgg_echo('actionunauthorized'));
798 
799  return false;
800 }
801 
812 function _elgg_add_admin_widgets($event, $type, $user) {
814 
815  // check if the user already has widgets
816  if (elgg_get_widgets($user->getGUID(), 'admin')) {
817  return true;
818  }
819 
820  // In the form column => array of handlers in order, top to bottom
821  $adminWidgets = array(
822  1 => array('control_panel', 'admin_welcome'),
823  2 => array('online_users', 'new_users', 'content_stats'),
824  );
825 
826  foreach ($adminWidgets as $column => $handlers) {
827  foreach ($handlers as $position => $handler) {
828  $guid = elgg_create_widget($user->getGUID(), $handler, 'admin');
829  if ($guid) {
831  /* @var \ElggWidget $widget */
832  $widget->move($column, $position);
833  }
834  }
835  }
836  elgg_set_ignore_access(false);
837 }
838 
839 return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
840  $events->registerHandler('init', 'system', '_elgg_admin_init');
841 };
_elgg_add_admin_widgets($event, $type, $user)
Adds default admin widgets to the admin dashboard.
Definition: admin.php:812
elgg_admin_notice_exists($id)
Check if an admin notice is currently active.
Definition: admin.php:118
elgg_delete_admin_notice($id)
Remove an admin notice by ID.
Definition: admin.php:94
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
$view
Definition: crop.php:68
elgg_get_site_entity($site_guid=0)
Get an entity (default is current site)
Definition: sites.php:18
$widgets
Definition: dashboard.php:10
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $error
Definition: upload.php:14
$settings_view_new
Definition: full.php:242
$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:717
$body
Definition: admin.php:34
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
_elgg_admin_maintenance_allow_url($current_url)
When in maintenance mode, should the given URL be handled normally?
Definition: admin.php:706
$username
Definition: delete.php:22
_elgg_admin_markdown_page_handler($pages)
Formats and serves out markdown files from plugins.
Definition: admin.php:624
$settings_view_old
Definition: full.php:241
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:60
elgg_view_icon($name, $vars=array())
View one of the elgg sprite icons.
Definition: views.php:1403
if($guid==elgg_get_logged_in_user_guid()) $name
Definition: delete.php:21
current_page_url()
Returns the current page&#39;s complete URL.
Definition: input.php:65
$size
Definition: view.php:10
$object
Definition: upgrade.php:12
elgg_get_admin_notices($limit=10)
Get admin notices.
Definition: admin.php:106
$admin
Definition: useradd.php:18
elgg_register_widget_type($handler, $name, $description, $context=array('all'), $multiple=false)
Register a widget type.
Definition: widgets.php:73
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
Definition: cache.php:98
sanitise_filepath($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
Definition: elgglib.php:368
elgg_add_admin_notice($id, $message)
Write a persistent message to the admin view.
Definition: admin.php:77
_elgg_create_notice_of_pending_upgrade($event, $type, $object)
Add an admin notice when a new object is created.
Definition: admin.php:180
$column
Definition: add.php:13
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:318
$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:228
_elgg_admin_page_handler($page)
Handle admin pages.
Definition: admin.php:506
elgg_load_library($name)
Load a PHP library.
Definition: elgglib.php:43
$vars['type']
Install create admin account page.
Definition: admin.php:8
$return
Definition: opendd.php:15
$guid
Removes an admin notice.
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1246
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:419
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Definition: elgglib.php:703
_elgg_admin_pagesetup()
Handles any set up required for administration pages.
Definition: admin.php:359
$title
Definition: save.php:24
$position
Definition: move.php:10
get_user_by_username($username)
Get user by username.
Definition: users.php:98
$params
Definition: login.php:72
$options
Definition: index.php:14
get_resized_image_from_existing_file($input_name, $maxwidth, $maxheight, $square=false, $x1=0, $y1=0, $x2=0, $y2=0, $upscale=false)
Gets the jpeg contents of the resized version of an already uploaded image (Returns false if the file...
Definition: filestore.php:115
$text
Definition: default.php:25
elgg_unregister_css($name)
Unregister a CSS file.
Definition: elgglib.php:240
elgg_register_admin_menu_item($section, $menu_id, $parent_id=null, $priority=100)
Add an admin area section or child section.
Definition: admin.php:142
elgg_load_css($name)
Load a CSS file for this page.
Definition: elgglib.php:255
$limit
Definition: userpicker.php:31
_elgg_admin_maintenance_action_check($hook, $type)
Prevent non-admins from using actions.
Definition: admin.php:771
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
Definition: elgglib.php:127
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_get_simplecache_url($type, $view)
Definition: cache.php:117
elgg_get_widgets($owner_guid, $context)
Get widgets for a particular context.
Definition: widgets.php:23
_elgg_admin_plugin_screenshot_page_handler($pages)
Serves up screenshots for plugins from admin_plugin_screenshot/<plugin_id>/<size>/<ss_name>.
Definition: admin.php:569
elgg_set_ignore_access($ignore=true)
Set if Elgg&#39;s access system should be ignored.
Definition: access.php:43
_elgg_services()
Definition: autoloader.php:14
$plugin_id
Definition: save.php:16
$users
Definition: newest.php:3
global $CONFIG
_elgg_admin_init()
Initialize the admin backend.
Definition: admin.php:199
$url
Definition: admin.php:10
elgg_set_context($context)
Sets the page context.
Definition: pageowner.php:201
$user
Definition: ban.php:13
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:250
elgg_get_root_path()
Get the root directory path for this installation.
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
Definition: entities.php:490
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Definition: elgglib.php:775
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
Definition: pagehandler.php:34
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.
$type
Definition: add.php:8
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
Definition: navigation.php:92
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
_elgg_robots_page_handler()
Handle request for robots.txt.
Definition: admin.php:685
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:622
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Definition: elgglib.php:519
$content
Definition: admin.php:30
elgg_get_plugins($status= 'active', $site_guid=null)
Returns an ordered list of plugins.
Definition: plugins.php:162
$pages
Definition: pagination.php:52
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:476
if($item->getSelected()) $children
Definition: item.php:21
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:383
elgg_load_js($name)
Load a JavaScript resource on this page.
Definition: elgglib.php:189
$filename
Definition: crop.php:23
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:437
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:37
clearfix elgg elgg elgg elgg page header
Definition: admin.php:127
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:728
if(!$collection_name) $id
Definition: add.php:17
$settings
_elgg_admin_add_plugin_settings_menu()
Create the plugin settings page menu.
Definition: admin.php:439
$priority
elgg_create_widget($owner_guid, $handler, $context, $access_id=null)
Create a new widget instance.
Definition: widgets.php:38
elgg_get_plugin_from_id($plugin_id)
Returns an object with the path $path.
Definition: plugins.php:97
elgg_is_menu_item_registered($menu_name, $item_name)
Check if a menu item has been registered.
Definition: navigation.php:150
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:382