Merge pull request #22193 from eileenmcnaughton/smarty18
[civicrm-core.git] / ext / eventcart / eventcart.php
index 41a32d244919e814ed7f90722e74f415d5d95359..d160a35861ac025fc27bed03f88d736a8e50f91e 100644 (file)
@@ -11,16 +11,16 @@ use CRM_Eventcart_ExtensionUtil as E;
  * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config/
  */
 function eventcart_civicrm_config(&$config) {
-  _eventcart_civix_civicrm_config($config);
-}
+  if (isset(Civi::$statics[__FUNCTION__])) {
+    return;
+  }
+  Civi::$statics[__FUNCTION__] = 1;
+  // Since as a hidden extension it's always enabled, until this is a "real" extension you can turn off we need to check the legacy setting.
+  if ((bool) Civi::settings()->get('enable_cart')) {
+    Civi::dispatcher()->addListener('hook_civicrm_pageRun', 'CRM_Event_Cart_PageCallback::run');
+  }
 
-/**
- * Implements hook_civicrm_xmlMenu().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_xmlMenu
- */
-function eventcart_civicrm_xmlMenu(&$files) {
-  _eventcart_civix_civicrm_xmlMenu($files);
+  _eventcart_civix_civicrm_config($config);
 }
 
 /**
@@ -77,54 +77,6 @@ function eventcart_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
   return _eventcart_civix_civicrm_upgrade($op, $queue);
 }
 
-/**
- * Implements hook_civicrm_managed().
- *
- * Generate a list of entities to create/deactivate/delete when this module
- * is installed, disabled, uninstalled.
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed
- */
-function eventcart_civicrm_managed(&$entities) {
-  _eventcart_civix_civicrm_managed($entities);
-}
-
-/**
- * Implements hook_civicrm_caseTypes().
- *
- * Generate a list of case-types.
- *
- * Note: This hook only runs in CiviCRM 4.4+.
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_caseTypes
- */
-function eventcart_civicrm_caseTypes(&$caseTypes) {
-  _eventcart_civix_civicrm_caseTypes($caseTypes);
-}
-
-/**
- * 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 https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules
- */
-function eventcart_civicrm_angularModules(&$angularModules) {
-  _eventcart_civix_civicrm_angularModules($angularModules);
-}
-
-/**
- * Implements hook_civicrm_alterSettingsFolders().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterSettingsFolders
- */
-function eventcart_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
-  _eventcart_civix_civicrm_alterSettingsFolders($metaDataFolders);
-}
-
 /**
  * Implements hook_civicrm_entityTypes().
  *
@@ -135,38 +87,3 @@ function eventcart_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
 function eventcart_civicrm_entityTypes(&$entityTypes) {
   _eventcart_civix_civicrm_entityTypes($entityTypes);
 }
-
-/**
- * Implements hook_civicrm_thems().
- */
-function eventcart_civicrm_themes(&$themes) {
-  _eventcart_civix_civicrm_themes($themes);
-}
-
-// --- Functions below this ship commented out. Uncomment as required. ---
-
-/**
- * Implements hook_civicrm_preProcess().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_preProcess
- */
-//function eventcart_civicrm_preProcess($formName, &$form) {
-//
-//}
-
-/**
- * Implements hook_civicrm_navigationMenu().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_navigationMenu
- */
-//function eventcart_civicrm_navigationMenu(&$menu) {
-//  _eventcart_civix_insert_navigation_menu($menu, 'Mailings', array(
-//    'label' => E::ts('New subliminal message'),
-//    'name' => 'mailing_subliminal_message',
-//    'url' => 'civicrm/mailing/subliminal',
-//    'permission' => 'access CiviMail',
-//    'operator' => 'OR',
-//    'separator' => 0,
-//  ));
-//  _eventcart_civix_navigationMenu($menu);
-//}