*/
static function addJqueryFiles(&$html) {
CRM_Core_Resources::singleton()->addCoreResources('html-header');
- if (!defined('CIVICRM_UF_HEAD')) {
- return CRM_Core_Region::instance('html-header')->render('', FALSE) . $html;
- } else {
- return $html;
- }
+ return CRM_Core_Region::instance('html-header')->render('', FALSE) . $html;
}
/**
return $result;
}
+ /**
+ * Examples:
+ * "admin foo" => array(NULL,"admin foo")
+ * "cms:admin foo" => array("cms", "admin foo")
+ *
+ * @param string $string e.g. "view all contacts". Syntax: "[prefix:]name"
+ * @return array (0 => string|NULL $prefix, 1 => string $value)
+ */
+ public static function parsePrefix($delim, $string, $defaultPrefix = NULL) {
+ $pos = strpos($string, $delim);
+ if ($pos === FALSE) {
+ return array($defaultPrefix, $string);
+ }
+ else {
+ return array(substr($string, 0, $pos), substr($string, 1+$pos));
+ }
+ }
+
+
}