PHP Класс Elgg\Database\AdminNotices

Controls all admin notices in the system.
С версии: 1.10.0
Показать файл Открыть проект

Открытые методы

Метод Описание
add ( string $id, string $message ) : boolean Write a persistent message to the admin view.
delete ( string $id ) : boolean Remove an admin notice by ID.
exists ( string $id ) : boolean Check if an admin notice is currently active.
find ( integer $limit = 10 ) : array Get admin notices. An admin must be logged in since the notices are private.

Описание методов

add() публичный метод

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');
public add ( string $id, string $message ) : boolean
$id string A unique ID that your plugin can remember
$message string Body of the message
Результат boolean

delete() публичный метод

eg In actions/twitter_service/save_settings: if (is_valid_twitter_api_key()) { delete_admin_notice('twitter_services_no_api'); }
public delete ( string $id ) : boolean
$id string The unique ID assigned in add_admin_notice()
Результат boolean

exists() публичный метод

Check if an admin notice is currently active.
С версии: 1.8.0
public exists ( string $id ) : boolean
$id string The unique ID used to register the notice.
Результат boolean

find() публичный метод

Get admin notices. An admin must be logged in since the notices are private.
public find ( integer $limit = 10 ) : array
$limit integer Limit
Результат array Array of admin notices