Making title-params no longer required.

In theory, a notification could not need any contextual information
so there's no reason we should make it required.

Now, if the title-params are not provided in the notifcation
definition, it just sets the value to an empty array.

Change-Id: Iba5ce5cc56010101c5e64976c95b37a215dc99fa
This commit is contained in:
kaldari 2013-08-01 17:52:47 -07:00
parent 5d30ae9e6b
commit 2f6591febe

View file

@ -41,8 +41,7 @@ class EchoBasicFormatter extends EchoNotificationFormatter {
* @param array
*/
protected $requiredParameters = array (
'title-message',
'title-params'
'title-message'
);
/**
@ -57,15 +56,15 @@ class EchoBasicFormatter extends EchoNotificationFormatter {
public function __construct( $params ) {
parent::__construct( $params );
// Set up default params if any are missing
$params += $this->getDefaultParams();
// Title for archive page
$this->title = array(
'message' => $params['title-message'],
'params' => $params['title-params']
);
// Set up default params if one is missing
$params += $this->getDefaultParams();
// Title for the flyout
$this->flyoutTitle = array(
'message' => $params['flyout-message'],
@ -108,6 +107,7 @@ class EchoBasicFormatter extends EchoNotificationFormatter {
*/
protected function getDefaultParams() {
return array(
'title-params' => array(),
'flyout-message' => $this->title['message'],
'flyout-params' => $this->title['params'],
'bundle-message' => '',