Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(ui): Allows modifying system messages/errors
This adds functions to get and set all the system messages (and errors), allowing plugins to remove/replace messages or errors already registered. This also deprecates the Swiss army function system_messages().
- Loading branch information
Showing
5 changed files
with
237 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
namespace Elgg\SystemMessages; | ||
|
||
/** | ||
* Represents the state of system messages and errors. | ||
* | ||
* This is returned by elgg_get_system_messages() and must be given to elgg_set_system_messages(). | ||
* | ||
* @see elgg_get_system_messages | ||
* @see elgg_set_system_messages | ||
* @since 2.1 | ||
*/ | ||
class RegisterSet { | ||
|
||
/** | ||
* @var string[] Strings added via system_message() | ||
* | ||
* @note do not change this property name. It must match SystemMessagesService::SUCCESS | ||
*/ | ||
public $success = []; | ||
|
||
/** | ||
* @var string[] Strings added via register_error() | ||
* | ||
* @note do not change this property name. It must match SystemMessagesService::ERROR | ||
*/ | ||
public $error = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.