From 82c7598861db175617694891bb9f21b426426225 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sun, 18 Sep 2011 19:37:54 +0200 Subject: Remove global vars and use the OC static version. Removed global vars are DOCUMENTROOT, SERVERROOT, SUBURI, WEBROOT and CONFIG_DATADIRECTORY --- lib/l10n.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'lib/l10n.php') diff --git a/lib/l10n.php b/lib/l10n.php index c0c32185996..54331d44ae4 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -57,7 +57,6 @@ class OC_L10N{ * language. */ public function __construct($app, $lang = null){ - global $SERVERROOT; // Find the right language if(is_null($lang)){ $lang = self::findLanguage($app); @@ -81,9 +80,9 @@ class OC_L10N{ } } - if(file_exists($SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')){ + if(file_exists(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')){ // Include the file, save the data from $CONFIG - include($SERVERROOT.'/core/l10n/l10n-'.$lang.'.php'); + include(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php'); if(isset($LOCALIZATIONS) && is_array($LOCALIZATIONS)){ $this->localizations = array_merge($this->localizations, $LOCALIZATIONS); } @@ -224,17 +223,15 @@ class OC_L10N{ * @returns directory */ protected static function findI18nDir($app){ - global $SERVERROOT; - // find the i18n dir - $i18ndir = $SERVERROOT.'/core/l10n/'; + $i18ndir = OC::$SERVERROOT.'/core/l10n/'; if($app != ''){ // Check if the app is in the app folder - if(file_exists($SERVERROOT.'/apps/'.$app.'/l10n/')){ - $i18ndir = $SERVERROOT.'/apps/'.$app.'/l10n/'; + if(file_exists(OC::$SERVERROOT.'/apps/'.$app.'/l10n/')){ + $i18ndir = OC::$SERVERROOT.'/apps/'.$app.'/l10n/'; } else{ - $i18ndir = $SERVERROOT.'/'.$app.'/l10n/'; + $i18ndir = OC::$SERVERROOT.'/'.$app.'/l10n/'; } } return $i18ndir; -- cgit v1.2.3