Move loading of js_config to templatelayout

Also check for installed flag because this isn't available before setup
This commit is contained in:
Bart Visscher 2013-02-07 08:09:53 +01:00
parent e969a78cf9
commit 149d079fd4
4 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,6 @@
<?php foreach ($_['cssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
<?php endforeach; ?>
<script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('js_config');?>"></script>
<?php foreach ($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
<?php endforeach; ?>

View File

@ -8,7 +8,6 @@
<?php foreach($_['cssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
<?php endforeach; ?>
<script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('js_config');?>"></script>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
<?php endforeach; ?>

View File

@ -8,7 +8,6 @@
<?php foreach($_['cssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
<?php endforeach; ?>
<script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('js_config');?>"></script>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
<?php endforeach; ?>

View File

@ -36,6 +36,9 @@ class OC_TemplateLayout extends OC_Template {
// Add the js files
$jsfiles = self::findJavascriptFiles(OC_Util::$scripts);
$this->assign('jsfiles', array(), false);
if (OC_Config::getValue('installed', false)) {
$this->append( 'jsfiles', OC_Helper::linkToRoute('js_config'));
}
if (!empty(OC_Util::$core_scripts)) {
$this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false));
}