No more global $nls variable.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Jul 2009 08:15:32 +0000 (02:15 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Jul 2009 08:15:32 +0000 (02:15 -0600)
babel/lib/Babel.php
babel/lib/Translate.php
babel/lib/api.php
babel/lib/base.php
babel/stats.php
babel/view.php
fima/data.php
imp/compose.php
imp/login.php
imp/mailbox.php
imp/message.php

index cee2459..52125f2 100644 (file)
@@ -29,13 +29,13 @@ class Babel {
     }
     
     function displayLanguage() {
-       global $nls, $lang, $app;
+       global $lang, $app;
        
-       if (!isset($nls['languages'][$lang])) {
+       if (!isset(Horde_Nls::$config['languages'][$lang])) {
            return;
        }
        
-       $res = sprintf(_("Language: %s (%s)"), $nls['languages'][$lang], $lang);
+       $res = sprintf(_("Language: %s (%s)"), Horde_Nls::$config['languages'][$lang], $lang);
        if ($app) {
            $res .= '&nbsp; | &nbsp; ' . sprintf(_("Module: %s"), $app);
        }
@@ -82,7 +82,7 @@ class Babel {
     }
     
     function LanguageSelection() {
-       global $nls, $app;
+       global $app;
        
        $html = '';
        $html .= '<span style="float:right">';
@@ -91,7 +91,7 @@ class Babel {
        $html .= '<input type="hidden" name="module" value="' . $app . '">';
        $html .= '<select name="display_language" onchange="languageSubmit()">';
        
-       $tests =  $nls['languages'];
+       $tests =  Horde_Nls::$config['languages'];
        
        // Unset English
        unset($tests['en_US']);
index 5845e17..a5336c7 100644 (file)
@@ -19,7 +19,7 @@ class Translate {
     }
     
     function stats($app, $filter_lang = false) {
-       global $nls, $module, $apps, $dirs, $lang;
+       global $module, $apps, $dirs, $lang;
        
        $report = array();
        $dir = Translate::getPath($app);
@@ -33,7 +33,7 @@ class Translate {
                    continue;
                }
                
-               if (!isset($nls['languages'][$locale]) || $locale == 'en_US') {
+               if (!isset(Horde_Nls::$config['languages'][$locale]) || $locale == 'en_US') {
                    continue; 
                }
                $i++;
index 58a2a52..5a5be33 100644 (file)
@@ -20,7 +20,7 @@ $_services['perms'] = array(
 function _babel_perms()
 {
 
-    global $nls, $registry;
+    global $registry;
     
     static $perms = array();
     if (!empty($perms)) {
@@ -31,7 +31,7 @@ function _babel_perms()
     $perms['title']['babel:language'] = _("Languages");
     $perms['type']['babel:language']  = 'none';
     
-    foreach($nls['languages'] as $langcode => $langdesc) {
+    foreach(Horde_Nls::$config['languages'] as $langcode => $langdesc) {
        $perms['tree']['babel']['language'][$langcode] = false;
        $perms['title']['babel:language:' . $langcode] = sprintf("%s (%s)", $langdesc, $langcode);
        $perms['type']['babel:language:' . $langcode] = 'boolean';
index ed5a7b2..008024f 100644 (file)
@@ -71,7 +71,7 @@ if (($lang = Horde_Util::getFormData('display_language')) !== null) {
     $lang = $_SESSION['babel']['language'];
 } else {
     
-    $tests =  $nls['languages'];
+    $tests =  Horde_Nls::$config['languages'];
     
     // Unset English
     unset($tests['en_US']);
index 08c9a53..fa05f01 100644 (file)
@@ -98,7 +98,7 @@ if (!$app) {
            } else {
                echo "\n<tr class=\"item" . ($i++ % 2) . "\">";
            }
-           echo "\n\t<td>" . $nls['languages'][$key] . "</td>";
+           echo "\n\t<td>" . Horde_Nls::$config['languages'][$key] . "</td>";
            echo "\n\t<td>" . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('view.php'), array('display_language' => $key, 'module' => $_app))) . $key . '</a>' . "</td>";
            echo "\n\t<td>" . Translate_Display::create_bargraph($value[2], $value[0]) . "</td>";
            echo "\n\t<td>" . $value[2] . "</td>";
index 3ed8e6a..ae87ca0 100644 (file)
@@ -201,7 +201,7 @@ if (!$app) {
     echo '</tr>';
 
     echo "\n<tr class=\"item" . ($i++ % 2) . "\">";
-    echo "\n\t<td>" . $nls['languages'][$lang] . "</td>";
+    echo "\n\t<td>" . Horde_Nls::$config['languages'][$lang] . "</td>";
     echo "\n\t<td>" . $lang . "</td>";
     echo "\n\t<td>" . Translate_Display::create_bargraph(@$report[$lang][2], @$report[$lang][0]) . "</td>";
     echo "\n\t<td>" . @$report[$lang][2] . "</td>";
index 5a6127d..5ada39b 100644 (file)
@@ -216,8 +216,8 @@ require FIMA_TEMPLATES . '/menu.inc';
 
 if ($next_step == IMPORT_FILE) {
     /* Build the charset options. */
-    $charsets = $nls['encodings'];
-    $all_charsets = $nls['charsets'];
+    $charsets = Horde_Nls::$config['encodings'];
+    $all_charsets = Horde_Nls::$config['charsets'];
     natcasesort($all_charsets);
     foreach ($all_charsets as $charset) {
         if (!isset($charsets[$charset])) {
index 7cbde34..0bee148 100644 (file)
@@ -1013,7 +1013,7 @@ if ($redirect) {
         $t->set('charset_label', Horde::label('charset', _("C_harset")));
         $t->set('charset_tabindex', ++$tabindex);
         $charset_array = array();
-        foreach ($nls['encodings'] as $charset => $label) {
+        foreach (Horde_Nls::$config['encodings'] as $charset => $label) {
             $charset_array[] = array('value' => $charset, 'selected' => (strtolower($charset) == strtolower($encoding)), 'label' => $label);
         }
         $t->set('charset_array', $charset_array);
index cb90d4e..f87cf0a 100644 (file)
@@ -174,7 +174,7 @@ $choose_language = ($imp_auth && !$prefs->isLocked('language'));
 if ($choose_language) {
     $_SESSION['horde_language'] = Horde_Nls::select();
     $langs = array();
-    foreach ($nls['languages'] as $key => $val) {
+    foreach (Horde_Nls::$config['languages'] as $key => $val) {
         $langs[] = array(
             'sel' => ($key == $_SESSION['horde_language']),
             'val' => $key,
index 5fd7d86..09c991a 100644 (file)
@@ -290,7 +290,7 @@ if (!empty($pageOb['end'])) {
 
 /* Generate paging links. */
 if ($pageOb['pagecount']) {
-    $rtl = !empty($nls['rtl'][$language]);
+    $rtl = !empty(Horde_Nls::$config['rtl'][$language]);
     if ($pageOb['page'] == 1) {
         $pages_first = Horde::img($rtl ? 'nav/last-grey.png' : 'nav/first-grey.png', null, null, $graphicsdir);
         $pages_prev = Horde::img($rtl ? 'nav/right-grey.png' : 'nav/left-grey.png', null, null, $graphicsdir);
index b71c3a6..1f977d9 100644 (file)
@@ -457,7 +457,7 @@ if (!IMP::$printMode) {
 
     $n_template->set('back_to', Horde::widget($mailbox_url, sprintf(_("Back to %s"), $h_page_label), 'widget', '', '', sprintf(_("Bac_k to %s"), $h_page_label), true));
 
-    $rtl = !empty($nls['rtl'][$language]);
+    $rtl = !empty(Horde_Nls::$config['rtl'][$language]);
     if (Horde_Util::nonInputVar('prev_url')) {
         $n_template->set('prev', Horde::link($prev_url, _("Previous Message")));
         $n_template->set('prev_img', Horde::img($rtl ? 'nav/right.png' : 'nav/left.png', $rtl ? '>' : '<', '', $registry->getImageDir('horde')));