]> source.dussan.org Git - nextcloud-server.git/commitdiff
Get config from template
authorLukas Reschke <lukas@statuscode.ch>
Sat, 11 May 2013 19:07:05 +0000 (21:07 +0200)
committerMorris Jobke <morris.jobke@gmail.com>
Sun, 12 May 2013 08:51:21 +0000 (10:51 +0200)
core/js/config.php
core/templates/layout.user.php
lib/templatelayout.php

index 0aaa44822876b339d4b47c73ad8f6145069b6d0e..8a377c2da1a12e04de4353b47709afa868fae67e 100644 (file)
@@ -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
index 4dc4a2c7593e42c4af4aabb2afcb0c8d6ccf1e46..6e49149b0ae43491542c34336590bb989f92c3a2 100644 (file)
@@ -5,7 +5,7 @@
 <!--[if IE 9]><html class="ng-csp ie ie9 lte9"><![endif]-->
 <!--[if gt IE 9]><html class="ng-csp ie"><![endif]-->
 <!--[if !IE]><!--><html class="ng-csp"><!--<![endif]-->
-       <head>
+       <head data-user="<?php p($_['user_uid']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>">
                <title><?php p(!empty($_['application'])?$_['application'].' | ':'') ?>ownCloud
                        <?php p(trim($_['user_displayname']) != '' ?' ('.$_['user_displayname'].') ':'') ?></title>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
index d385bb7f19d8bd5ce3dee70a05ea0228a377be7b..7115b8f03063092de620bf3646a72c7abde0ac8b 100644 (file)
@@ -56,7 +56,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);