Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
Elgg\Database\AdminNotices Class Reference

Public Member Functions

 add ($id, $message)
 Write a persistent message to the admin view. More...
 
 delete ($id)
 Remove an admin notice by ID. More...
 
 find ($limit=10)
 Get admin notices. More...
 
 exists ($id)
 Check if an admin notice is currently active. More...
 

Detailed Description

Definition at line 15 of file AdminNotices.php.

Member Function Documentation

Elgg\Database\AdminNotices::add (   $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

Definition at line 31 of file AdminNotices.php.

Elgg\Database\AdminNotices::delete (   $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

Definition at line 69 of file AdminNotices.php.

Elgg\Database\AdminNotices::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 114 of file AdminNotices.php.

Elgg\Database\AdminNotices::find (   $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

Definition at line 97 of file AdminNotices.php.


The documentation for this class was generated from the following file: