From 7f0a3018b6a965ce569b8dc3a14aeb0c00c8e06b Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Sat, 26 Jan 2013 13:46:00 +0100 Subject: Fix undefined variable --- core/js/config.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core/js/config.php') diff --git a/core/js/config.php b/core/js/config.php index e838fb1cd04..9069175ed6f 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -17,11 +17,15 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); $l = OC_L10N::get('core'); // Get the config -$debug = (defined('DEBUG') && DEBUG) ? 'true' : 'false'; +$apps_paths = array(); +foreach(OC_App::getEnabledApps() as $app) { + $apps_paths[$app] = OC_App::getAppWebPath($app); +} + $array = array( - "oc_debug" => $debug, + "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', "oc_webroot" => "\"".OC::$WEBROOT."\"", - "oc_appswebroots" => "\"".$_['apps_paths']. "\"", + "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(). "\"", "datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')), -- cgit v1.2.3