Skip to content

Commit

Permalink
(NFC) CRM-19690 - Improve code-style and docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Jan 5, 2017
1 parent 8f03c76 commit 7d0815d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions CRM/Mailing/BAO/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down Expand Up @@ -3249,6 +3252,8 @@ public static function getTemplateTypes() {
}

/**
* Get a list of template types.
*
* @return array
* Array(string $name => string $label).
*/
Expand Down
2 changes: 1 addition & 1 deletion api/v3/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7d0815d

Please sign in to comment.