From edcd29747692ff1ffbec927b9f31ac239c5e192d Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 7 Sep 2012 16:42:46 +0200 Subject: [PATCH] Move handling of core remotes to OC_TemplateLayout --- core/templates/layout.base.php | 6 ------ core/templates/layout.guest.php | 6 ------ core/templates/layout.user.php | 6 ------ lib/app.php | 5 ----- lib/templatelayout.php | 12 +++++++++++- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index bfd23a9ce97..c113a4db24e 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -4,9 +4,6 @@ ownCloud - - - @@ -14,9 +11,6 @@ var oc_webroot = ''; var oc_appswebroots = ; - - - diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 9a5a056eb2b..0d2e71c180f 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -4,9 +4,6 @@ ownCloud - - - @@ -14,9 +11,6 @@ var oc_webroot = ''; var oc_appswebroots = ; - - - diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 89b8027fc0f..4fa0fd01360 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -4,9 +4,6 @@ <?php echo isset($_['application']) && !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud <?php echo OC_User::getUser()?' ('.OC_User::getUser().') ':'' ?> - - - @@ -15,9 +12,6 @@ var oc_appswebroots = ; var oc_current_user = ''; - - - diff --git a/lib/app.php b/lib/app.php index f1e4f965efd..28f1f16ebaf 100755 --- a/lib/app.php +++ b/lib/app.php @@ -69,11 +69,6 @@ class OC_App{ OC_Util::$scripts = array(); OC_Util::$core_styles = OC_Util::$styles; OC_Util::$styles = array(); - - if (!OC_AppConfig::getValue('core', 'remote_core.css', false)) { - OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php'); - OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php'); - } } } // return diff --git a/lib/templatelayout.php b/lib/templatelayout.php index ad013edad8c..d72f5552fde 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -41,9 +41,17 @@ class OC_TemplateLayout extends OC_Template { } $this->assign( 'apps_paths', str_replace('\\/', '/',json_encode($apps_paths)),false ); // Ugly unescape slashes waiting for better solution + if (!OC_AppConfig::getValue('core', 'remote_core.css', false)) { + OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php'); + OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php'); + } + // Add the js files $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); + if (!empty(OC_Util::$core_scripts)) { + $this->append( 'jsfiles', OC_Helper::linkToRemote('core.js', false)); + } foreach($jsfiles as $info) { $root = $info[0]; $web = $info[1]; @@ -53,8 +61,10 @@ class OC_TemplateLayout extends OC_Template { // Add the css files $cssfiles = self::findStylesheetFiles(OC_Util::$styles); - $this->assign('cssfiles', array()); + if (!empty(OC_Util::$core_styles)) { + $this->append( 'cssfiles', OC_Helper::linkToRemote('core.css', false)); + } foreach($cssfiles as $info) { $root = $info[0]; $web = $info[1];