From fb84048288817bf6c9b4bd7260939bd983f2d397 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 fd76fa8537..5915f6a63e 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -3198,11 +3198,14 @@ AND m.id = %1 } /** + * 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'])) { @@ -3233,6 +3236,8 @@ AND m.id = %1 } /** + * 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 35d3f2fb4c..765fc275b0 100644 --- 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. -- 2.25.1