From: Bart Visscher Date: Fri, 7 Sep 2012 14:42:46 +0000 (+0200) Subject: Move handling of core remotes to OC_TemplateLayout X-Git-Tag: v4.5.0beta3~8^2~48 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=edcd29747692ff1ffbec927b9f31ac239c5e192d;p=nextcloud-server.git Move handling of core remotes to OC_TemplateLayout --- 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];