Add on-demand loading of nlsconfig data.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 22 Dec 2010 08:38:37 +0000 (01:38 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 22 Dec 2010 18:05:03 +0000 (11:05 -0700)
Move nlsconfig manipulation code inside of this new object.

Cache nlsconfig info about the current language - only need to load
nls.php config file now if manipulating an entire config entry.

23 files changed:
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Config.php
framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php
framework/Core/lib/Horde/Core/Prefs/Ui/Widgets.php
framework/Core/lib/Horde/Core/Ui/Language.php
framework/Core/lib/Horde/Help.php
framework/Core/lib/Horde/Menu.php
framework/Core/lib/Horde/Registry.php
framework/Core/lib/Horde/Registry/Nlsconfig.php [new file with mode: 0644]
framework/Core/lib/Horde/Themes/Css.php
framework/Core/package.xml
horde/config/prefs.php.dist
horde/lib/Prefs/Ui.php
horde/login.php
horde/services/help/index.php
horde/services/sidebar.php
imp/compose.php
imp/config/prefs.php.dist
imp/lib/Prefs/Ui.php
imp/mailbox.php
imp/message.php
nag/lib/Task.php
turba/data.php

index 84a8634..86945d0 100644 (file)
@@ -1590,10 +1590,7 @@ HTML;
      */
     static public function stripAccessKey($label)
     {
-        $multibyte = isset($GLOBALS['registry']->nlsconfig['multibyte'][$GLOBALS['registry']->getLanguageCharset()]);
-        return preg_replace('/_([A-Za-z])/',
-                            $multibyte && preg_match('/[\x80-\xff]/', $label) ? '' : '\1',
-                            $label);
+        return preg_replace('/_([A-Za-z])/', $GLOBALS['registry']->nlsconfig->curr_multibyte && preg_match('/[\x80-\xff]/', $label) ? '' : '\1', $label);
     }
 
     /**
@@ -1613,11 +1610,12 @@ HTML;
             return $stripped_label;
         }
 
-        if (isset($GLOBALS['registry']->nlsconfig['multibyte'][$GLOBALS['registry']->getLanguageCharset()])) {
+        if ($GLOBALS['registry']->nlsconfig->curr_multibyte) {
             /* Prefix parenthesis with the UTF-8 representation of the LRO
              * (Left-to-Right-Override) Unicode codepoint U+202D. */
-            return $stripped_label . "\xe2\x80\xad" . '(<span class="accessKey">'
-                . strtoupper($accessKey) . '</span>' . ')';
+            return $stripped_label . "\xe2\x80\xad" .
+                '(<span class="accessKey">' . strtoupper($accessKey) .
+                '</span>' . ')';
         }
 
         return str_replace('_' . $accessKey, '<span class="accessKey">' . $accessKey . '</span>', $label);
index b540d75..f3c2499 100644 (file)
@@ -1600,7 +1600,7 @@ class Horde_Config
             return $apps;
 
         case 'list-horde-languages':
-            return array_map(create_function('$val', 'return preg_replace(array("/&#x([0-9a-f]{4});/ie", "/(&[^;]+;)/e"), array("Horde_String::convertCharset(pack(\"H*\", \"$1\"), \"ucs-2\", \"UTF-8\")", "Horde_String::convertCharset(html_entity_decode(\"$1\", ENT_COMPAT, \"iso-8859-1\"), \"iso-8859-1\", \"UTF-8\")"), $val);'), $GLOBALS['registry']->nlsconfig['languages']);
+            return array_map(create_function('$val', 'return preg_replace(array("/&#x([0-9a-f]{4});/ie", "/(&[^;]+;)/e"), array("Horde_String::convertCharset(pack(\"H*\", \"$1\"), \"ucs-2\", \"UTF-8\")", "Horde_String::convertCharset(html_entity_decode(\"$1\", ENT_COMPAT, \"iso-8859-1\"), \"iso-8859-1\", \"UTF-8\")"), $val);'), $GLOBALS['registry']->nlsconfig->languages);
 
         case 'list-blocks':
             $collection = Horde_Block_Collection::singleton();
index b72ccbf..fb4a5ba 100644 (file)
@@ -41,12 +41,12 @@ class Horde_Core_Ajax_Imple_SpellChecker extends Horde_Core_Ajax_Imple
         }
 
         if (empty($params['locales'])) {
-            $key_list = array_keys($GLOBALS['registry']->nlsconfig['spelling']);
+            $key_list = array_keys($GLOBALS['registry']->nlsconfig->spelling);
             asort($key_list, SORT_LOCALE_STRING);
             $params['locales'] = array();
 
             foreach ($key_list as $lcode) {
-                $params['locales'][] = array('l' => $GLOBALS['registry']->nlsconfig['languages'][$lcode], 'v' => $lcode);
+                $params['locales'][] = array('l' => $GLOBALS['registry']->nlsconfig->languages[$lcode], 'v' => $lcode);
             }
         }
 
index 74ac014..1c78371 100644 (file)
@@ -89,8 +89,8 @@ class Horde_Core_Prefs_Ui_Widgets
             ));
         }
 
-        $t->set('addimg', Horde::img(isset($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]) ? 'lhand.png' : 'rhand.png', Horde_Core_Translation::t("Add source")));
-        $t->set('removeimg', Horde::img(isset($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]) ? 'rhand.png' : 'lhand.png', Horde_Core_Translation::t("Remove source")));
+        $t->set('addimg', Horde::img($GLOBALS['registry']->nlsconfig->curr_rtl ? 'lhand.png' : 'rhand.png', Horde_Core_Translation::t("Add source")));
+        $t->set('removeimg', Horde::img($GLOBALS['registry']->nlsconfig->curr_rtl ? 'rhand.png' : 'lhand.png', Horde_Core_Translation::t("Remove source")));
 
         if (empty($data['no_up'])) {
             $t->set('upimg', Horde::img('nav/up.png', Horde_Core_Translation::t("Move up")));
index b7c0dae..9597c82 100644 (file)
@@ -35,7 +35,7 @@ class Horde_Core_Ui_Language {
                             Horde::url($registry->get('webroot', 'horde') . '/services/language.php', false, -1));
             $html .= '<input type="hidden" name="url" value="' . @htmlspecialchars(Horde::selfUrl(false, false, true)) . '" />';
             $html .= '<select name="new_lang" onchange="document.language.submit()">';
-            foreach ($registry->nlsconfig['languages'] as $key => $val) {
+            foreach ($registry->nlsconfig->languages as $key => $val) {
                 $sel = ($key == $session->get('horde', 'language')) ? ' selected="selected"' : '';
                 $html .= "<option value=\"$key\"$sel>$val</option>";
             }
index 9afd1c9..38c11c6 100644 (file)
@@ -48,8 +48,8 @@ class Horde_Help
             throw new Horde_Exception('SimpleXML not available.');
         }
 
-        if (isset($GLOBALS['registry']->nlsconfig['charsets'][$GLOBALS['language']])) {
-            $this->_charset = $GLOBALS['registry']->nlsconfig['charsets'][$GLOBALS['language']];
+        if ($charset = $GLOBALS['registry']->nlsconfig->curr_charset) {
+            $this->_charset = $charset;
         }
 
         switch ($source) {
index bd9a92c..e9083e5 100644 (file)
@@ -216,7 +216,7 @@ class Horde_Menu
 
         /* Sort to match explicitly set positions. */
         ksort($this->_menu);
-        if (!empty($registry->nlsconfig['rtl'][$GLOBALS['language']])) {
+        if ($registry->nlsconfig->curr_rtl) {
             $this->_menu = array_reverse($this->_menu);
         }
 
index 8a18e5e..827f7b7 100644 (file)
@@ -45,9 +45,9 @@ class Horde_Registry
     /**
      * NLS configuration.
      *
-     * @var array
+     * @var Horde_Registry_Nlsconfig
      */
-    public $nlsconfig = array();
+    public $nlsconfig;
 
     /**
      * Stack of in-use applications.
@@ -412,8 +412,8 @@ class Horde_Registry
         /* Always need to load applications information. */
         $this->_loadApplications();
 
-        /* Load the language configuration. */
-        $this->nlsconfig = Horde::loadConfiguration('nls.php', 'horde_nls_config', 'horde');
+        /* Initialize language configuration object. */
+        $this->nlsconfig = new Horde_Registry_Nlsconfig();
 
         /* Initialize the localization routines and variables. */
         $this->setLanguageEnvironment(null, 'horde');
@@ -494,6 +494,7 @@ class Horde_Registry
         $this->applications = $this->_apiList = $this->_confCache = $this->_interfaces = array();
         unset($this->_apis);
 
+        $GLOBALS['session']->remove('horde', 'nls/');
         $GLOBALS['session']->remove('horde', 'registry/');
         $this->_saveCache('apis');
         $this->_saveCache('app');
@@ -2128,9 +2129,9 @@ class Horde_Registry
      */
     public function getLanguageCharset()
     {
-        return empty($this->nlsconfig['charsets'][$GLOBALS['language']])
-            ? 'ISO-8859-1'
-            : $this->nlsconfig['charsets'][$GLOBALS['language']];
+        return ($charset = $this->nlsconfig->curr_charset)
+            ? $charset
+            : 'ISO-8859-1';
     }
 
     /**
@@ -2145,9 +2146,9 @@ class Horde_Registry
             return $charset;
         }
 
-        return isset($this->nlsconfig['emails'][$GLOBALS['language']])
-            ? $this->nlsconfig['emails'][$GLOBALS['language']]
-            : (isset($this->nlsconfig['charsets'][$GLOBALS['language']]) ? $this->nlsconfig['charsets'][$GLOBALS['language']] : 'ISO-8859-1');
+        return ($charset = $this->nlsconfig->curr_emails)
+            ? $charset
+            : $this->getLanguageCharset();
     }
 
     /**
@@ -2166,7 +2167,7 @@ class Horde_Registry
         }
 
         /* Check if the user selected a language from the login screen */
-        if (!empty($lang) && $this->isValidLang($lang)) {
+        if (!empty($lang) && $this->nlsconfig->validLang($lang)) {
             return basename($lang);
         }
 
@@ -2176,8 +2177,8 @@ class Horde_Registry
         }
 
         /* Use site-wide default, if one is defined */
-        if (!empty($this->nlsconfig['defaults']['language'])) {
-            return basename($this->nlsconfig['defaults']['language']);
+        if ($language = $this->nlsconfig->curr_default) {
+            return basename($this->nlsconfig->curr_default);
         }
 
         /* Try browser-accepted languages. */
@@ -2191,7 +2192,7 @@ class Horde_Registry
                 }
 
                 $lang = $this->_mapLang(trim($lang));
-                if ($this->isValidLang($lang)) {
+                if ($this->nlsconfig->validLang($lang)) {
                     $language = $lang;
                     break;
                 }
@@ -2200,11 +2201,11 @@ class Horde_Registry
                  * ll_LL, followed by just ll. */
                 if (!isset($partial_lang)) {
                     $ll_LL = Horde_String::lower(substr($lang, 0, 2)) . '_' . Horde_String::upper(substr($lang, 0, 2));
-                    if ($this->isValidLang($ll_LL)) {
+                    if ($this->nlsconfig->validLang($ll_LL)) {
                         $partial_lang = $ll_LL;
                     } else {
                         $ll = $this->_mapLang(substr($lang, 0, 2));
-                        if ($this->isValidLang($ll))  {
+                        if ($this->nlsconfig->validLang($ll))  {
                             $partial_lang = $ll;
                         }
                     }
@@ -2223,19 +2224,6 @@ class Horde_Registry
     }
 
     /**
-     * Determines whether the supplied language is valid.
-     *
-     * @param string $language  The abbreviated name of the language.
-     *
-     * @return boolean  True if the language is valid, false if it's not
-     *                  valid or unknown.
-     */
-    public function isValidLang($language)
-    {
-        return !empty($this->nlsconfig['languages'][$language]);
-    }
-
-    /**
      * Sets the language.
      *
      * @param string $lang  The language abbreviation.
@@ -2244,7 +2232,7 @@ class Horde_Registry
      */
     public function setLanguage($lang = null)
     {
-        if (empty($lang) || !$this->isValidLang($lang)) {
+        if (empty($lang) || !$this->nlsconfig->validLang($lang)) {
             $lang = $this->preferredLang();
         }
 
@@ -2343,8 +2331,8 @@ class Horde_Registry
             $trans_lang .= '_' . Horde_String::upper($lang_parts[1]);
         }
 
-        return empty($this->nlsconfig['aliases'][$trans_lang])
+        return empty($this->nlsconfig->aliases[$trans_lang])
             ? $trans_lang
-            : $this->nlsconfig['aliases'][$trans_lang];
+            : $this->nlsconfig->aliases[$trans_lang];
     }
 }
diff --git a/framework/Core/lib/Horde/Registry/Nlsconfig.php b/framework/Core/lib/Horde/Registry/Nlsconfig.php
new file mode 100644 (file)
index 0000000..605b23d
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+/**
+ * Interface to NLS configuration.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package  Core
+ */
+class Horde_Registry_Nlsconfig
+{
+    /**
+     * The cached configuration data.
+     *
+     * @var array
+     */
+    protected $_config;
+
+    /**
+     */
+    public function __get($name)
+    {
+        /* These entries can be cached in the session. */
+        $cached = array(
+            'curr_charset',
+            'curr_default',
+            'curr_emails',
+            'curr_multibyte',
+            'curr_rtl'
+        );
+
+        if (in_array($name, $cached) &&
+            $GLOBALS['session']->exists('horde', 'nls/' . $name)) {
+            return $GLOBALS['session']->get('horde', 'nls/' . $name);
+        }
+
+        if (!isset($this->_config)) {
+            $this->_config = Horde::loadConfiguration('nls.php', 'horde_nls_config', 'horde');
+        }
+
+        switch ($name) {
+        case 'aliases':
+        case 'charsets':
+        case 'encodings':
+        case 'emails':
+        case 'languages':
+        case 'multibyte':
+        case 'rtl':
+        case 'spelling':
+            $ret = isset($this->_config[$name])
+                ? $this->_config[$name]
+                : array();
+            break;
+
+        case 'charsets_sort':
+            $ret = $this->charsets;
+            natcasesort($ret);
+            break;
+
+        case 'curr_charset':
+            /* Return charset for the current language. */
+            $ret = isset($this->_config->charsets[$GLOBALS['language']])
+                ? $this->_config->charsets[$GLOBALS['language']]
+                : null;
+            break;
+
+        case 'curr_default':
+            /* The default langauge, as specified by the config file. */
+            $ret = isset($this->_config->defaults['language'])
+                ? $this->_config->defaults['language']
+                : null;
+            break;
+
+        case 'curr_emails':
+            /* Return e-mail charset for the current language. */
+            $ret = isset($this->_config->emails[$GLOBALS['language']])
+                ? $this->_config->emails[$GLOBALS['language']]
+                : null;
+            break;
+
+        case 'curr_multibyte':
+            /* Is the current language charset multibyte? */
+            $ret = isset($this->_config['multibyte'][$GLOBALS['registry']->getLanguageCharset()]);
+            break;
+
+        case 'curr_rtl':
+            /* Is the current language RTL? */
+            $ret = isset($this->_config['rtl'][$GLOBALS['language']]);
+            break;
+
+        case 'encodings_sort':
+            $ret = $this->encodings;
+            asort($ret);
+            break;
+
+        default:
+            $ret = null;
+            break;
+        }
+
+        if (in_array($name, $cached)) {
+            $GLOBALS['session']->set('horde', 'nls/' . $name, $ret);
+        }
+
+        return $ret;
+    }
+
+    /**
+     * Check whether a language string is valid.
+     *
+     * @param string $lang  The language to check.
+     *
+     * @return boolean  Whether the language is valid.
+     */
+    public function validLang($lang)
+    {
+        if (!$GLOBALS['session']->exists('horde', 'nls/valid_' . $lang)) {
+            $GLOBALS['session']->set('horde', 'nls/valid_' . $lang, isset($this->languages[$lang]));
+        }
+
+        return $GLOBALS['session']->get('horde', 'nls/valid_' . $lang);
+    }
+
+}
index 2e1c3aa..6f7caf0 100644 (file)
@@ -244,7 +244,7 @@ class Horde_Themes_Css
     {
         $css_list = array('screen.css');
 
-        if (isset($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']])) {
+        if ($GLOBALS['registry']->nlsconfig->curr_rtl) {
             $css_list[] = 'rtl.css';
         }
 
index c287923..54fde1a 100644 (file)
@@ -255,6 +255,7 @@ Application Framework.</description>
       <file name="Api.php" role="php" />
       <file name="Application.php" role="php" />
       <file name="Caller.php" role="php" />
+      <file name="Nlsconfig.php" role="php" />
      </dir> <!-- /lib/Horde/Registry -->
      <dir name="Script">
       <file name="Files.php" role="php" />
@@ -855,6 +856,7 @@ Application Framework.</description>
    <install as="Horde/Registry/Api.php" name="lib/Horde/Registry/Api.php" />
    <install as="Horde/Registry/Application.php" name="lib/Horde/Registry/Application.php" />
    <install as="Horde/Registry/Caller.php" name="lib/Horde/Registry/Caller.php" />
+   <install as="Horde/Registry/Nlsconfig.php" name="lib/Horde/Registry/Nlsconfig.php" />
    <install as="Horde/Script/Files.php" name="lib/Horde/Script/Files.php" />
    <install as="Horde/Themes/Cache.php" name="lib/Horde/Themes/Cache.php" />
    <install as="Horde/Themes/Css.php" name="lib/Horde/Themes/Css.php" />
index 634f9e0..9b83d3b 100644 (file)
@@ -324,7 +324,7 @@ $_prefs['sending_charset'] = array(
     'type' => 'enum',
     'enum' => array_merge(
         array('' => _("Default")),
-        $GLOBALS['registry']->nlsconfig['encodings']
+        $GLOBALS['registry']->nlsconfig->encodings_sort
     ),
     'desc' => _("Default charset for sending e-mail messages:")
 );
index 2d5fa65..2467036 100644 (file)
@@ -45,7 +45,7 @@ class Horde_Prefs_Ui
 
         case 'language':
             if (!$prefs->isLocked('language')) {
-                $ui->override['language'] = $registry->nlsconfig['languages'];
+                $ui->override['language'] = $registry->nlsconfig->languages;
                 array_unshift($ui->override['language'], _("Default"));
             }
 
@@ -53,10 +53,6 @@ class Horde_Prefs_Ui
                 $ui->override['timezone'] = Horde_Nls::getTimezones();
                 array_unshift($ui->override['timezone'], _("Default"));
             }
-
-            if (!$prefs->isLocked('sending_charset')) {
-                asort($registry->nlsconfig['encodings']);
-            }
             break;
 
         case 'remote':
index 7fcad92..b0aa226 100644 (file)
@@ -256,7 +256,7 @@ if (!empty($conf['auth']['alternate_login'])) {
 /* Build the <select> widget containing the available languages. */
 if (!$is_auth && !$prefs->isLocked('language')) {
     $langs = array();
-    foreach ($registry->nlsconfig['languages'] as $key => $val) {
+    foreach ($registry->nlsconfig->languages as $key => $val) {
         $langs[] = array(
             'sel' => ($key == $GLOBALS['language']),
             'val' => $key,
index ad7f7e3..194c3d3 100644 (file)
@@ -13,7 +13,7 @@ Horde_Registry::appInit('horde', array('authentication' => 'none'));
 
 $vars = Horde_Variables::getDefaultVariables();
 
-$rtl = isset($registry->nlsconfig['rtl'][$language]);
+$rtl = $registry->nlsconfig->curr_rtl;
 $title = _("Help");
 $show = isset($vars->show)
     ? Horde_String::lower($vars->show)
index 6d76801..15bfbdc 100644 (file)
@@ -31,7 +31,7 @@ if (!Horde_Util::getFormData('ajaxui') &&
     $ajax_url = Horde::getServiceLink('ajax', 'horde');
     $ajax_url->pathInfo = 'sidebarUpdate';
 
-    $rtl = intval(isset($registry->nlsconfig['rtl'][$language]));
+    $rtl = intval($registry->nlsconfig->curr_rtl);
     $show_sidebar = !isset($_COOKIE['horde_sidebar_expanded']) || $_COOKIE['horde_sidebar_expanded'];
     $width = intval($prefs->getValue('sidebar_width'));
 
index c3f674c..a1ba198 100644 (file)
@@ -822,8 +822,9 @@ if ($redirect) {
         $t->set('charset_label', Horde::label('charset', _("C_harset")));
         $t->set('charset_tabindex', ++$tabindex);
         $charset_array = array();
-        asort($registry->nlsconfig['encodings']);
-        foreach (array_merge(array('' => _("Default")), $registry->nlsconfig['encodings']) as $encoding => $label) {
+        $enc_list = $registry->nslconfig->encodings;
+        asort($enc_list);
+        foreach (array_merge(array('' => _("Default")), $enc_list) as $encoding => $label) {
             $charset_array[] = array(
                 'label' => $label,
                 'selected' => (strcasecmp($encoding, $charset) === 0),
index bb4d5cf..6f08dd4 100644 (file)
@@ -823,15 +823,16 @@ $_prefs['mail_hdr'] = array(
 );
 
 // default message character set
+
 $_prefs['default_msg_charset'] = array(
-    'value' => isset($GLOBALS['registry']->nlsconfig['emails'][$GLOBALS['language']])
-        ? $GLOBALS['registry']->nlsconfig['emails'][$GLOBALS['language']]
-        : (isset($GLOBALS['registry']->nlsconfig['charsets'][$GLOBALS['language']])
-            ? $GLOBALS['registry']->nlsconfig['charsets'][$GLOBALS['language']]
+    'value' => $GLOBALS['registry']->getEmailCharset()
+        ? $GLOBALS['registry']->getEmailCharset()
+        : ($GLOBALS['registry']->getLanguageCharset()
+            ? $GLOBALS['registry']->getLanguageCharset()
             : ''),
     'type' => 'enum',
     'enum' => array_merge(
-        array('' => _("Default (US-ASCII)")), $GLOBALS['registry']->nlsconfig['encodings']
+        array('' => _("Default (US-ASCII)")), $GLOBALS['registry']->nlsconfig->encodings_sort
     ),
     'desc' => _("The default charset for messages with no charset information:"),
     'help' => 'prefs-default_msg_charset'
index 9b17a5a..49748b0 100644 (file)
@@ -128,13 +128,6 @@ class IMP_Prefs_Ui
                 $ui->nobuttons = true;
             }
             break;
-
-        case 'viewing':
-            /* Sort encodings. */
-            if (!$prefs->isLocked('default_msg_charset')) {
-                asort($registry->nlsconfig['encodings']);
-            }
-            break;
         }
 
         /* Hide appropriate prefGroups. */
index 8064450..4dd4cd3 100644 (file)
@@ -268,7 +268,7 @@ if ($readonly) {
 
 /* Generate paging links. */
 if ($pageOb['pagecount']) {
-    $rtl = !empty($registry->nlsconfig['rtl'][$language]);
+    $rtl = $registry->nlsconfig->curr_rtl;
     if ($pageOb['page'] == 1) {
         $pages_first = Horde::img($rtl ? 'nav/last-grey.png' : 'nav/first-grey.png');
         $pages_prev = Horde::img($rtl ? 'nav/right-grey.png' : 'nav/left-grey.png');
index 4c0fcfc..3975c44 100644 (file)
@@ -482,7 +482,7 @@ if (!$use_pop) {
 
 $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($registry->nlsconfig['rtl'][$language]);
+$rtl = $registry->nlsconfig->curr_rtl;
 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 ? '>' : '<'));
index 96b888c..bdbc3b9 100644 (file)
@@ -552,9 +552,9 @@ class Nag_Task {
         }
         if ($this->indent) {
             if ($this->lastChild) {
-                $html .= Horde::img(empty($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]) ? 'tree/joinbottom.png' : 'tree/rev-joinbottom.png', '\\');
+                $html .= Horde::img($GLOBALS['registry']->nlsconfig->curr_rtl ? 'tree/joinbottom.png' : 'tree/rev-joinbottom.png', '\\');
             } else {
-                $html .= Horde::img(empty($GLOBALS['registry']->nlsconfig['rtl'][$GLOBALS['language']]) ? 'tree/join.png' : 'tree/rev-join.png', '+');
+                $html .= Horde::img($GLOBALS['registry']->nlsconfig->curr_rtl ? 'tree/join.png' : 'tree/rev-join.png', '+');
             }
         }
 
index a8cc04e..7810402 100644 (file)
@@ -542,11 +542,8 @@ if ($next_step == Horde_Data::IMPORT_FILE) {
     }
 
     /* Build the charset options. */
-    $charsets = $registry->nlsconfig['encodings'];
-    asort($charsets);
-    $all_charsets = $registry->nlsconfig['charsets'];
-    natcasesort($all_charsets);
-    foreach ($all_charsets as $charset) {
+    $charsets = $registry->nlsconfig->encodings_sort;
+    foreach ($registry->nlsconfig->charsets as $charset) {
         if (!isset($charsets[$charset])) {
             $charsets[$charset] = $charset;
         }