+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
/**
/**
* Default component id's, indexed by component type
+ * @var array
*/
private static $defaultComponent;
*/
public static function abStatus() {
if (!is_array(self::$abStatus)) {
- self::$abStatus = array(
+ self::$abStatus = [
'Draft' => ts('Draft'),
'Testing' => ts('Testing'),
'Final' => ts('Final'),
- );
+ ];
}
return self::$abStatus;
}
*/
public static function abTestCriteria() {
if (!is_array(self::$abTestCriteria)) {
- self::$abTestCriteria = array(
+ self::$abTestCriteria = [
'subject' => ts('Test different "Subject" lines'),
'from' => ts('Test different "From" lines'),
'full_email' => ts('Test entirely different emails'),
- );
+ ];
}
return self::$abTestCriteria;
}
*/
public static function abWinnerCriteria() {
if (!is_array(self::$abWinnerCriteria)) {
- self::$abWinnerCriteria = array(
+ self::$abWinnerCriteria = [
'open' => ts('Open'),
'unique_click' => ts('Total Unique Clicks'),
'link_click' => ts('Total Clicks on a particular link'),
- );
+ ];
}
return self::$abWinnerCriteria;
}
*/
public static function mailingTypes() {
if (!is_array(self::$mailingTypes)) {
- self::$mailingTypes = array(
+ self::$mailingTypes = [
'standalone' => ts('Standalone'),
'experiment' => ts('Experimental'),
'winner' => ts('Winner'),
- );
+ ];
}
return self::$mailingTypes;
}
if (!self::$component || !array_key_exists($name, self::$component)) {
if (!self::$component) {
- self::$component = array();
+ self::$component = [];
}
if (!$type) {
self::$component[$name] = NULL;
- CRM_Core_PseudoConstant::populate(self::$component[$name], 'CRM_Mailing_DAO_Component');
+ CRM_Core_PseudoConstant::populate(self::$component[$name], 'CRM_Mailing_BAO_MailingComponent');
}
else {
// we need to add an additional filter for $type
- self::$component[$name] = array();
+ self::$component[$name] = [];
- $object = new CRM_Mailing_DAO_Component();
+ $object = new CRM_Mailing_BAO_MailingComponent();
$object->component_type = $type;
$object->selectAdd();
$object->selectAdd("id, name");
$dao = CRM_Core_DAO::executeQuery($queryDefaultComponents);
- self::$defaultComponent = array();
+ self::$defaultComponent = [];
while ($dao->fetch()) {
self::$defaultComponent[$dao->component_type] = $dao->id;
}
public static function &yesNoOptions($field) {
static $options;
if (!$options) {
- $options = array(
- 'bounce' => array(
+ $options = [
+ 'bounce' => [
'N' => ts('Successful '),
'Y' => ts('Bounced '),
- ),
- 'delivered' => array(
+ ],
+ 'delivered' => [
'Y' => ts('Successful '),
'N' => ts('Bounced '),
- ),
- 'open' => array(
+ ],
+ 'open' => [
'Y' => ts('Opened '),
'N' => ts('Unopened/Hidden '),
- ),
- 'click' => array(
+ ],
+ 'click' => [
'Y' => ts('Clicked '),
'N' => ts('Not Clicked '),
- ),
- 'reply' => array(
+ ],
+ 'reply' => [
'Y' => ts('Replied '),
'N' => ts('No Reply '),
- ),
- );
+ ],
+ ];
}
return $options[$field];
}