X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FMailing%2FForm%2FComponent.php;h=256057482abb97b07fcd5af372212d975405f3bb;hb=8ea180b7e15f28bc58a8cffa5378fb6337cb955c;hp=14f70362e8e5fd42f693989ad6a1be16b490e2c8;hpb=39dfb3109e293c4d596a66e6590a1ed7650bd37e;p=civicrm-core.git diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index 14f70362e8..256057482a 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -69,7 +69,10 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'name'), TRUE ); - $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Mailing_DAO_Component', $this->_id)); + $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array( + 'CRM_Mailing_DAO_Component', + $this->_id + )); $this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents()); @@ -155,8 +158,8 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { * @param $files * @param $options * - * @return mixed true or array of errors - * @static + * @return bool|array + * mixed true or array of errors */ public static function dataRule($params, $files, $options) { if ($params['component_type'] == 'Header' || $params['component_type'] == 'Footer') { @@ -167,20 +170,24 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { } $errors = array(); foreach (array( - 'text', 'html') as $type) { + 'text', + 'html' + ) as $type) { $dataErrors = array(); foreach ($InvalidTokens as $token => $desc) { if ($params['body_' . $type]) { if (preg_match('/' . preg_quote('{' . $token . '}') . '/', $params['body_' . $type])) { $dataErrors[] = '
  • ' . ts('This message is having a invalid token - %1: %2', array( - 1 => $token, - 2 => $desc)) . '
  • '; + 1 => $token, + 2 => $desc + )) . ''; } } } if (!empty($dataErrors)) { $errors['body_' . $type] = ts('The following errors were detected in %1 message:', array( - 1 => $type)) . '
    ' . ts('More information on tokens...') . ''; + 1 => $type + )) . '
    ' . ts('More information on tokens...') . ''; } }