assign_by_ref('hookContent', $html); $this->assign('hookContentPlacement', $contentPlacement); } $this->assign('communityMessages', $this->getCommunityMessageOutput()); $loader = Civi::service('angularjs.loader'); $loader->addModules('crmDashboard'); $loader->setPageName('civicrm/dashboard'); // For each dashlet that requires an angular directive, load the angular module which provides that directive foreach (CRM_Core_BAO_Dashboard::getContactDashlets() as $dashlet) { if (!empty($dashlet['directive'])) { foreach ($loader->getAngular()->getModules() as $name => $module) { if (!empty($module['exports'][$dashlet['directive']])) { $loader->addModules($name); continue; } } } } return parent::run(); } /** * partialsCallback from crmDashboard.ang.php * * Generates an html template for each angular-based dashlet. * * @param $moduleName * @param $module * @return array */ public static function angularPartials($moduleName, $module) { $partials = []; foreach (CRM_Core_BAO_Dashboard::getContactDashlets() as $dashlet) { if (!empty($dashlet['directive'])) { // FIXME: Wrapping each directive in