Skip to content

Commit

Permalink
crmMosaico.ang.php - Reinstate quirky filter
Browse files Browse the repository at this point in the history
The implementation of `hook_angularModules` had a funny guard at the top, and it becomes
inoperative when switching to `ang-php` mixin. This reinstates the filter.
  • Loading branch information
totten committed May 21, 2022
1 parent ee2d680 commit a449c02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
5 changes: 5 additions & 0 deletions ang/crmMosaico.ang.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// in CiviCRM. See also:
// http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules

$canRead = Civi::service('civi_api_kernel')->runAuthorize('MosaicoTemplate', 'get', ['version' => 3, 'check_permissions' => 1]);
if (!$canRead) {
return [];
}

$result = [
'requires' => ['crmUi', 'crmUtil', 'ngRoute', 'crmMailing', 'crmDialog'],
'js' =>
Expand Down
18 changes: 0 additions & 18 deletions mosaico.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,6 @@ function mosaico_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
return _mosaico_civix_civicrm_upgrade($op, $queue);
}

/**
* Implements hook_civicrm_angularModules().
*
* Generate a list of Angular modules.
*
* Note: This hook only runs in CiviCRM 4.5+. It may
* use features only available in v4.6+.
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_caseTypes
*/
function mosaico_civicrm_angularModules(&$angularModules) {
$canRead = Civi::service('civi_api_kernel')->runAuthorize(
'MosaicoTemplate', 'get', ['version' => 3, 'check_permissions' => 1]);
if (!$canRead) {
return;
}
}

function mosaico_civicrm_alterAngular(\Civi\Angular\Manager $angular) {
$changeSet = \Civi\Angular\ChangeSet::create('mosaico_subject_list')
->alterHtml('~/crmMailing/BlockMailing.html', function (phpQueryObject $doc) {
Expand Down

0 comments on commit a449c02

Please sign in to comment.