* @method static setHttpHeader(string $name, string $value) Set http header.
* @method static array synchronizeUsers() Create CRM contacts for all existing CMS users.
* @method static appendCoreResources(\Civi\Core\Event\GenericHookEvent $e) Callback for hook_civicrm_coreResourceList.
+ * @method static alterAssetUrl(\Civi\Core\Event\GenericHookEvent $e) Callback for hook_civicrm_getAssetUrl.
*/
class CRM_Utils_System {
public function appendCoreResources(\Civi\Core\Event\GenericHookEvent $e) {
}
+ /**
+ * Modify dynamic assets.
+ *
+ * @param \Civi\Core\Event\GenericHookEvent $e
+ */
+ public function alterAssetUrl(\Civi\Core\Event\GenericHookEvent $e) {
+ }
+
/**
* @param string $name
* @param string $value
$e->list[] = 'js/crm.wordpress.js';
}
+ /**
+ * @inheritDoc
+ */
+ public function alterAssetUrl(\Civi\Core\Event\GenericHookEvent $e) {
+ // Set menubar breakpoint to match WP admin theme
+ if ($e->asset == 'crm-menubar.css') {
+ $e->params['breakpoint'] = 783;
+ }
+ }
+
/**
* @inheritDoc
*/
$dispatcher->addListener('hook_civicrm_buildAsset', ['\CRM_Utils_VisualBundle', 'buildAssetCss']);
$dispatcher->addListener('hook_civicrm_buildAsset', ['\CRM_Core_Resources', 'renderMenubarStylesheet']);
$dispatcher->addListener('hook_civicrm_coreResourceList', ['\CRM_Utils_System', 'appendCoreResources']);
+ $dispatcher->addListener('hook_civicrm_getAssetUrl', ['\CRM_Utils_System', 'alterAssetUrl']);
$dispatcher->addListener('civi.dao.postInsert', ['\CRM_Core_BAO_RecurringEntity', 'triggerInsert']);
$dispatcher->addListener('civi.dao.postUpdate', ['\CRM_Core_BAO_RecurringEntity', 'triggerUpdate']);
$dispatcher->addListener('civi.dao.postDelete', ['\CRM_Core_BAO_RecurringEntity', 'triggerDelete']);