diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-09-07 16:42:46 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-09-07 16:42:46 +0200 |
commit | edcd29747692ff1ffbec927b9f31ac239c5e192d (patch) | |
tree | b22e6c708c676413b4c6048e0378dfeae2b450f0 | |
parent | 631df21de640183623e626409903a0a1f7b0105d (diff) | |
download | nextcloud-server-edcd29747692ff1ffbec927b9f31ac239c5e192d.tar.gz nextcloud-server-edcd29747692ff1ffbec927b9f31ac239c5e192d.zip |
Move handling of core remotes to OC_TemplateLayout
-rw-r--r-- | core/templates/layout.base.php | 6 | ||||
-rw-r--r-- | core/templates/layout.guest.php | 6 | ||||
-rw-r--r-- | core/templates/layout.user.php | 6 | ||||
-rwxr-xr-x | lib/app.php | 5 | ||||
-rw-r--r-- | 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 @@ <title>ownCloud</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> - <?php if (!empty(OC_Util::$core_styles)): ?> - <link rel="stylesheet" href="<?php echo OC_Helper::linkToRemote('core.css', false) ?>" type="text/css" media="screen" /> - <?php endif ?> <?php foreach ($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> @@ -14,9 +11,6 @@ var oc_webroot = '<?php echo OC::$WEBROOT; ?>'; var oc_appswebroots = <?php echo $_['apps_paths'] ?>; </script> - <?php if (!empty(OC_Util::$core_scripts)): ?> - <script type="text/javascript" src="<?php echo OC_Helper::linkToRemote('core.js', false) ?>"></script> - <?php endif ?> <?php foreach ($_['jsfiles'] as $jsfile): ?> <script type="text/javascript" src="<?php echo $jsfile; ?>"></script> <?php endforeach; ?> 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 @@ <title>ownCloud</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> - <?php if (!empty(OC_Util::$core_styles)): ?> - <link rel="stylesheet" href="<?php echo OC_Helper::linkToRemote('core.css', false) ?>" type="text/css" media="screen" /> - <?php endif ?> <?php foreach($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> @@ -14,9 +11,6 @@ var oc_webroot = '<?php echo OC::$WEBROOT; ?>'; var oc_appswebroots = <?php echo $_['apps_paths'] ?>; </script> - <?php if (!empty(OC_Util::$core_scripts)): ?> - <script type="text/javascript" src="<?php echo OC_Helper::linkToRemote('core.js', false) ?>"></script> - <?php endif ?> <?php foreach($_['jsfiles'] as $jsfile): ?> <script type="text/javascript" src="<?php echo $jsfile; ?>"></script> <?php endforeach; ?> 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 @@ <title><?php echo isset($_['application']) && !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud <?php echo OC_User::getUser()?' ('.OC_User::getUser().') ':'' ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> - <?php if (!empty(OC_Util::$core_styles)): ?> - <link rel="stylesheet" href="<?php echo OC_Helper::linkToRemote('core.css', false) ?>" type="text/css" media="screen" /> - <?php endif ?> <?php foreach($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> @@ -15,9 +12,6 @@ var oc_appswebroots = <?php echo $_['apps_paths'] ?>; var oc_current_user = '<?php echo OC_User::getUser() ?>'; </script> - <?php if (!empty(OC_Util::$core_scripts)): ?> - <script type="text/javascript" src="<?php echo OC_Helper::linkToRemote('core.js', false) ?>"></script> - <?php endif ?> <?php foreach($_['jsfiles'] as $jsfile): ?> <script type="text/javascript" src="<?php echo $jsfile; ?>"></script> <?php endforeach; ?> 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]; |