Move loading of js_config to templatelayout

Also check for installed flag because this isn't available before setup
remotes/origin/stable5
Bart Visscher 12 years ago
parent e969a78cf9
commit 149d079fd4
  1. 1
      core/templates/layout.base.php
  2. 1
      core/templates/layout.guest.php
  3. 1
      core/templates/layout.user.php
  4. 3
      lib/templatelayout.php

@ -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; ?>

@ -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; ?>

@ -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; ?>

@ -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));
}

Loading…
Cancel
Save