CRM-14106 - Regex targeting the first part of if statements
[civicrm-core.git] / CRM / Core / Component.php
index f10fe34c973a33be54798ec2d96d070315632491..1bb5569b0ffce6c17603c2a26a2b5c4e4e13bab2 100644 (file)
@@ -99,6 +99,10 @@ class CRM_Core_Component {
     return self::_info($force);
   }
 
+  static public function flushEnabledComponents() {
+    self::getEnabledComponents(TRUE);
+  }
+
   public static function &getNames($translated = FALSE) {
     $allComponents = self::getComponents();
 
@@ -130,10 +134,10 @@ class CRM_Core_Component {
           // also set the smarty variables to the current component
           $template = CRM_Core_Smarty::singleton();
           $template->assign('activeComponent', $name);
-          if (CRM_Utils_Array::value('formTpl', $comp->info[$name])) {
+          if (!empty($comp->info[$name]['formTpl'])) {
             $template->assign('formTpl', $comp->info[$name]['formTpl']);
           }
-          if (CRM_Utils_Array::value('css', $comp->info[$name])) {
+          if (!empty($comp->info[$name]['css'])) {
             $styleSheets = '<style type="text/css">@import url(' . "{$config->resourceBase}css/{$comp->info[$name]['css']});</style>";
             CRM_Utils_System::addHTMLHead($styleSheet);
           }
@@ -275,17 +279,6 @@ class CRM_Core_Component {
     }
   }
 
-  static function &addShowHide(&$showHide) {
-    $info = self::_info();
-
-    foreach ($info as $name => $comp) {
-      if ($comp->usesSearch()) {
-        $bqr = $comp->getBAOQueryObject();
-        $bqr->addShowHide($showHide);
-      }
-    }
-  }
-
   static function searchAction(&$row, $id) {
     $info = self::_info();
 
@@ -320,7 +313,7 @@ class CRM_Core_Component {
 
     $tasks = array();
     foreach ($info as $name => $value) {
-      if (CRM_Utils_Array::value('task', $info[$name])) {
+      if (!empty($info[$name]['task'])) {
         $tasks += $info[$name]['task'];
       }
     }