From 9a53d50e169a797f95c16cb75aa1bcafd7513c76 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Sun, 12 May 2013 02:40:30 -0700 Subject: [PATCH] Merge pull request #3290 from owncloud/config-data Move config data to template --- core/js/config.php | 6 +++--- core/templates/layout.user.php | 2 +- lib/templatelayout.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/js/config.php b/core/js/config.php index 0aaa4482287..48bea6ae542 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -26,8 +26,8 @@ $array = array( "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', "oc_webroot" => "\"".OC::$WEBROOT."\"", "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution - "oc_current_user" => "\"".OC_User::getUser(). "\"", - "oc_requesttoken" => "\"".OC_Util::callRegister(). "\"", + "oc_current_user" => "document.head.getAttribute('data-user')", + "oc_requesttoken" => "document.head.getAttribute('data-requesttoken')", "datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')), "dayNames" => json_encode( array( @@ -62,4 +62,4 @@ $array = array( // Echo it foreach ($array as $setting => $value) { echo("var ". $setting ."=".$value.";\n"); -} +} \ No newline at end of file diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 0bab2bb43a7..6a8e221cbd3 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -5,7 +5,7 @@ - + <?php p(!empty($_['application'])?$_['application'].' | ':'') ?>ownCloud <?php p(trim($_['user_displayname']) != '' ?' ('.$_['user_displayname'].') ':'') ?> diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 981e67f628e..30eec820c9f 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -42,7 +42,7 @@ class OC_TemplateLayout extends OC_Template { $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); if (OC_Config::getValue('installed', false) && $renderas!='error') { - $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config')); + $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter); } if (!empty(OC_Util::$core_scripts)) { $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false) . $versionParameter); -- 2.39.5