* Construct a resource manager
*
* @param CRM_Extension_Mapper $extMapper Map extension names to their base path or URLs.
+ * @param CRM_Utils_Cache_Interface $cache JS-localization cache
+ * @param string|null $cacheCodeKey Random code to append to resource URLs; changing the code forces clients to reload resources
*/
public function __construct($extMapper, $cache, $cacheCodeKey = NULL) {
$this->extMapper = $extMapper;
/**
* Add JavaScript variables to the global CRM object via a callback function.
*
- * @param $callable function
+ * @param callable $callable
* @return CRM_Core_Resources
*/
public function addSettingsFactory($callable) {
* @param $ext string, extension name; use 'civicrm' for core
* @param $file string, file path -- relative to the extension base dir
*
- * @return (string|bool), full file path or FALSE if not found
+ * @return bool|string (string|bool), full file path or FALSE if not found
*/
public function getPath($ext, $file) {
// TODO consider caching results
*
* @param $ext string, extension name; use 'civicrm' for core
* @param $file string, file path -- relative to the extension base dir
+ * @param bool $addCacheCode
+ *
* @return string, URL
*/
public function getUrl($ext, $file = NULL, $addCacheCode = FALSE) {
return $this->extMapper->keyToUrl($ext) . '/' . $file;
}
+ /**
+ * @return string
+ */
public function getCacheCode() {
return $this->cacheCode;
}
+ /**
+ * @param $value
+ */
public function setCacheCode($value) {
$this->cacheCode = $value;
if ($this->cacheCodeKey) {
* TODO: Separate the functional code (like addStyle/addScript) from the policy code
* (like addCoreResources/addCoreStyles).
*
+ * @param string $region
* @return CRM_Core_Resources
* @access public
*/
*/
function addLocalization(&$js) {
$config = CRM_Core_Config::singleton();
-
+
// Localize select2 strings
$contactSearch = json_encode($config->includeEmailInName ? ts('Start typing a name or email...') : ts('Start typing a name...'));
$otherSearch = json_encode(ts('Enter search term...'));
"packages/jquery/plugins/jquery.timeentry$min.js",
"packages/jquery/plugins/DataTables/media/js/jquery.dataTables$min.js",
+ "packages/jquery/plugins/DataTables/media/css/jquery.dataTables$min.css",
"packages/jquery/plugins/jquery.validate$min.js",
"packages/jquery/plugins/jquery.ui.datepicker.validation.pack.js",