Elgg  Version 1.9
Namespaces | Functions
admin.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Activate a plugin or plugins.
 

Functions

 elgg_get_admins (array $options=array())
 Get the admin users. More...
 
 elgg_add_admin_notice ($id, $message)
 Write a persistent message to the admin view. More...
 
 elgg_delete_admin_notice ($id)
 Remove an admin notice by ID. More...
 
 elgg_get_admin_notices ($limit=10)
 Get admin notices. More...
 
 elgg_admin_notice_exists ($id)
 Check if an admin notice is currently active. More...
 
 elgg_register_admin_menu_item ($section, $menu_id, $parent_id=null, $priority=100)
 Add an admin area section or child section. More...
 
 _elgg_create_notice_of_pending_upgrade ($event, $type, $object)
 Add an admin notice when a new ElggUpgrade object is created. More...
 
 _elgg_admin_init ()
 Initialize the admin backend. More...
 
 _elgg_admin_pagesetup ()
 Handles any set up required for administration pages. More...
 
 _elgg_admin_add_plugin_settings_menu ()
 Create the plugin settings page menu. More...
 
 _elgg_admin_sort_page_menu ($hook, $type, $return, $params)
 Sort the plugin settings menu items. More...
 
 _elgg_admin_page_handler ($page)
 Handle admin pages. More...
 
 _elgg_admin_plugin_screenshot_page_handler ($pages)
 Serves up screenshots for plugins from admin_plugin_screenshot/<plugin_id>/<size>/<ss_name>. More...
 
 _elgg_admin_markdown_page_handler ($pages)
 Formats and serves out markdown files from plugins. More...
 
 _elgg_robots_page_handler ()
 Handle request for robots.txt. More...
 
 _elgg_admin_maintenance_allow_url ($current_url)
 When in maintenance mode, should the given URL be handled normally? More...
 
 _elgg_admin_maintenance_handler ($hook, $type, $info)
 Handle requests when in maintenance mode. More...
 
 _elgg_admin_maintenance_action_check ($hook, $type)
 Prevent non-admins from using actions. More...
 
 _elgg_add_admin_widgets ($event, $type, $user)
 Adds default admin widgets to the admin dashboard. More...
 

Function Documentation

_elgg_add_admin_widgets (   $event,
  $type,
  $user 
)

Adds default admin widgets to the admin dashboard.

Parameters
string$event
string$type
ElggUser$user
Returns
null|true private

Definition at line 825 of file admin.php.

_elgg_admin_add_plugin_settings_menu ( )

Create the plugin settings page menu.

This is done in a separate function called from the admin page handler because of performance concerns.

Returns
void private
Since
1.8.0

Definition at line 452 of file admin.php.

_elgg_admin_init ( )

Initialize the admin backend.

Returns
void private

Definition at line 249 of file admin.php.

_elgg_admin_maintenance_action_check (   $hook,
  $type 
)

Prevent non-admins from using actions.

private

Parameters
string$hookHook name
string$typeAction name
Returns
bool

Definition at line 784 of file admin.php.

_elgg_admin_maintenance_allow_url (   $current_url)

When in maintenance mode, should the given URL be handled normally?

Parameters
string$current_urlCurrent page URL
Returns
bool

private

Definition at line 719 of file admin.php.

_elgg_admin_maintenance_handler (   $hook,
  $type,
  $info 
)

Handle requests when in maintenance mode.

private

Definition at line 741 of file admin.php.

_elgg_admin_markdown_page_handler (   $pages)

Formats and serves out markdown files from plugins.

URLs in format like admin_plugin_text_file/<plugin_id>/filename.ext

The only valid files are:

Parameters
array$pages
Returns
bool private

Definition at line 637 of file admin.php.

_elgg_admin_page_handler (   $page)

Handle admin pages.

Expects corresponding views as admin/section/subsection

Parameters
array$pageArray of pages
Returns
bool private

Definition at line 519 of file admin.php.

_elgg_admin_pagesetup ( )

Handles any set up required for administration pages.

Returns
void private

Definition at line 408 of file admin.php.

_elgg_admin_plugin_screenshot_page_handler (   $pages)

Serves up screenshots for plugins from admin_plugin_screenshot/<plugin_id>/<size>/<ss_name>.

<ext>

Parameters
array$pagesThe pages array
Returns
bool private

Definition at line 582 of file admin.php.

_elgg_admin_sort_page_menu (   $hook,
  $type,
  $return,
  $params 
)

Sort the plugin settings menu items.

Parameters
string$hook
string$type
array$return
array$params
Returns
void
Since
1.8.0 private

Definition at line 489 of file admin.php.

_elgg_create_notice_of_pending_upgrade (   $event,
  $type,
  $object 
)

Add an admin notice when a new ElggUpgrade object is created.

Parameters
string$event
string$type
ElggObject$objectprivate

Definition at line 230 of file admin.php.

_elgg_robots_page_handler ( )

Handle request for robots.txt.

private

Definition at line 698 of file admin.php.

elgg_add_admin_notice (   $id,
  $message 
)

Write a persistent message to the admin view.

Useful to alert the admin to take a certain action. The id is a unique ID that can be cleared once the admin completes the action.

eg: add_admin_notice('twitter_services_no_api', 'Before your users can use Twitter services on this site, you must set up the Twitter API key in the Twitter Services Settings');

Parameters
string$idA unique ID that your plugin can remember
string$messageBody of the message
Returns
bool
Since
1.8.0

Definition at line 77 of file admin.php.

elgg_admin_notice_exists (   $id)

Check if an admin notice is currently active.

Parameters
string$idThe unique ID used to register the notice.
Returns
bool
Since
1.8.0

Definition at line 160 of file admin.php.

elgg_delete_admin_notice (   $id)

Remove an admin notice by ID.

eg In actions/twitter_service/save_settings: if (is_valid_twitter_api_key()) { delete_admin_notice('twitter_services_no_api'); }

Parameters
string$idThe unique ID assigned in add_admin_notice()
Returns
bool
Since
1.8.0

Definition at line 116 of file admin.php.

elgg_get_admin_notices (   $limit = 10)

Get admin notices.

An admin must be logged in since the notices are private.

Parameters
int$limitLimit
Returns
array Array of admin notices
Since
1.8.0

Definition at line 144 of file admin.php.

elgg_get_admins ( array  $options = array())

Get the admin users.

Parameters
array$optionsOptions array,
See also
elgg_get_entities() for parameters
Returns
mixed Array of admin users or false on failure. If a count, returns int.
Since
1.8.0

Definition at line 37 of file admin.php.

elgg_register_admin_menu_item (   $section,
  $menu_id,
  $parent_id = null,
  $priority = 100 
)

Add an admin area section or child section.

This is a wrapper for elgg_register_menu_item().

Used in conjuction with http://elgg.org/admin/section_id/child_section style page handler. See the documentation at the top of this file for more details on that.

The text of the menu item is obtained from elgg_echo(admin:$parent_id:$menu_id)

This function handles registering the parent if it has not been registered.

Parameters
string$sectionThe menu section to add to
string$menu_idThe unique ID of section
string$parent_idIf a child section, the parent section id
int$priorityThe menu item priority
Returns
bool
Since
1.8.0

Definition at line 192 of file admin.php.