From 7d0815da3211100c5de54a13e37e7de930b2404c Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 19 Dec 2016 19:00:40 -0800 Subject: [PATCH] (NFC) CRM-19690 - Improve code-style and docblocks --- CRM/Mailing/BAO/Mailing.php | 9 +++++++-- api/v3/Mailing.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 150d34cbc235..18f1efeca5b5 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -3214,11 +3214,14 @@ public static function getPublicViewUrl($id, $absolute = TRUE) { } /** + * Get a list of template types which can be used as `civicrm_mailing.template_type`. + * * @return array - * A list of template-types, keyed by name. Each defines: + * A list of template-types, keyed numerically. Each defines: + * - name: string, a short symbolic name * - editorUrl: string, Angular template name * - * Ex: $templateTypes['mosaico']['editorUrl'] = '~/crmMosaico/editor.html'. + * Ex: $templateTypes[0] === array('name' => 'mosaico', 'editorUrl' => '~/crmMosaico/editor.html'). */ public static function getTemplateTypes() { if (!isset(Civi::$statics[__CLASS__]['templateTypes'])) { @@ -3249,6 +3252,8 @@ public static function getTemplateTypes() { } /** + * Get a list of template types. + * * @return array * Array(string $name => string $label). */ diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index 605763fa94e2..cd633c26964c 100755 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -44,7 +44,7 @@ */ function civicrm_api3_mailing_create($params) { if (isset($params['template_options']) && is_array($params['template_options'])) { - $params['template_options'] = $params['template_options'] === array() ? '{}' : json_encode($params['template_options']); + $params['template_options'] = ($params['template_options'] === array()) ? '{}' : json_encode($params['template_options']); } if (CRM_Mailing_Info::workflowEnabled()) { // Note: 'schedule mailings' and 'approve mailings' can update certain fields, but can't create.