class OC_TemplateLayout extends OC_Template {
+ private static $versionHash = '';
+
/**
* @param string $renderas
* @param string $appid application id
parent::__construct('core', 'layout.base');
}
- $versionParameter = '?v=' . md5(implode(OC_Util::getVersion()));
+ if(empty(self::$versionHash)) {
+ self::$versionHash = md5(implode(',', OC_App::getAppVersions()));
+ }
+
$useAssetPipeline = $this->isAssetPipelineEnabled();
if ($useAssetPipeline) {
-
- $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter);
-
+ $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config', array('v' => self::$versionHash)));
$this->generateAssets();
-
} else {
-
// Add the js files
$jsfiles = self::findJavascriptFiles(OC_Util::$scripts);
$this->assign('jsfiles', array(), false);
if (OC_Config::getValue('installed', false) && $renderas!='error') {
- $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter);
+ $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config', array('v' => self::$versionHash)));
}
foreach($jsfiles as $info) {
$web = $info[1];
$file = $info[2];
- $this->append( 'jsfiles', $web.'/'.$file . $versionParameter);
+ $this->append( 'jsfiles', $web.'/'.$file . '?v=' . self::$versionHash);
}
// Add the css files
$web = $info[1];
$file = $info[2];
- $this->append( 'cssfiles', $web.'/'.$file . $versionParameter);
+ $this->append( 'cssfiles', $web.'/'.$file . '?v=' . self::$versionHash);
}
}
}