PHP 클래스 Elgg\Database\AdminNotices

Controls all admin notices in the system.
부터: 1.10.0
파일 보기 프로젝트 열기: elgg/elgg

공개 메소드들

메소드 설명
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