diff options
author | Bart Visscher <bart@thisnet.nl> | 2011-09-18 19:37:54 +0200 |
---|---|---|
committer | Bart Visscher <bart@thisnet.nl> | 2011-09-18 19:37:54 +0200 |
commit | 82c7598861db175617694891bb9f21b426426225 (patch) | |
tree | fce8fb4717b4cc2a5dc6da8835bdb51b5fb40054 /lib/l10n.php | |
parent | d5656716f69caa6a1eb98706994ffcb9a08553a7 (diff) | |
download | nextcloud-server-82c7598861db175617694891bb9f21b426426225.tar.gz nextcloud-server-82c7598861db175617694891bb9f21b426426225.zip |
Remove global vars and use the OC static version.
Removed global vars are DOCUMENTROOT, SERVERROOT, SUBURI, WEBROOT and CONFIG_DATADIRECTORY
Diffstat (limited to 'lib/l10n.php')
-rw-r--r-- | lib/l10n.php | 15 |
1 files changed, 6 insertions, 9 deletions
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; |