* Currently supports: api3 or href
* @param array $params
* Params to be passed to CRM.api3 or CRM.url depending on type
+ * Ex: ['MyApiEntity', 'MyApiAction', [...params...]]
+ * Ex: ['path' => 'civicrm/admin/foo', 'query' => 'reset=1']
+ * Ex: ['url' => 'https://example.com/more/info']
* @param string $icon
* Fa-icon class for the button
*/
function run() {
switch (action.type) {
case 'href':
- window.location = CRM.url(action.params.path, action.params.query, action.params.mode);
+ window.location = action.params.url ? action.params.url : CRM.url(action.params.path, action.params.query, action.params.mode);
break;
case 'api3':