Elgg  Version 6.0
Functions
admin.php File Reference

Go to the source code of this file.

Functions

 elgg_get_admins (array $options=[])
 Elgg admin functions. More...
 
 elgg_add_admin_notice (string $id, string $message)
 Write a persistent message to the admin view. More...
 
 elgg_delete_admin_notice (string $id)
 Remove an admin notice by ID. More...
 
 elgg_get_admin_notices (array $options=[])
 Get admin notices. More...
 
 elgg_admin_notice_exists (string $id)
 Check if an admin notice is currently active. More...
 

Function Documentation

elgg_add_admin_notice ( string  $id,
string  $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
ElggAdminNotice|null
Since
1.8.0

Definition at line 51 of file admin.php.

elgg_admin_notice_exists ( string  $id)

Check if an admin notice is currently active.

(Ignores access)

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

Definition at line 87 of file admin.php.

elgg_delete_admin_notice ( string  $id)

Remove an admin notice by ID.

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

Definition at line 63 of file admin.php.

elgg_get_admin_notices ( array  $options = [])

Get admin notices.

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

Parameters
array$optionsQuery options
Returns
[]|int|mixed Admin notices
Since
1.8.0

Definition at line 75 of file admin.php.

elgg_get_admins ( array  $options = [])

Elgg admin functions.

Admin pages Plugins no not need to provide their own page handler to add a page to the admin area. A view placed at admin/<section>/<subsection> can be access at http://example.org/admin/<section>/<subsection>. The title of the page will be elgg_echo('admin:<section>:<subsection>').

Admin notices System messages (success and error messages) are used in both the main site and the admin area. There is a special presistent message for the admin area called an admin notice. It should be used when a plugin requires an administrator to take an action.

See also
elgg_add_admin_notice() 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 26 of file admin.php.