Skip to content

Commit

Permalink
Declare "mosaico_graphics" setting
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Nov 20, 2018
1 parent 9e2e55e commit 8b31163
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CRM/Mosaico/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ public static function getLayoutOptions() {
);
}

/**
* Get a list of graphics handling options.
*
* @return array
* Array (string $machineName => string $label).
*/
public static function getGraphicsOptions() {
return [
'auto' => E::ts('Automatically select a driver'),
'iv-gd' => E::ts('Intervention Image API (gd)'),
'iv-imagick' => E::ts('Intervention Image API (imagick)'),
'imagick' => E::ts('(Deprecated) Direct ImageMagick API'),
];
}

/**
* Get the path to the Mosaico layout file.
*
Expand Down
21 changes: 21 additions & 0 deletions settings/Mosaico.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@
'description' => NULL,
'help_text' => NULL,
),
'mosaico_graphics' => array(
'group_name' => 'Mosaico Preferences',
'group' => 'mosaico',
'name' => 'mosaico_graphics',
'quick_form_type' => 'Select',
'type' => 'String',
'html_type' => 'select',
'html_attributes' => array(
'class' => 'crm-select2',
),
'pseudoconstant' => array(
'callback' => 'CRM_Mosaico_Utils::getGraphicsOptions',
),
'default' => 'auto',
'add' => '4.7',
'title' => 'Mosaico graphics driver',
'is_domain' => 1,
'is_contact' => 0,
'description' => NULL,
'help_text' => NULL,
),
'mosaico_custom_templates_dir' => array(
'group_name' => 'Mosaico Preferences',
'group' => 'mosaico',
Expand Down

0 comments on commit 8b31163

Please sign in to comment.