Elgg  Version 1.10
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/site/regenerate_secret', '', 'admin');
235 
236  elgg_register_action('admin/menu/save', '', 'admin');
237 
238  elgg_register_action('admin/delete_admin_notice', '', 'admin');
239 
240  elgg_register_action('profile/fields/reset', '', 'admin');
241  elgg_register_action('profile/fields/add', '', 'admin');
242  elgg_register_action('profile/fields/edit', '', 'admin');
243  elgg_register_action('profile/fields/delete', '', 'admin');
244  elgg_register_action('profile/fields/reorder', '', 'admin');
245 
246  elgg_register_simplecache_view('css/admin');
247  $url = elgg_get_simplecache_url('js', 'admin');
248  elgg_register_js('elgg.admin', $url);
249  elgg_register_js('elgg.upgrades', 'js/lib/upgrades.js');
250  elgg_register_js('jquery.jeditable', 'vendors/jquery/jquery.jeditable.mini.js');
251 
252  // administer
253  // dashboard
254  elgg_register_menu_item('page', array(
255  'name' => 'dashboard',
256  'href' => 'admin/dashboard',
257  'text' => elgg_echo('admin:dashboard'),
258  'context' => 'admin',
259  'priority' => 10,
260  'section' => 'administer'
261  ));
262  // statistics
263  elgg_register_admin_menu_item('administer', 'statistics', null, 20);
264  elgg_register_admin_menu_item('administer', 'overview', 'statistics');
265  elgg_register_admin_menu_item('administer', 'server', 'statistics');
266  //utilities
267  elgg_register_admin_menu_item('administer', 'maintenance', 'administer_utilities');
268 
269  // users
270  elgg_register_admin_menu_item('administer', 'users', null, 20);
271  elgg_register_admin_menu_item('administer', 'online', 'users', 10);
272  elgg_register_admin_menu_item('administer', 'admins', 'users', 20);
273  elgg_register_admin_menu_item('administer', 'newest', 'users', 30);
274  elgg_register_admin_menu_item('administer', 'add', 'users', 40);
275 
276  // configure
277  // upgrades
278  elgg_register_menu_item('page', array(
279  'name' => 'upgrades',
280  'href' => 'admin/upgrades',
281  'text' => elgg_echo('admin:upgrades'),
282  'context' => 'admin',
283  'priority' => 10,
284  'section' => 'configure'
285  ));
286 
287  // plugins
288  elgg_register_menu_item('page', array(
289  'name' => 'plugins',
290  'href' => 'admin/plugins',
291  'text' => elgg_echo('admin:plugins'),
292  'context' => 'admin',
293  'priority' => 75,
294  'section' => 'configure'
295  ));
296 
297  // settings
298  elgg_register_admin_menu_item('configure', 'appearance', null, 50);
299  elgg_register_admin_menu_item('configure', 'settings', null, 100);
300  elgg_register_admin_menu_item('configure', 'basic', 'settings', 10);
301  elgg_register_admin_menu_item('configure', 'advanced', 'settings', 20);
302  // plugin settings are added in _elgg_admin_add_plugin_settings_menu() via the admin page handler
303  // for performance reasons.
304 
305  // appearance
306  elgg_register_admin_menu_item('configure', 'menu_items', 'appearance', 30);
307  elgg_register_admin_menu_item('configure', 'profile_fields', 'appearance', 40);
308  // default widgets is added via an event handler elgg_default_widgets_init() in widgets.php
309  // because it requires additional setup.
310 
311  // configure utilities
312  elgg_register_admin_menu_item('configure', 'robots', 'configure_utilities');
313 
314  // we want plugin settings menu items to be sorted alphabetical
315  if (elgg_in_context('admin')) {
316  elgg_register_plugin_hook_handler('prepare', 'menu:page', '_elgg_admin_sort_page_menu');
317  }
318 
319  if (elgg_is_admin_logged_in()) {
320  elgg_register_menu_item('topbar', array(
321  'name' => 'administration',
322  'href' => 'admin',
323  'text' => elgg_view_icon('settings') . elgg_echo('admin'),
324  'priority' => 100,
325  'section' => 'alt',
326  ));
327  }
328 
329  // widgets
330  $widgets = array('online_users', 'new_users', 'content_stats', 'banned_users', 'admin_welcome', 'control_panel');
331  foreach ($widgets as $widget) {
333  $widget,
334  elgg_echo("admin:widget:$widget"),
335  elgg_echo("admin:widget:$widget:help"),
336  array('admin')
337  );
338  }
339 
340  // automatic adding of widgets for admin
341  elgg_register_event_handler('make_admin', 'user', '_elgg_add_admin_widgets');
342 
343  // Add notice about pending upgrades
344  elgg_register_event_handler('create', 'object', '_elgg_create_notice_of_pending_upgrade');
345 
346  elgg_register_page_handler('admin', '_elgg_admin_page_handler');
347  elgg_register_page_handler('admin_plugin_screenshot', '_elgg_admin_plugin_screenshot_page_handler');
348  elgg_register_page_handler('admin_plugin_text_file', '_elgg_admin_markdown_page_handler');
349  elgg_register_page_handler('robots.txt', '_elgg_robots_page_handler');
350 }
351 
359  if (elgg_in_context('admin')) {
360  $url = elgg_get_simplecache_url('css', 'admin');
361  elgg_register_css('elgg.admin', $url);
362  elgg_load_css('elgg.admin');
363  elgg_unregister_css('elgg');
364 
366 
367  // setup header menu
368  elgg_register_menu_item('admin_header', array(
369  'name' => 'admin_logout',
370  'href' => 'action/logout',
371  'text' => elgg_echo('logout'),
372  'is_trusted' => true,
373  'priority' => 1000,
374  ));
375 
376  elgg_register_menu_item('admin_header', array(
377  'name' => 'view_site',
378  'href' => elgg_get_site_url(),
379  'text' => elgg_echo('admin:view_site'),
380  'is_trusted' => true,
381  'priority' => 900,
382  ));
383 
384  elgg_register_menu_item('admin_header', array(
385  'name' => 'admin_profile',
386  'href' => false,
387  'text' => elgg_echo('admin:loggedin', array($admin->name)),
388  'priority' => 800,
389  ));
390 
391  if (elgg_get_config('elgg_maintenance_mode', null)) {
392  elgg_register_menu_item('admin_header', array(
393  'name' => 'maintenance',
394  'href' => 'admin/administer_utilities/maintenance',
395  'text' => elgg_echo('admin:administer_utilities:maintenance'),
396  'link_class' => 'elgg-maintenance-mode-warning',
397  'priority' => 700,
398  ));
399  }
400 
401  // setup footer menu
402  elgg_register_menu_item('admin_footer', array(
403  'name' => 'faq',
404  'text' => elgg_echo('admin:footer:faq'),
405  'href' => 'http://learn.elgg.org/en/stable/appendix/faqs.html',
406  ));
407 
408  elgg_register_menu_item('admin_footer', array(
409  'name' => 'manual',
410  'text' => elgg_echo('admin:footer:manual'),
411  'href' => 'http://learn.elgg.org/en/stable/admin/index.html',
412  ));
413 
414  elgg_register_menu_item('admin_footer', array(
415  'name' => 'community_forums',
416  'text' => elgg_echo('admin:footer:community_forums'),
417  'href' => 'http://community.elgg.org/groups/all/',
418  ));
419 
420  elgg_register_menu_item('admin_footer', array(
421  'name' => 'blog',
422  'text' => elgg_echo('admin:footer:blog'),
423  'href' => 'http://blog.elgg.org/',
424  ));
425  }
426 }
427 
439 
440  $active_plugins = elgg_get_plugins('active');
441  if (!$active_plugins) {
442  // nothing added because no items
443  return;
444  }
445 
446  foreach ($active_plugins as $plugin) {
447  $plugin_id = $plugin->getID();
448  $settings_view_old = 'settings/' . $plugin_id . '/edit';
449  $settings_view_new = 'plugins/' . $plugin_id . '/settings';
451  elgg_register_menu_item('page', array(
452  'name' => $plugin_id,
453  'href' => "admin/plugin_settings/$plugin_id",
454  'text' => $plugin->getManifest()->getName(),
455  'parent_name' => 'settings',
456  'context' => 'admin',
457  'section' => 'configure',
458  ));
459  }
460  }
461 }
462 
476  $configure_items = $return['configure'];
477  if (is_array($configure_items)) {
478  /* @var \ElggMenuItem[] $configure_items */
479  foreach ($configure_items as $menu_item) {
480  if ($menu_item->getName() == 'settings') {
481  $settings = $menu_item;
482  }
483  }
484 
485  if (!empty($settings) && $settings instanceof \ElggMenuItem) {
486  // keep the basic and advanced settings at the top
487  /* @var \ElggMenuItem $settings */
488  $children = $settings->getChildren();
489  $site_settings = array_splice($children, 0, 2);
490  usort($children, array('\ElggMenuBuilder', 'compareByText'));
491  array_splice($children, 0, 0, $site_settings);
492  $settings->setChildren($children);
493  }
494  }
495 }
496 
505 function _elgg_admin_page_handler($page) {
506 
509  elgg_set_context('admin');
510 
511  elgg_unregister_css('elgg');
512  elgg_load_js('elgg.admin');
513  elgg_load_js('jquery.jeditable');
514 
515  // default to dashboard
516  if (!isset($page[0]) || empty($page[0])) {
517  $page = array('dashboard');
518  }
519 
520  // was going to fix this in the page_handler() function but
521  // it's commented to explicitly return a string if there's a trailing /
522  if (empty($page[count($page) - 1])) {
523  array_pop($page);
524  }
525 
526  $vars = array('page' => $page);
527 
528  // special page for plugin settings since we create the form for them
529  if ($page[0] == 'plugin_settings') {
530  if (isset($page[1]) && (elgg_view_exists("settings/{$page[1]}/edit") ||
531  elgg_view_exists("plugins/{$page[1]}/settings"))) {
532 
533  $view = 'admin/plugin_settings';
534  $plugin = elgg_get_plugin_from_id($page[1]);
535  $vars['plugin'] = $plugin;
536 
537  $title = elgg_echo("admin:{$page[0]}");
538  } else {
539  forward('', '404');
540  }
541  } else {
542  $view = 'admin/' . implode('/', $page);
543  $title = elgg_echo("admin:{$page[0]}");
544  if (count($page) > 1) {
545  $title .= ' : ' . elgg_echo('admin:' . implode(':', $page));
546  }
547  }
548 
549  // gets content and prevents direct access to 'components' views
550  if ($page[0] == 'components' || !($content = elgg_view($view, $vars))) {
551  $title = elgg_echo('admin:unknown_section');
552  $content = elgg_echo('admin:unknown_section');
553  }
554 
555  $body = elgg_view_layout('admin', array('content' => $content, 'title' => $title));
556  echo elgg_view_page($title, $body, 'admin');
557  return true;
558 }
559 
569  // only admins can use this for security
571 
573  // only thumbnail or full.
574  $size = elgg_extract(1, $pages, 'thumbnail');
575 
576  // the rest of the string is the filename
577  $filename_parts = array_slice($pages, 2);
578  $filename = implode('/', $filename_parts);
580 
582  if (!$plugin) {
583  $file = elgg_get_root_path() . '_graphics/icons/default/medium.png';
584  } else {
585  $file = $plugin->getPath() . $filename;
586  if (!file_exists($file)) {
587  $file = elgg_get_root_path() . '_graphics/icons/default/medium.png';
588  }
589  }
590 
591  header("Content-type: image/jpeg");
592 
593  // resize to 100x100 for thumbnails
594  switch ($size) {
595  case 'thumbnail':
596  echo get_resized_image_from_existing_file($file, 100, 100, true);
597  break;
598 
599  case 'full':
600  default:
601  echo file_get_contents($file);
602  break;
603  }
604  return true;
605 }
606 
626  elgg_set_context('admin');
627 
628  elgg_unregister_css('elgg');
629  elgg_load_js('elgg.admin');
630  elgg_load_js('jquery.jeditable');
631  elgg_load_library('elgg:markdown');
632 
636 
637  $error = false;
638  if (!$plugin) {
639  $error = elgg_echo('admin:plugins:markdown:unknown_plugin');
640  $body = elgg_view_layout('admin', array('content' => $error, 'title' => $error));
641  echo elgg_view_page($error, $body, 'admin');
642  return true;
643  }
644 
645  $text_files = $plugin->getAvailableTextFiles();
646 
647  if (!array_key_exists($filename, $text_files)) {
648  $error = elgg_echo('admin:plugins:markdown:unknown_file');
649  }
650 
651  $file = $text_files[$filename];
652  $file_contents = file_get_contents($file);
653 
654  if (!$file_contents) {
655  $error = elgg_echo('admin:plugins:markdown:unknown_file');
656  }
657 
658  if ($error) {
659  $title = $error;
660  $body = elgg_view_layout('admin', array('content' => $error, 'title' => $title));
661  echo elgg_view_page($title, $body, 'admin');
662  return true;
663  }
664 
665  $title = $plugin->getManifest()->getName() . ": $filename";
666  $text = Markdown($file_contents);
667 
668  $body = elgg_view_layout('admin', array(
669  // setting classes here because there's no way to pass classes
670  // to the layout
671  'content' => '<div class="elgg-markdown">' . $text . '</div>',
672  'title' => $title
673  ));
674 
675  echo elgg_view_page($title, $body, 'admin');
676  return true;
677 }
678 
686  header("Content-type: text/plain");
687  $content = $site->getPrivateSetting('robots.txt');
688  $plugin_content = elgg_trigger_plugin_hook('robots.txt', 'site', array('site' => $site), '');
689  if ($plugin_content) {
690  $content = $content . "\n\n" . $plugin_content;
691  }
692  echo $content;
693 
694  return true;
695 }
696 
705 function _elgg_admin_maintenance_allow_url($current_url) {
706  $site_path = preg_replace('~^https?~', '', elgg_get_site_url());
707  $current_path = preg_replace('~^https?~', '', $current_url);
708  if (0 === strpos($current_path, $site_path)) {
709  $current_path = ($current_path === $site_path) ? '' : substr($current_path, strlen($site_path));
710  } else {
711  $current_path = false;
712  }
713 
714  // allow plugins to control access for specific URLs/paths
715  $params = array(
716  'current_path' => $current_path,
717  'current_url' => $current_url,
718  );
719  return (bool)elgg_trigger_plugin_hook('maintenance:allow', 'url', $params, false);
720 }
721 
727 function _elgg_admin_maintenance_handler($hook, $type, $info) {
728  if (elgg_is_admin_logged_in()) {
729  return;
730  }
731 
732  if ($info['identifier'] == 'action' && $info['segments'][0] == 'login') {
733  return;
734  }
735 
737  return;
738  }
739 
740  elgg_unregister_plugin_hook_handler('register', 'menu:login', '_elgg_login_menu_setup');
741 
743  $message = $site->getPrivateSetting('elgg_maintenance_message');
744  if (!$message) {
745  $message = elgg_echo('admin:maintenance_mode:default_message');
746  }
747 
748  elgg_load_css('maintenance');
749 
750  header("HTTP/1.1 503 Service Unavailable");
751 
752  $body = elgg_view_layout('maintenance', array(
753  'message' => $message,
754  'site' => $site,
755  ));
756  echo elgg_view_page($site->name, $body, 'maintenance');
757 
758  return false;
759 }
760 
771  if (elgg_is_admin_logged_in()) {
772  return true;
773  }
774 
775  if ($type == 'login') {
776  $username = get_input('username');
777 
779 
780  if (!$user) {
782  if ($users) {
783  $user = $users[0];
784  }
785  }
786 
787  if ($user && $user->isAdmin()) {
788  return true;
789  }
790  }
791 
793  return true;
794  }
795 
796  register_error(elgg_echo('actionunauthorized'));
797 
798  return false;
799 }
800 
811 function _elgg_add_admin_widgets($event, $type, $user) {
813 
814  // check if the user already has widgets
815  if (elgg_get_widgets($user->getGUID(), 'admin')) {
816  return true;
817  }
818 
819  // In the form column => array of handlers in order, top to bottom
820  $adminWidgets = array(
821  1 => array('control_panel', 'admin_welcome'),
822  2 => array('online_users', 'new_users', 'content_stats'),
823  );
824 
825  foreach ($adminWidgets as $column => $handlers) {
826  foreach ($handlers as $position => $handler) {
827  $guid = elgg_create_widget($user->getGUID(), $handler, 'admin');
828  if ($guid) {
830  /* @var \ElggWidget $widget */
831  $widget->move($column, $position);
832  }
833  }
834  }
835  elgg_set_ignore_access(false);
836 }
837 
838 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:811
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:751
$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:1372
_elgg_admin_maintenance_allow_url($current_url)
When in maintenance mode, should the given URL be handled normally?
Definition: admin.php:705
$username
Definition: delete.php:22
_elgg_admin_markdown_page_handler($pages)
Formats and serves out markdown files from plugins.
Definition: admin.php:623
$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
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:505
elgg_load_library($name)
Load a PHP library.
Definition: elgglib.php:43
$vars['type']
Install create admin account page.
Definition: admin.php:8
if(!$autoload_available) _elgg_services()
Definition: autoloader.php:20
$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:1349
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:737
_elgg_admin_pagesetup()
Handles any set up required for administration pages.
Definition: admin.php:358
$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:107
$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:33
_elgg_admin_maintenance_action_check($hook, $type)
Prevent non-admins from using actions.
Definition: admin.php:770
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:568
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: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)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type. ...
Definition: elgglib.php:809
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:684
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:618
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
Definition: elgglib.php:553
$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: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:475
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:727
if(!$collection_name) $id
Definition: add.php:17
$settings
_elgg_admin_add_plugin_settings_menu()
Create the plugin settings page menu.
Definition: admin.php:438
$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