Elgg  Version 1.9
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  if ($id && $message) {
80  return false;
81  }
82 
83  // need to handle when no one is logged in
84  $old_ia = elgg_set_ignore_access(true);
85 
86  $admin_notice = new ElggObject();
87  $admin_notice->subtype = 'admin_notice';
88  // admins can see ACCESS_PRIVATE but no one else can.
89  $admin_notice->access_id = ACCESS_PRIVATE;
90  $admin_notice->admin_notice_id = $id;
91  $admin_notice->description = $message;
92 
93  $result = $admin_notice->save();
94 
95  elgg_set_ignore_access($old_ia);
96 
97  return (bool)$result;
98  }
99 
100  return false;
101 }
102 
117  if (!$id) {
118  return false;
119  }
120  $result = true;
122  'metadata_name' => 'admin_notice_id',
123  'metadata_value' => $id
124  ));
125 
126  if ($notices) {
127  // in case a bad plugin adds many, let it remove them all at once.
128  foreach ($notices as $notice) {
129  $result = ($result && $notice->delete());
130  }
131  return $result;
132  }
133  return false;
134 }
135 
145  return elgg_get_entities_from_metadata(array(
146  'type' => 'object',
147  'subtype' => 'admin_notice',
148  'limit' => $limit
149  ));
150 }
151 
161  $old_ia = elgg_set_ignore_access(true);
163  'type' => 'object',
164  'subtype' => 'admin_notice',
165  'metadata_name_value_pair' => array('name' => 'admin_notice_id', 'value' => $id)
166  ));
167  elgg_set_ignore_access($old_ia);
168 
169  return ($notice) ? true : false;
170 }
171 
192 function elgg_register_admin_menu_item($section, $menu_id, $parent_id = null, $priority = 100) {
193 
194  // make sure parent is registered
195  if ($parent_id && !elgg_is_menu_item_registered('page', $parent_id)) {
196  elgg_register_admin_menu_item($section, $parent_id);
197  }
198 
199  // in the admin section parents never have links
200  if ($parent_id) {
201  $href = "admin/$parent_id/$menu_id";
202  } else {
203  $href = null;
204  }
205 
206  $name = $menu_id;
207  if ($parent_id) {
208  $name = "$parent_id:$name";
209  }
210 
211  return elgg_register_menu_item('page', array(
212  'name' => $name,
213  'href' => $href,
214  'text' => elgg_echo("admin:$name"),
215  'context' => 'admin',
216  'parent_name' => $parent_id,
217  'priority' => $priority,
218  'section' => $section
219  ));
220 }
221 
231  if ($object instanceof ElggUpgrade) {
232  // Link to the Upgrades section
233  $link = elgg_view('output/url', array(
234  'href' => 'admin/upgrades',
235  'text' => elgg_echo('admin:view_upgrades'),
236  ));
237 
238  $message = elgg_echo('admin:pending_upgrades');
239 
240  elgg_add_admin_notice('pending_upgrades', "$message $link");
241  }
242 }
243 
249 function _elgg_admin_init() {
250 
251  elgg_register_event_handler('pagesetup', 'system', '_elgg_admin_pagesetup', 1000);
252 
253  // maintenance mode
254  if (elgg_get_config('elgg_maintenance_mode', null)) {
255  elgg_register_plugin_hook_handler('route', 'all', '_elgg_admin_maintenance_handler');
256  elgg_register_plugin_hook_handler('action', 'all', '_elgg_admin_maintenance_action_check');
257  elgg_register_css('maintenance', elgg_get_simplecache_url('css', 'maintenance'));
258 
259  elgg_register_menu_item('topbar', array(
260  'name' => 'maintenance_mode',
261  'href' => 'admin/administer_utilities/maintenance',
262  'text' => elgg_echo('admin:maintenance_mode:indicator_menu_item'),
263  'priority' => 900,
264  ));
265  }
266 
267  elgg_register_action('admin/user/ban', '', 'admin');
268  elgg_register_action('admin/user/unban', '', 'admin');
269  elgg_register_action('admin/user/delete', '', 'admin');
270  elgg_register_action('admin/user/resetpassword', '', 'admin');
271  elgg_register_action('admin/user/makeadmin', '', 'admin');
272  elgg_register_action('admin/user/removeadmin', '', 'admin');
273 
274  elgg_register_action('admin/site/update_basic', '', 'admin');
275  elgg_register_action('admin/site/update_advanced', '', 'admin');
276  elgg_register_action('admin/site/flush_cache', '', 'admin');
277  elgg_register_action('admin/site/unlock_upgrade', '', 'admin');
278  elgg_register_action('admin/site/set_robots', '', 'admin');
279  elgg_register_action('admin/site/set_maintenance_mode', '', 'admin');
280 
281  elgg_register_action('admin/upgrades/upgrade_comments', '', 'admin');
282  elgg_register_action('admin/upgrades/upgrade_datadirs', '', 'admin');
283  elgg_register_action('admin/upgrades/upgrade_discussion_replies', '', 'admin');
284  elgg_register_action('admin/site/regenerate_secret', '', 'admin');
285 
286  elgg_register_action('admin/menu/save', '', 'admin');
287 
288  elgg_register_action('admin/delete_admin_notice', '', 'admin');
289 
290  elgg_register_action('profile/fields/reset', '', 'admin');
291  elgg_register_action('profile/fields/add', '', 'admin');
292  elgg_register_action('profile/fields/edit', '', 'admin');
293  elgg_register_action('profile/fields/delete', '', 'admin');
294  elgg_register_action('profile/fields/reorder', '', 'admin');
295 
296  elgg_register_simplecache_view('css/admin');
297  $url = elgg_get_simplecache_url('js', 'admin');
298  elgg_register_js('elgg.admin', $url);
299  elgg_register_js('elgg.upgrades', 'js/lib/upgrades.js');
300  elgg_register_js('jquery.jeditable', 'vendors/jquery/jquery.jeditable.mini.js');
301 
302  // administer
303  // dashboard
304  elgg_register_menu_item('page', array(
305  'name' => 'dashboard',
306  'href' => 'admin/dashboard',
307  'text' => elgg_echo('admin:dashboard'),
308  'context' => 'admin',
309  'priority' => 10,
310  'section' => 'administer'
311  ));
312  // statistics
313  elgg_register_admin_menu_item('administer', 'statistics', null, 20);
314  elgg_register_admin_menu_item('administer', 'overview', 'statistics');
315  elgg_register_admin_menu_item('administer', 'server', 'statistics');
316  //utilities
317  elgg_register_admin_menu_item('administer', 'maintenance', 'administer_utilities');
318 
319  // users
320  elgg_register_admin_menu_item('administer', 'users', null, 20);
321  elgg_register_admin_menu_item('administer', 'online', 'users', 10);
322  elgg_register_admin_menu_item('administer', 'admins', 'users', 20);
323  elgg_register_admin_menu_item('administer', 'newest', 'users', 30);
324  elgg_register_admin_menu_item('administer', 'add', 'users', 40);
325 
326  // configure
327  // upgrades
328  elgg_register_menu_item('page', array(
329  'name' => 'upgrades',
330  'href' => 'admin/upgrades',
331  'text' => elgg_echo('admin:upgrades'),
332  'context' => 'admin',
333  'priority' => 10,
334  'section' => 'configure'
335  ));
336 
337  // plugins
338  elgg_register_menu_item('page', array(
339  'name' => 'plugins',
340  'href' => 'admin/plugins',
341  'text' => elgg_echo('admin:plugins'),
342  'context' => 'admin',
343  'priority' => 75,
344  'section' => 'configure'
345  ));
346 
347  // settings
348  elgg_register_admin_menu_item('configure', 'appearance', null, 50);
349  elgg_register_admin_menu_item('configure', 'settings', null, 100);
350  elgg_register_admin_menu_item('configure', 'basic', 'settings', 10);
351  elgg_register_admin_menu_item('configure', 'advanced', 'settings', 20);
352  // plugin settings are added in _elgg_admin_add_plugin_settings_menu() via the admin page handler
353  // for performance reasons.
354 
355  // appearance
356  elgg_register_admin_menu_item('configure', 'menu_items', 'appearance', 30);
357  elgg_register_admin_menu_item('configure', 'profile_fields', 'appearance', 40);
358  // default widgets is added via an event handler elgg_default_widgets_init() in widgets.php
359  // because it requires additional setup.
360 
361  // configure utilities
362  elgg_register_admin_menu_item('configure', 'robots', 'configure_utilities');
363 
364  // we want plugin settings menu items to be sorted alphabetical
365  if (elgg_in_context('admin')) {
366  elgg_register_plugin_hook_handler('prepare', 'menu:page', '_elgg_admin_sort_page_menu');
367  }
368 
369  if (elgg_is_admin_logged_in()) {
370  elgg_register_menu_item('topbar', array(
371  'name' => 'administration',
372  'href' => 'admin',
373  'text' => elgg_view_icon('settings') . elgg_echo('admin'),
374  'priority' => 100,
375  'section' => 'alt',
376  ));
377  }
378 
379  // widgets
380  $widgets = array('online_users', 'new_users', 'content_stats', 'banned_users', 'admin_welcome', 'control_panel');
381  foreach ($widgets as $widget) {
383  $widget,
384  elgg_echo("admin:widget:$widget"),
385  elgg_echo("admin:widget:$widget:help"),
386  array('admin')
387  );
388  }
389 
390  // automatic adding of widgets for admin
391  elgg_register_event_handler('make_admin', 'user', '_elgg_add_admin_widgets');
392 
393  // Add notice about pending upgrades
394  elgg_register_event_handler('create', 'object', '_elgg_create_notice_of_pending_upgrade');
395 
396  elgg_register_page_handler('admin', '_elgg_admin_page_handler');
397  elgg_register_page_handler('admin_plugin_screenshot', '_elgg_admin_plugin_screenshot_page_handler');
398  elgg_register_page_handler('admin_plugin_text_file', '_elgg_admin_markdown_page_handler');
399  elgg_register_page_handler('robots.txt', '_elgg_robots_page_handler');
400 }
401 
409  if (elgg_in_context('admin')) {
410  $url = elgg_get_simplecache_url('css', 'admin');
411  elgg_register_css('elgg.admin', $url);
412  elgg_load_css('elgg.admin');
413  elgg_unregister_css('elgg');
414 
415  // setup footer menu
416  elgg_register_menu_item('admin_footer', array(
417  'name' => 'faq',
418  'text' => elgg_echo('admin:footer:faq'),
419  'href' => 'http://learn.elgg.org/en/stable/appendix/faqs.html',
420  ));
421 
422  elgg_register_menu_item('admin_footer', array(
423  'name' => 'manual',
424  'text' => elgg_echo('admin:footer:manual'),
425  'href' => 'http://learn.elgg.org/en/stable/admin/index.html',
426  ));
427 
428  elgg_register_menu_item('admin_footer', array(
429  'name' => 'community_forums',
430  'text' => elgg_echo('admin:footer:community_forums'),
431  'href' => 'http://community.elgg.org/groups/all/',
432  ));
433 
434  elgg_register_menu_item('admin_footer', array(
435  'name' => 'blog',
436  'text' => elgg_echo('admin:footer:blog'),
437  'href' => 'http://blog.elgg.org/',
438  ));
439  }
440 }
441 
453 
454  $active_plugins = elgg_get_plugins('active');
455  if (!$active_plugins) {
456  // nothing added because no items
457  return;
458  }
459 
460  foreach ($active_plugins as $plugin) {
461  $plugin_id = $plugin->getID();
462  $settings_view_old = 'settings/' . $plugin_id . '/edit';
463  $settings_view_new = 'plugins/' . $plugin_id . '/settings';
465  elgg_register_menu_item('page', array(
466  'name' => $plugin_id,
467  'href' => "admin/plugin_settings/$plugin_id",
468  'text' => $plugin->getManifest()->getName(),
469  'parent_name' => 'settings',
470  'context' => 'admin',
471  'section' => 'configure',
472  ));
473  }
474  }
475 }
476 
490  $configure_items = $return['configure'];
491  if (is_array($configure_items)) {
492  /* @var ElggMenuItem[] $configure_items */
493  foreach ($configure_items as $menu_item) {
494  if ($menu_item->getName() == 'settings') {
495  $settings = $menu_item;
496  }
497  }
498 
499  if (!empty($settings) && $settings instanceof ElggMenuItem) {
500  // keep the basic and advanced settings at the top
501  /* @var ElggMenuItem $settings */
502  $children = $settings->getChildren();
503  $site_settings = array_splice($children, 0, 2);
504  usort($children, array('ElggMenuBuilder', 'compareByText'));
505  array_splice($children, 0, 0, $site_settings);
506  $settings->setChildren($children);
507  }
508  }
509 }
510 
519 function _elgg_admin_page_handler($page) {
520 
523  elgg_set_context('admin');
524 
525  elgg_unregister_css('elgg');
526  elgg_load_js('elgg.admin');
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 
583  // only admins can use this for security
585 
587  // only thumbnail or full.
588  $size = elgg_extract(1, $pages, 'thumbnail');
589 
590  // the rest of the string is the filename
591  $filename_parts = array_slice($pages, 2);
592  $filename = implode('/', $filename_parts);
594 
596  if (!$plugin) {
597  $file = elgg_get_root_path() . '_graphics/icons/default/medium.png';
598  } else {
599  $file = $plugin->getPath() . $filename;
600  if (!file_exists($file)) {
601  $file = elgg_get_root_path() . '_graphics/icons/default/medium.png';
602  }
603  }
604 
605  header("Content-type: image/jpeg");
606 
607  // resize to 100x100 for thumbnails
608  switch ($size) {
609  case 'thumbnail':
610  echo get_resized_image_from_existing_file($file, 100, 100, true);
611  break;
612 
613  case 'full':
614  default:
615  echo file_get_contents($file);
616  break;
617  }
618  return true;
619 }
620 
640  elgg_set_context('admin');
641 
642  elgg_unregister_css('elgg');
643  elgg_load_js('elgg.admin');
644  elgg_load_js('jquery.jeditable');
645  elgg_load_library('elgg:markdown');
646 
650 
651  $error = false;
652  if (!$plugin) {
653  $error = elgg_echo('admin:plugins:markdown:unknown_plugin');
654  $body = elgg_view_layout('admin', array('content' => $error, 'title' => $error));
655  echo elgg_view_page($error, $body, 'admin');
656  return true;
657  }
658 
659  $text_files = $plugin->getAvailableTextFiles();
660 
661  if (!array_key_exists($filename, $text_files)) {
662  $error = elgg_echo('admin:plugins:markdown:unknown_file');
663  }
664 
665  $file = $text_files[$filename];
666  $file_contents = file_get_contents($file);
667 
668  if (!$file_contents) {
669  $error = elgg_echo('admin:plugins:markdown:unknown_file');
670  }
671 
672  if ($error) {
673  $title = $error;
674  $body = elgg_view_layout('admin', array('content' => $error, 'title' => $title));
675  echo elgg_view_page($title, $body, 'admin');
676  return true;
677  }
678 
679  $title = $plugin->getManifest()->getName() . ": $filename";
680  $text = Markdown($file_contents);
681 
682  $body = elgg_view_layout('admin', array(
683  // setting classes here because there's no way to pass classes
684  // to the layout
685  'content' => '<div class="elgg-markdown">' . $text . '</div>',
686  'title' => $title
687  ));
688 
689  echo elgg_view_page($title, $body, 'admin');
690  return true;
691 }
692 
700  header("Content-type: text/plain");
701  $content = $site->getPrivateSetting('robots.txt');
702  $plugin_content = elgg_trigger_plugin_hook('robots.txt', 'site', array('site' => $site), '');
703  if ($plugin_content) {
704  $content = $content . "\n\n" . $plugin_content;
705  }
706  echo $content;
707 
708  return true;
709 }
710 
719 function _elgg_admin_maintenance_allow_url($current_url) {
720  $site_path = preg_replace('~^https?~', '', elgg_get_site_url());
721  $current_path = preg_replace('~^https?~', '', $current_url);
722  if (0 === strpos($current_path, $site_path)) {
723  $current_path = ($current_path === $site_path) ? '' : substr($current_path, strlen($site_path));
724  } else {
725  $current_path = false;
726  }
727 
728  // allow plugins to control access for specific URLs/paths
729  $params = array(
730  'current_path' => $current_path,
731  'current_url' => $current_url,
732  );
733  return (bool)elgg_trigger_plugin_hook('maintenance:allow', 'url', $params, false);
734 }
735 
741 function _elgg_admin_maintenance_handler($hook, $type, $info) {
742  if (elgg_is_admin_logged_in()) {
743  return;
744  }
745 
746  if ($info['identifier'] == 'action' && $info['segments'][0] == 'login') {
747  return;
748  }
749 
751  return;
752  }
753 
754  elgg_unregister_plugin_hook_handler('register', 'menu:login', '_elgg_login_menu_setup');
755 
757  $message = $site->getPrivateSetting('elgg_maintenance_message');
758  if (!$message) {
759  $message = elgg_echo('admin:maintenance_mode:default_message');
760  }
761 
762  elgg_load_css('maintenance');
763 
764  header("HTTP/1.1 503 Service Unavailable");
765 
766  $body = elgg_view_layout('maintenance', array(
767  'message' => $message,
768  'site' => $site,
769  ));
770  echo elgg_view_page($site->name, $body, 'maintenance');
771 
772  return false;
773 }
774 
785  if (elgg_is_admin_logged_in()) {
786  return true;
787  }
788 
789  if ($type == 'login') {
790  $username = get_input('username');
791 
793 
794  if (!$user) {
796  if ($users) {
797  $user = $users[0];
798  }
799  }
800 
801  if ($user && $user->isAdmin()) {
802  return true;
803  }
804  }
805 
807  return true;
808  }
809 
810  register_error(elgg_echo('actionunauthorized'));
811 
812  return false;
813 }
814 
825 function _elgg_add_admin_widgets($event, $type, $user) {
827 
828  // check if the user already has widgets
829  if (elgg_get_widgets($user->getGUID(), 'admin')) {
830  return true;
831  }
832 
833  // In the form column => array of handlers in order, top to bottom
834  $adminWidgets = array(
835  1 => array('control_panel', 'admin_welcome'),
836  2 => array('online_users', 'new_users', 'content_stats'),
837  );
838 
839  foreach ($adminWidgets as $column => $handlers) {
840  foreach ($handlers as $position => $handler) {
841  $guid = elgg_create_widget($user->getGUID(), $handler, 'admin');
842  if ($guid) {
844  /* @var ElggWidget $widget */
845  $widget->move($column, $position);
846  }
847  }
848  }
849  elgg_set_ignore_access(false);
850 }
851 
852 elgg_register_event_handler('init', 'system', '_elgg_admin_init');
_elgg_add_admin_widgets($event, $type, $user)
Adds default admin widgets to the admin dashboard.
Definition: admin.php:825
elgg_admin_notice_exists($id)
Check if an admin notice is currently active.
Definition: admin.php:160
elgg_delete_admin_notice($id)
Remove an admin notice by ID.
Definition: admin.php:116
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 ElggSite entity (default is current site)
Definition: sites.php:18
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $error
Definition: upload.php:14
$settings_view_new
Definition: full.php:242
$plugin
elgg_get_entities_from_metadata(array $options=array())
ElggEntities interfaces.
Definition: metadata.php:431
get_user_by_email($email)
Get an array of users from an email address.
Definition: users.php:295
elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback)
Unregister a callback as a plugin hook.
Definition: elgglib.php:867
$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_view_icon($name, $class= '')
View one of the elgg sprite icons.
Definition: views.php:1370
_elgg_admin_maintenance_allow_url($current_url)
When in maintenance mode, should the given URL be handled normally?
Definition: admin.php:719
$username
Definition: delete.php:22
_elgg_admin_markdown_page_handler($pages)
Formats and serves out markdown files from plugins.
Definition: admin.php:637
$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:65
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:106
$size
Definition: view.php:10
$object
Definition: upgrade.php:12
elgg_get_admin_notices($limit=10)
Get admin notices.
Definition: admin.php:144
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:136
sanitise_filepath($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
Definition: elgglib.php:484
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 ElggUpgrade object is created.
Definition: admin.php:230
$notices
Definition: admin.php:16
$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:229
_elgg_admin_page_handler($page)
Handle admin pages.
Definition: admin.php:519
elgg_load_library($name)
Load a php library.
Definition: elgglib.php:38
$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:1464
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)
Register a callback as a plugin hook handler.
Definition: elgglib.php:853
_elgg_admin_pagesetup()
Handles any set up required for administration pages.
Definition: admin.php:408
$title
Definition: save.php:24
$position
Definition: move.php:10
get_user_by_username($username)
Get user by username.
Definition: users.php:246
$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:107
$text
Definition: default.php:25
elgg_unregister_css($name)
Unregister a CSS file.
Definition: elgglib.php:241
elgg_register_admin_menu_item($section, $menu_id, $parent_id=null, $priority=100)
Add an admin area section or child section.
Definition: admin.php:192
elgg_load_css($name)
Load a CSS file for this page.
Definition: elgglib.php:256
$limit
Definition: userpicker.php:33
_elgg_admin_maintenance_action_check($hook, $type)
Prevent non-admins from using actions.
Definition: admin.php:784
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
Definition: elgglib.php:128
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:155
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:582
elgg_set_ignore_access($ignore=true)
Set if Elgg&#39;s access system should be ignored.
Definition: access.php:43
$plugin_id
Definition: save.php:16
$users
Definition: newest.php:3
global $CONFIG
_elgg_admin_init()
Initialize the admin backend.
Definition: admin.php:249
$url
Definition: admin.php:10
elgg_set_context($context)
Sets the page context.
Definition: pageowner.php:201
$user
Definition: ban.php:13
const ACCESS_PRIVATE
Definition: elgglib.php:2121
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:273
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:777
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type. ...
Definition: elgglib.php:925
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:73
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:698
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:617
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
Definition: elgglib.php:669
$content
Definition: admin.php:30
elgg_get_plugins($status= 'active', $site_guid=null)
Returns an ordered list of plugins.
Definition: plugins.php:372
$pages
Definition: pagination.php:51
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:489
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:190
$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
$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
$widgets
Definition: dashboard.php:10
_elgg_admin_maintenance_handler($hook, $type, $info)
Handle requests when in maintenance mode.
Definition: admin.php:741
if(!$collection_name) $id
Definition: add.php:17
$settings
_elgg_admin_add_plugin_settings_menu()
Create the plugin settings page menu.
Definition: admin.php:452
Elgg Object.
Definition: ElggObject.php:22
$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 ElggPlugin object with the path $path.
Definition: plugins.php:204
elgg_is_menu_item_registered($menu_name, $item_name)
Check if a menu item has been registered.
Definition: navigation.php:131
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:604