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'";
87 $admin_notice->subtype =
'admin_notice';
90 $admin_notice->admin_notice_id =
$id;
91 $admin_notice->description =
$message;
93 $result = $admin_notice->save();
122 'metadata_name' =>
'admin_notice_id',
123 'metadata_value' =>
$id 147 'subtype' =>
'admin_notice',
164 'subtype' =>
'admin_notice',
165 'metadata_name_value_pair' => array(
'name' =>
'admin_notice_id',
'value' =>
$id)
169 return (
$notice) ?
true :
false;
201 $href =
"admin/$parent_id/$menu_id";
208 $name =
"$parent_id:$name";
215 'context' =>
'admin',
216 'parent_name' => $parent_id,
218 'section' => $section
234 'href' =>
'admin/upgrades',
235 'text' =>
elgg_echo(
'admin:view_upgrades'),
260 'name' =>
'maintenance_mode',
261 'href' =>
'admin/administer_utilities/maintenance',
262 'text' =>
elgg_echo(
'admin:maintenance_mode:indicator_menu_item'),
300 elgg_register_js(
'jquery.jeditable',
'vendors/jquery/jquery.jeditable.mini.js');
305 'name' =>
'dashboard',
306 'href' =>
'admin/dashboard',
308 'context' =>
'admin',
310 'section' =>
'administer' 329 'name' =>
'upgrades',
330 'href' =>
'admin/upgrades',
332 'context' =>
'admin',
334 'section' =>
'configure' 340 'href' =>
'admin/plugins',
342 'context' =>
'admin',
344 'section' =>
'configure' 371 'name' =>
'administration',
380 $widgets = array(
'online_users',
'new_users',
'content_stats',
'banned_users',
'admin_welcome',
'control_panel');
419 'href' =>
'http://learn.elgg.org/en/stable/appendix/faqs.html',
424 'text' =>
elgg_echo(
'admin:footer:manual'),
425 'href' =>
'http://learn.elgg.org/en/stable/admin/index.html',
429 'name' =>
'community_forums',
430 'text' =>
elgg_echo(
'admin:footer:community_forums'),
431 'href' =>
'http://community.elgg.org/groups/all/',
436 'text' =>
elgg_echo(
'admin:footer:blog'),
437 'href' =>
'http://blog.elgg.org/',
455 if (!$active_plugins) {
460 foreach ($active_plugins as
$plugin) {
467 'href' =>
"admin/plugin_settings/$plugin_id",
468 'text' => $plugin->getManifest()->getName(),
469 'parent_name' =>
'settings',
470 'context' =>
'admin',
471 'section' =>
'configure',
490 $configure_items =
$return[
'configure'];
491 if (is_array($configure_items)) {
493 foreach ($configure_items as $menu_item) {
494 if ($menu_item->getName() ==
'settings') {
503 $site_settings = array_splice(
$children, 0, 2);
504 usort(
$children, array(
'ElggMenuBuilder',
'compareByText'));
505 array_splice(
$children, 0, 0, $site_settings);
530 if (!isset($page[0]) || empty($page[0])) {
531 $page = array(
'dashboard');
536 if (empty($page[count($page) - 1])) {
540 $vars = array(
'page' => $page);
543 if ($page[0] ==
'plugin_settings') {
547 $view =
'admin/plugin_settings';
556 $view =
'admin/' . implode(
'/', $page);
558 if (count($page) > 1) {
591 $filename_parts = array_slice(
$pages, 2);
592 $filename = implode(
'/', $filename_parts);
600 if (!file_exists($file)) {
605 header(
"Content-type: image/jpeg");
615 echo file_get_contents($file);
659 $text_files =
$plugin->getAvailableTextFiles();
661 if (!array_key_exists(
$filename, $text_files)) {
666 $file_contents = file_get_contents($file);
668 if (!$file_contents) {
680 $text = Markdown($file_contents);
685 'content' =>
'<div class="elgg-markdown">' .
$text .
'</div>',
700 header(
"Content-type: text/plain");
703 if ($plugin_content) {
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));
725 $current_path =
false;
730 'current_path' => $current_path,
731 'current_url' => $current_url,
746 if ($info[
'identifier'] ==
'action' && $info[
'segments'][0] ==
'login') {
757 $message =
$site->getPrivateSetting(
'elgg_maintenance_message');
764 header(
"HTTP/1.1 503 Service Unavailable");
789 if (
$type ==
'login') {
834 $adminWidgets = array(
835 1 => array(
'control_panel',
'admin_welcome'),
836 2 => array(
'online_users',
'new_users',
'content_stats'),
839 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 ElggSite 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 ElggUpgrade 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.
$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_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 ElggPlugin 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.