44 $options[
'joins'][] =
"join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid";
46 $options[
'joins'] = array(
"join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid");
53 $options[
'wheres'][] =
"u.admin = 'yes'";
55 $options[
'wheres'][] =
"u.admin = 'yes'";
151 $href =
"admin/$parent_id/$menu_id";
158 $name =
"$parent_id:$name";
165 'context' =>
'admin',
166 'parent_name' => $parent_id,
168 'section' => $section
184 'href' =>
'admin/upgrades',
185 'text' =>
elgg_echo(
'admin:view_upgrades'),
210 'name' =>
'maintenance_mode',
211 'href' =>
'admin/administer_utilities/maintenance',
212 'text' =>
elgg_echo(
'admin:maintenance_mode:indicator_menu_item'),
250 elgg_register_js(
'jquery.jeditable',
'vendors/jquery/jquery.jeditable.mini.js');
255 'name' =>
'dashboard',
256 'href' =>
'admin/dashboard',
258 'context' =>
'admin',
260 'section' =>
'administer' 279 'name' =>
'upgrades',
280 'href' =>
'admin/upgrades',
282 'context' =>
'admin',
284 'section' =>
'configure' 290 'href' =>
'admin/plugins',
292 'context' =>
'admin',
294 'section' =>
'configure' 321 'name' =>
'administration',
330 $widgets = array(
'online_users',
'new_users',
'content_stats',
'banned_users',
'admin_welcome',
'control_panel');
369 'name' =>
'admin_logout',
370 'href' =>
'action/logout',
372 'is_trusted' =>
true,
377 'name' =>
'view_site',
380 'is_trusted' =>
true,
385 'name' =>
'admin_profile',
393 'name' =>
'maintenance',
394 'href' =>
'admin/administer_utilities/maintenance',
395 'text' =>
elgg_echo(
'admin:administer_utilities:maintenance'),
396 'link_class' =>
'elgg-maintenance-mode-warning',
405 'href' =>
'http://learn.elgg.org/en/stable/appendix/faqs.html',
410 'text' =>
elgg_echo(
'admin:footer:manual'),
411 'href' =>
'http://learn.elgg.org/en/stable/admin/index.html',
415 'name' =>
'community_forums',
416 'text' =>
elgg_echo(
'admin:footer:community_forums'),
417 'href' =>
'http://community.elgg.org/groups/all/',
422 'text' =>
elgg_echo(
'admin:footer:blog'),
423 'href' =>
'http://blog.elgg.org/',
441 if (!$active_plugins) {
446 foreach ($active_plugins as
$plugin) {
453 'href' =>
"admin/plugin_settings/$plugin_id",
454 'text' => $plugin->getManifest()->getName(),
455 'parent_name' =>
'settings',
456 'context' =>
'admin',
457 'section' =>
'configure',
476 $configure_items =
$return[
'configure'];
477 if (is_array($configure_items)) {
479 foreach ($configure_items as $menu_item) {
480 if ($menu_item->getName() ==
'settings') {
489 $site_settings = array_splice(
$children, 0, 2);
490 usort(
$children, array(
'\ElggMenuBuilder',
'compareByText'));
491 array_splice(
$children, 0, 0, $site_settings);
516 if (!isset($page[0]) || empty($page[0])) {
517 $page = array(
'dashboard');
522 if (empty($page[count($page) - 1])) {
526 $vars = array(
'page' => $page);
529 if ($page[0] ==
'plugin_settings') {
533 $view =
'admin/plugin_settings';
542 $view =
'admin/' . implode(
'/', $page);
544 if (count($page) > 1) {
577 $filename_parts = array_slice(
$pages, 2);
578 $filename = implode(
'/', $filename_parts);
586 if (!file_exists($file)) {
591 header(
"Content-type: image/jpeg");
601 echo file_get_contents($file);
645 $text_files =
$plugin->getAvailableTextFiles();
647 if (!array_key_exists(
$filename, $text_files)) {
652 $file_contents = file_get_contents($file);
654 if (!$file_contents) {
666 $text = Markdown($file_contents);
671 'content' =>
'<div class="elgg-markdown">' .
$text .
'</div>',
686 header(
"Content-type: text/plain");
689 if ($plugin_content) {
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));
711 $current_path =
false;
716 'current_path' => $current_path,
717 'current_url' => $current_url,
732 if ($info[
'identifier'] ==
'action' && $info[
'segments'][0] ==
'login') {
743 $message =
$site->getPrivateSetting(
'elgg_maintenance_message');
750 header(
"HTTP/1.1 503 Service Unavailable");
775 if (
$type ==
'login') {
820 $adminWidgets = array(
821 1 => array(
'control_panel',
'admin_welcome'),
822 2 => array(
'online_users',
'new_users',
'content_stats'),
825 foreach ($adminWidgets as
$column => $handlers) {
_elgg_add_admin_widgets($event, $type, $user)
Adds default admin widgets to the admin dashboard.
elgg_admin_notice_exists($id)
Check if an admin notice is currently active.
elgg_delete_admin_notice($id)
Remove an admin notice by ID.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_get_site_entity($site_guid=0)
Get an entity (default is current site)
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $error
get_user_by_email($email)
Get an array of users from an email address.
elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback)
Unregister a callback as a plugin hook.
elgg_view_icon($name, $class= '')
View one of the elgg sprite icons.
_elgg_admin_maintenance_allow_url($current_url)
When in maintenance mode, should the given URL be handled normally?
_elgg_admin_markdown_page_handler($pages)
Formats and serves out markdown files from plugins.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
if($guid==elgg_get_logged_in_user_guid()) $name
elgg_get_admin_notices($limit=10)
Get admin notices.
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
sanitise_filepath($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
elgg_add_admin_notice($id, $message)
Write a persistent message to the admin view.
_elgg_create_notice_of_pending_upgrade($event, $type, $object)
Add an admin notice when a new object is created.
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
elgg_register_css($name, $url, $priority=null)
Register a CSS file for inclusion in the HTML head.
_elgg_admin_page_handler($page)
Handle admin pages.
elgg_load_library($name)
Load a PHP library.
$vars['type']
Install create admin account page.
if(!$autoload_available) _elgg_services()
$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.
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Register a callback as a plugin hook handler.
_elgg_admin_pagesetup()
Handles any set up required for administration pages.
get_user_by_username($username)
Get user by username.
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...
elgg_unregister_css($name)
Unregister a CSS file.
elgg_register_admin_menu_item($section, $menu_id, $parent_id=null, $priority=100)
Add an admin area section or child section.
elgg_load_css($name)
Load a CSS file for this page.
_elgg_admin_maintenance_action_check($hook, $type)
Prevent non-admins from using actions.
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
elgg_get_simplecache_url($type, $view)
_elgg_admin_plugin_screenshot_page_handler($pages)
Serves up screenshots for plugins from admin_plugin_screenshot/<plugin_id>/<size>/<ss_name>.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
_elgg_admin_init()
Initialize the admin backend.
elgg_set_context($context)
Sets the page context.
elgg_in_context($context)
Check if this context exists anywhere in the stack.
elgg_get_root_path()
Get the root directory path for this installation.
elgg echo
Translates a string.
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type. ...
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
elgg global
Pointer to the global context.
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
_elgg_robots_page_handler()
Handle request for robots.txt.
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
elgg_get_plugins($status= 'active', $site_guid=null)
Returns an ordered list of plugins.
elgg_admin_gatekeeper()
Used at the top of a page to mark it as admin only.
_elgg_admin_sort_page_menu($hook, $type, $return, $params)
Sort the plugin settings menu items.
elgg register_error
Wrapper function for system_messages.
elgg_load_js($name)
Load a JavaScript resource on this page.
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_get_admins(array $options=array())
Get the admin users.
clearfix elgg elgg elgg elgg page header
elgg_register_action($action, $filename="", $access= 'logged_in')
Registers an action.
_elgg_admin_maintenance_handler($hook, $type, $info)
Handle requests when in maintenance mode.
if(!$collection_name) $id
_elgg_admin_add_plugin_settings_menu()
Create the plugin settings page menu.
elgg_get_plugin_from_id($plugin_id)
Returns an object with the path $path.
elgg_is_menu_item_registered($menu_name, $item_name)
Check if a menu item has been registered.
get_entity($guid)
Loads and returns an entity object from a guid.