Ticket #9124: Remove horde/Core dependency from horde/Nls.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 13 Jul 2010 19:45:58 +0000 (13:45 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 14 Jul 2010 04:31:10 +0000 (22:31 -0600)
Move all of the Horde_Nls:: code dependent on Horde configuration to
horde/Core.  A core dependency has thus manifested itself in a bunch of
framework libraries thought to be horde/Core free (since getCharset() is
dependent on the local Horde configuration).

The following functions have been moved to registry:
Horde_Nls::config -> Horde_Registry::$nlsconfig
Horde_Nls::select() -> Horde_Registry::preferredLang()
Horde_Nls::setLanguage() -> Horde_Registry::setLanguage()
Horde_Nls::setTextdomain() -> Horde_Registry::setTextdomain()
Horde_Nls::setLanguageEnvironment() ->
Horde_Registry::setLanguageEnvironment()
Horde_Nls::isValid() -> Horde_Registry::isValidLang()
Horde_Nls::getCharset() -> Horde_Registry::getCharset()
Horde_Nls::getExternalCharset() -> Horde_Registry::getExternalCharset()
Horde_Nls::getEmailCharset() -> Horde_Registry::getEmailCharset()
Horde_Nls::setCharset() -> Horde_Registry::setCharset()
Horde_Nls::setCharsetEnvironment() ->
Horde_Registry::setCharsetEnvironment()
Horde_Nls::setTimeZone() -> Horde_Registry::setTimeZone()

Horde_Nls::generateFlagImageByHost() ->
Horde_Ui_FlagImage::generateFlagImageByHost()

Horde_Registry::initApp() now accepts the boolean 'timezone' parameter,
which will set the timezone if true.

349 files changed:
agora/lib/Agora.php
agora/lib/Messages.php
agora/lib/View.php
agora/messages/abuse.php
agora/rss/index.php
agora/rss/messages.php
agora/rss/threads.php
agora/templates/common-header.inc
ansel/gallery/sort.php
ansel/img/ecard.php
ansel/lib/Ansel.php
ansel/lib/Block/gallery.php
ansel/lib/Block/my_galleries.php
ansel/lib/Block/recent_comments.php
ansel/lib/Block/recent_faces.php
ansel/lib/Block/recently_added.php
ansel/lib/Block/recently_added_geodata.php
ansel/lib/GalleryMode/Date.php
ansel/lib/Image.php
ansel/lib/Storage.php
ansel/lib/Tags.php
ansel/lib/Tile/DateGallery.php
ansel/lib/Tile/Gallery.php
ansel/lib/View/Base.php
ansel/lib/Widget/Links.php
ansel/rss.php
ansel/scripts/recursive_import.php
ansel/templates/captions/captions.inc
ansel/templates/common-header.inc
ansel/templates/faces/gallery.inc
ansel/templates/gallery/gallery.inc
ansel/templates/image/crop_image.inc
ansel/templates/image/edit_image.inc
ansel/templates/image/preview_cropimage.inc
ansel/templates/image/preview_image.inc
ansel/templates/image/resize_image.inc
ansel/templates/list/header.inc
ansel/templates/view/results.inc
ansel/templates/xppublish/new.inc
babel/lib/Display.php
babel/templates/common-header.inc
chora/annotate.php
chora/browsedir.php
chora/cvsgraph.php
chora/diff.php
chora/history.php
chora/lib/Chora.php
chora/stats.php
chora/templates/common-header.inc
crumb/templates/common-header.inc
drag_n_drop_portal/block.php
drag_n_drop_portal/lib/Block/Layout/View/js.php
fima/data.php
fima/lib/Driver/sql.php
fima/lib/base.php
fima/templates/common-header.inc
folks/config/hooks.php.dist
folks/lib/Folks.php
folks/lib/Notification/mail.php
folks/scripts/mail-filter.php
folks/scripts/mail.php
folks/templates/common-header.inc
folks/templates/feed/activities.php
folks/templates/feed/feed.php
framework/Ajax/lib/Horde/Ajax/Imple/SpellChecker.php
framework/Alarm/lib/Horde/Alarm/Sql.php
framework/Auth/lib/Horde/Auth/Cyrsql.php
framework/Auth/lib/Horde/Auth/Cyrus.php
framework/Auth/lib/Horde/Auth/Imap.php
framework/Block/lib/Horde/Block/Layout/Manager.php
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Config.php
framework/Core/lib/Horde/Core/Auth/Signup/Base.php
framework/Core/lib/Horde/Core/Autoloader/Callback/Nls.php [new file with mode: 0644]
framework/Core/lib/Horde/Core/Binder/Alarm.php
framework/Core/lib/Horde/Core/Prefs/Ui.php
framework/Core/lib/Horde/Core/Prefs/Ui/Widgets.php
framework/Core/lib/Horde/Registry.php
framework/Core/package.xml
framework/Crypt/lib/Horde/Crypt/Pgp.php
framework/Crypt/lib/Horde/Crypt/Smime.php
framework/Crypt/test/Horde/Crypt/bug_6601.phpt
framework/Crypt/test/Horde/Crypt/pgp_verify.phpt
framework/Data/lib/Horde/Data/Csv.php
framework/DataTree/DataTree/sql.php
framework/Form/Form/Renderer.php
framework/Group/lib/Horde/Group/Kolab.php
framework/Group/lib/Horde/Group/Ldap.php
framework/Kolab/Kolab.php
framework/Kolab_Filter/lib/Horde/Kolab/Filter/Base.php
framework/Kolab_Format/examples/Horde/Kolab/Format/event.php
framework/Kolab_Format/examples/Horde/Kolab/Format/new_type.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/ContactTest.php
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/EventTest.php
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/MimeAttrTest.php
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/PreferencesTest.php
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php
framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Namespace.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Base.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/Class/Driver/CclientTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/Class/Driver/ImapTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/Class/Driver/MockTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/Class/Driver/PearTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/FolderTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/NamespaceTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/Server/DriverTest.php
framework/Mime/lib/Horde/Mime.php
framework/Mime/lib/Horde/Mime/Mdn.php
framework/Mime/lib/Horde/Mime/Viewer/Css.php
framework/Mime/lib/Horde/Mime/Viewer/Deb.php
framework/Mime/lib/Horde/Mime/Viewer/Enriched.php
framework/Mime/lib/Horde/Mime/Viewer/Enscript.php
framework/Mime/lib/Horde/Mime/Viewer/Html.php
framework/Mime/lib/Horde/Mime/Viewer/Msexcel.php
framework/Mime/lib/Horde/Mime/Viewer/Mspowerpoint.php
framework/Mime/lib/Horde/Mime/Viewer/Msword.php
framework/Mime/lib/Horde/Mime/Viewer/Php.php
framework/Mime/lib/Horde/Mime/Viewer/Plain.php
framework/Mime/lib/Horde/Mime/Viewer/Rar.php
framework/Mime/lib/Horde/Mime/Viewer/Rfc822.php
framework/Mime/lib/Horde/Mime/Viewer/Richtext.php
framework/Mime/lib/Horde/Mime/Viewer/Rpm.php
framework/Mime/lib/Horde/Mime/Viewer/Rtf.php
framework/Mime/lib/Horde/Mime/Viewer/Smil.php
framework/Mime/lib/Horde/Mime/Viewer/Srchighlite.php
framework/Mime/lib/Horde/Mime/Viewer/Tgz.php
framework/Mime/lib/Horde/Mime/Viewer/Tnef.php
framework/Mime/lib/Horde/Mime/Viewer/Vcard.php
framework/Mime/lib/Horde/Mime/Viewer/Webcpp.php
framework/Mime/lib/Horde/Mime/Viewer/Wordperfect.php
framework/Mime/lib/Horde/Mime/Viewer/Zip.php
framework/Model/lib/Horde/Form/Renderer/Xhtml.php
framework/Model/lib/Horde/Form/VarRenderer/Xhtml.php
framework/Nls/lib/Horde/Nls.php
framework/Nls/package.xml
framework/Notification/lib/Horde/Notification/Event/Status.php
framework/Notification/test/Horde/Notification/Class/Notification/Event/StatusTest.php
framework/Prefs/lib/Horde/Prefs.php
framework/Prefs/lib/Horde/Prefs/Identity.php
framework/Rampage/scripts/Horde/Rampage/rampage.php
framework/Rpc/lib/Horde/Rpc/Jsonrpc.php
framework/Rpc/lib/Horde/Rpc/Soap.php
framework/Rpc/lib/Horde/Rpc/Webdav.php
framework/Share/lib/Horde/Share/Sql.php
framework/SpellChecker/lib/Horde/SpellChecker/Aspell.php
framework/SyncML/SyncML/Backend/Horde.php
framework/SyncML/tests/testsync.php
framework/Tree/lib/Horde/Tree/Javascript.php
framework/Ui/lib/Horde/Ui/FlagImage.php [new file with mode: 0644]
framework/Ui/lib/Horde/Ui/JsCalendar.php
framework/Ui/lib/Horde/Ui/Language.php
framework/Ui/lib/Horde/Ui/VarRenderer.php
framework/Ui/package.xml
framework/iCalendar/iCalendar.php
gollem/templates/common-header.inc
gollem/templates/javascript_defs.php
hermes/start.php
hermes/templates/common-header.inc
horde/admin/sessions.php
horde/admin/setup/config.php
horde/admin/setup/scripts.php
horde/admin/sqlshell.php
horde/config/hooks.php.dist
horde/config/nls.php
horde/lib/Block/sunrise.php
horde/lib/Block/time.php
horde/lib/Block/twitter_timeline.php
horde/lib/Prefs/Ui.php
horde/login.php
horde/scripts/upgrades/convert_datatree_groups_to_sql.php
horde/services/language.php
horde/services/portal/index.php
horde/services/portal/sidebar.php
horde/services/problem.php
horde/services/resetpassword.php
horde/services/twitter.php
horde/templates/admin/groups/edit.inc
horde/templates/common-header.inc
hylax/templates/common-header.inc
imp/attachment.php
imp/compose-dimp.php
imp/compose-mimp.php
imp/compose.php
imp/config/prefs.php.dist
imp/contacts.php
imp/folders.php
imp/lib/Ajax/Application.php
imp/lib/Ajax/Imple/ContactAutoCompleter.php
imp/lib/Block/Newmail.php
imp/lib/Compose.php
imp/lib/Contents.php
imp/lib/Crypt/Pgp.php
imp/lib/Crypt/Smime.php
imp/lib/Folder.php
imp/lib/IMP.php
imp/lib/Imap/Flags.php
imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php
imp/lib/LoginTasks/Task/RenameSentmailMonthly.php
imp/lib/Message.php
imp/lib/Mime/Viewer/Alternative.php
imp/lib/Mime/Viewer/Appledouble.php
imp/lib/Mime/Viewer/Html.php
imp/lib/Mime/Viewer/Images.php
imp/lib/Mime/Viewer/Itip.php
imp/lib/Mime/Viewer/Mdn.php
imp/lib/Mime/Viewer/Partial.php
imp/lib/Mime/Viewer/Pdf.php
imp/lib/Mime/Viewer/Pgp.php
imp/lib/Mime/Viewer/Plain.php
imp/lib/Mime/Viewer/Smime.php
imp/lib/Mime/Viewer/Status.php
imp/lib/Mime/Viewer/Tnef.php
imp/lib/Prefs/Ui.php
imp/lib/Spam.php
imp/lib/Ui/Compose.php
imp/lib/Ui/Mailbox.php
imp/lib/Views/ListMessages.php
imp/lib/Views/ShowMessage.php
imp/mailbox-mimp.php
imp/mailbox.php
imp/message-mimp.php
imp/message.php
imp/rss.php
imp/search-basic.php
imp/search.php
imp/templates/common-header.inc
imp/templates/dimp/javascript_defs_dimp.php
imp/templates/imp/javascript_defs.php
imp/thread.php
imp/view.php
ingo/filters.php
ingo/lib/Ingo.php
ingo/lib/Script.php
ingo/lib/Storage/Filters/Sql.php
ingo/lib/Storage/Prefs.php
ingo/lib/Storage/Sql.php
ingo/rule.php
ingo/templates/common-header.inc
ingo/templates/rule/header.inc
jeta/templates/common-header.inc
jonah/delivery/rss.php
jonah/lib/Block/latest.php
jonah/lib/Block/news.php
jonah/lib/Block/news_popular.php
jonah/lib/Block/story.php
jonah/lib/Driver.php
jonah/lib/Driver/Sql.php
jonah/lib/News.php
jonah/lib/News/sql.php
jonah/stories/share.php
jonah/templates/common-header.inc
kastalia/templates/common-header.inc
koward/lib/Koward/View/shared/_header.html.php
kronolith/data.php
kronolith/edit.php
kronolith/fb.php
kronolith/feed/index.php
kronolith/lib/Ajax/Application.php
kronolith/lib/Api.php
kronolith/lib/Application.php
kronolith/lib/Block/tree_alarms.php
kronolith/lib/Driver/Sql.php
kronolith/lib/Event.php
kronolith/lib/Kronolith.php
kronolith/lib/View/ExportEvent.php
kronolith/new.php
kronolith/scripts/agenda.php
kronolith/templates/common-header.inc
kronolith/templates/itip/notification.html.php
kronolith/templates/javascript_defs.php
kronolith/templates/view/view.inc
luxor/lib/Lang/Generic.php
luxor/lib/Luxor.php
luxor/templates/common-header.inc
mnemo/data.php
mnemo/lib/Driver/sql.php
mnemo/memo.php
mnemo/note/pdf.php
mnemo/templates/common-header.inc
mnemo/templates/view/memo.inc
nag/data.php
nag/lib/Api.php
nag/lib/Application.php
nag/lib/Driver/Sql.php
nag/lib/Forms/task.php
nag/lib/Nag.php
nag/lib/Task.php
nag/task.php
nag/templates/common-header.inc
nag/templates/view/task.inc
news/lib/Block/category.php
news/lib/Block/last.php
news/lib/Block/last_blogs.php
news/lib/Block/most_commented.php
news/lib/Block/most_read.php
news/lib/Driver/sql.php
news/lib/News.php
news/lib/View.php
news/mail.php
news/pdf.php
news/rss/comments.php
news/rss/index.php
news/rss/news.php
news/templates/common-header.inc
operator/graphgen.php
operator/templates/common-header.inc
pastie/templates/common-header.inc
shout/templates/common-header.inc
shout/templates/dialplan/edit.inc
skeleton/templates/common-header.inc
skoli/templates/common-header.inc
trean/add.php
trean/data.php
trean/lib/Application.php
trean/lib/Bookmarks.php
trean/rss.php
trean/templates/common-header.inc
turba/add.php
turba/config/sources.php.dist
turba/data.php
turba/lib/Driver.php
turba/lib/Driver/Ldap.php
turba/lib/Driver/Sql.php
turba/lib/Object.php
turba/lib/View/Browse.php
turba/templates/common-header.inc
turba/vcard.php
vilma/templates/common-header.inc
whups/lib/Driver.php
whups/lib/Driver/sql.php
whups/opensearch.php
whups/query/rss.php
whups/queue/rss.php
whups/scripts/mail-filter.php
whups/search/rss.php
whups/templates/common-header.inc
whups/ticket/rss.php
wicked/lib/Driver.php
wicked/lib/Driver/sql.php
wicked/lib/Page.php
wicked/lib/Page/MergeOrRename.php
wicked/lib/Wicked.php
wicked/opensearch.php
wicked/templates/common-header.inc
wicked/templates/edit/new.inc
wicked/templates/edit/standard.inc
wicked/templates/history/summary.inc

index b35d6e1..94c9481 100644 (file)
@@ -406,7 +406,7 @@ class Agora {
 
         $body = new Horde_Mime_Part();
         $body->setType('text/plain');
-        $body->setCharset(Horde_Nls::getCharset());
+        $body->setCharset($GLOBALS['registry']->getCharset());
         $body->setContents($message['body']);
 
         $body->send($forum['forum_distribution_address'], $msg_headers, $conf['mailer']['type'], $conf['mailer']['params']);
index bf06e53..71e973f 100644 (file)
@@ -566,7 +566,7 @@ class Agora_Messages {
                                    strftime($GLOBALS['prefs']->getValue('date_format'), $message['message_timestamp']))
             . "\n-------------------------------------------------------\n"
             . $message['body'];
-        $message['body'] = "\n> " . Horde_String::wrap($message['body'], 60, "\n> ", Horde_Nls::getCharset());
+        $message['body'] = "\n> " . Horde_String::wrap($message['body'], 60, "\n> ", $GLOBALS['registry']->getCharset());
 
         return $message;
     }
@@ -993,7 +993,7 @@ class Agora_Messages {
         foreach ($messages as $id => &$message) {
             $message['message_id'] = $id;
             $message['message_author'] = htmlspecialchars($message['message_author']);
-            $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, Horde_Nls::getCharset());
+            $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             $message['message_date'] = $this->dateFormat($message['message_timestamp']);
             if ($format) {
                 $message['body'] = $this->formatBody($this->convertFromDriver($message['body']));
@@ -1147,7 +1147,7 @@ class Agora_Messages {
             $message['forum_name'] = $this->convertFromDriver($forums_list[$message['forum_id']]);
             $message['message_id'] = $id;
             $message['message_author'] = htmlspecialchars($message['message_author']);
-            $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, Horde_Nls::getCharset());
+            $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             $message['message_body'] = Horde_Text_Filter::filter($this->convertFromDriver($message['body']), 'highlightquotes');
             if ($message['attachments']) {
                 $message['message_attachment'] = $this->getAttachmentLink($id);
@@ -2113,7 +2113,7 @@ class Agora_Messages {
         }
 
         if (!empty($filter['author'])) {
-            $sql .= ' AND message_author = ' . $this->_db->quote(Horde_String::lower($filter['author'], Horde_Nls::getCharset()));
+            $sql .= ' AND message_author = ' . $this->_db->quote(Horde_String::lower($filter['author'], $GLOBALS['registry']->getCharset()));
         }
 
         /* Sort by result column. */
@@ -2214,7 +2214,7 @@ class Agora_Messages {
      */
     public function convertToDriver($value)
     {
-        return Horde_String::convertCharset($value, Horde_Nls::getCharset(), $this->_params['charset']);
+        return Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $this->_params['charset']);
     }
 
     /**
index 6610b04..d530acd 100644 (file)
@@ -19,7 +19,7 @@ class Agora_View extends Horde_View {
     {
         /* Set default data. */
         parent::__construct(array('templatePath' => AGORA_TEMPLATES . '/',
-                                  'encoding' => Horde_Nls::getCharset()));
+                                  'encoding' => $GLOBALS['registry']->getCharset()));
     }
 
 }
index 307b11d..282e4b3 100644 (file)
@@ -75,7 +75,7 @@ if ($form->validate()) {
         'body' => $url . "\n\n" . $registry->getAuth() . "\n\n" . $_SERVER["REMOTE_ADDR"],
         'to' => $emails,
         'from' => $emails[0],
-        'charset' => Horde_Nls::getCharset()));
+        'charset' => $GLOBALS['registry']->getCharset()));
     $mail->addHeader('User-Agent', 'Agora ' . $registry->getVersion());
     $mail->send($injector->getInstance('Horde_Mail'));
 
index 95bfccd..d578080 100644 (file)
@@ -20,16 +20,15 @@ $cache = $injector->getInstance('Horde_Cache');
 
 $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
 if (!$rss) {
-
     $title = sprintf(_("Forums in %s"), $registry->get('name', $scope));
     $forums = Agora_Messages::singleton($scope);
     $forums_list = $forums->getForums(0, true, 'forum_name', 0);
 
-    $rss = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
+    $rss = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($title) . '</title>
-        <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
+        <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
         <lastBuildDate>' . date('r') . '</lastBuildDate>
         <description>' . htmlspecialchars($title) . '</description>
         <link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
@@ -51,5 +50,5 @@ if (!$rss) {
     $cache->set($cache_key, $rss);
 }
 
-header('Content-type: text/xml; charset=' . Horde_Nls::getCharset());
+header('Content-type: text/xml; charset=' . $GLOBALS['registry']->getCharset());
 echo $rss;
index c7932d4..b2d97f1 100644 (file)
@@ -31,11 +31,11 @@ if (!$rss) {
         exit;
     }
 
-    $rss = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
+    $rss = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($message['message_subject']) . '</title>
-        <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
+        <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
         <lastBuildDate>' . date('r') . '</lastBuildDate>
         <description>' . htmlspecialchars($message['message_subject']) . '</description>
         <link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
@@ -59,5 +59,5 @@ if (!$rss) {
     $cache->set($cache_key, $rss);
 }
 
-header('Content-type: text/xml; charset=' . Horde_Nls::getCharset());
+header('Content-type: text/xml; charset=' . $GLOBALS['registry']->getCharset());
 echo $rss;
index ebd99a7..f95b988 100644 (file)
@@ -59,11 +59,11 @@ if (!$rss) {
 
     $threads_list = $threads->getThreads(0, false, 'message_modifystamp', 1, true, '', null, 0, 10);
 
-    $rss = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
+    $rss = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($title) . '</title>
-        <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
+        <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
         <lastBuildDate>' . date('r') . '</lastBuildDate>
         <description>' . htmlspecialchars($title) . '</description>
         <link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
@@ -98,5 +98,5 @@ if (!$rss) {
     $cache->set($cache_key, $rss);
 }
 
-header('Content-type: text/xml; charset=' . Horde_Nls::getCharset());
+header('Content-type: text/xml; charset=' . $GLOBALS['registry']->getCharset());
 echo $rss;
index 27e5ce7..7902bc0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index d9ecb7d..683305e 100644 (file)
@@ -63,7 +63,7 @@ $title = sprintf(_("%s :: Sort"), $gallery->get('name'));
 require ANSEL_TEMPLATES . '/common-header.inc';
 require ANSEL_TEMPLATES . '/menu.inc';
 ?>
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></h1>
 <div class="instructions">
  <form action="sort.php" method="post">
   <?php echo Horde_Util::formInput() ?>
@@ -85,7 +85,7 @@ require ANSEL_TEMPLATES . '/menu.inc';
 <?php
 $images = $gallery->getImages();
 foreach ($images as $image) {
-    $caption = empty($image->caption) ? htmlspecialchars($image->filename, ENT_COMPAT, Horde_Nls::getCharset()) : htmlspecialchars($image->caption, ENT_COMPAT, Horde_Nls::getCharset());
+    $caption = empty($image->caption) ? htmlspecialchars($image->filename, ENT_COMPAT, $GLOBALS['registry']->getCharset()) : htmlspecialchars($image->caption, ENT_COMPAT, $GLOBALS['registry']->getCharset());
     echo '<div id="o_' . (int)$image->id . '"><a title="'
         . $caption . '" href="#">'
         . '<img src="' . Ansel::getImageUrl($image->id, 'thumb', false, $style['name']) . '" alt="' . htmlspecialchars($image->filename) . '" />'
index ac7a877..4b61e34 100644 (file)
@@ -35,7 +35,7 @@ case 'send':
         break;
     }
 
-    $charset = Horde_Nls::getCharset();
+    $charset = $GLOBALS['registry']->getCharset();
 
     /* Create the text part. */
     $textpart = new Horde_Mime_Part();
@@ -59,7 +59,7 @@ case 'send':
     $img_tag = '<img src="cid:' . $imgpart->setContentID() . '" /><p />';
     $comments = $htmlpart->replaceEOL(Horde_Util::getFormData('ecard_comments'));
     if (!Horde_Util::getFormData('rtemode')) {
-        $comments = '<pre>' . htmlspecialchars($comments, ENT_COMPAT, Horde_Nls::getCharset()) . '</pre>';
+        $comments = '<pre>' . htmlspecialchars($comments, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</pre>';
     }
     $htmlpart->setContents('<html>' . $img_tag . $comments . '</html>');
     $related->setContentTypeParameter('start', $htmlpart->setContentID());
index 1b1aac0..cd3d8ce 100644 (file)
@@ -684,7 +684,7 @@ class Ansel
 
         // Check for an active image
         if (!empty($image_id)) {
-            $text = '<span class="thiscrumb" id="PhotoName">' . htmlspecialchars($image->filename, ENT_COMPAT, Horde_Nls::getCharset()) . '</span>';
+            $text = '<span class="thiscrumb" id="PhotoName">' . htmlspecialchars($image->filename, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</span>';
             $nav = $separator . $text . $nav;
             $levels++;
         }
@@ -709,7 +709,7 @@ class Ansel
         }
 
         if (!empty($owner_title)) {
-            $owner_title = htmlspecialchars($owner_title, ENT_COMPAT, Horde_Nls::getCharset());
+            $owner_title = htmlspecialchars($owner_title, ENT_COMPAT, $GLOBALS['registry']->getCharset());
             $levels++;
             if ($gallery) {
                 $nav = $separator . Ansel::getUrlFor('view', array('view' => 'List', 'groupby' => 'owner', 'owner' => $owner, 'havesearch' => $haveSearch))->link() . $owner_title . '</a>' . $nav;
index 37b5524..eab51a0 100644 (file)
@@ -68,7 +68,7 @@ class Horde_Block_ansel_gallery extends Horde_Block
                   'slug' => $gallery->get('slug')),
             true);
         return $viewurl->link()
-               . @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset())
+               . @htmlspecialchars($name, ENT_COMPAT, $GLOBALS['registry']->getCharset())
                . '</a>';
 
     }
index cda1ea6..e612bfb 100644 (file)
@@ -82,7 +82,7 @@ HEADER;
             $html .= '<tr><td>'
                 . $url->link(array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");',
                                    'onmouseover' => 'previewImageMg(event, ' . $gallery->getDefaultImage('ansel_default') . ');'))
-                . @htmlspecialchars($gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset()) . '</a></td><td>'
+                . @htmlspecialchars($gallery->get('name'), ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</a></td><td>'
                 . strftime($GLOBALS['prefs']->getValue('date_format'), $gallery->get('last_modified'))
                 . '</td><td>' . (int)$gallery->countImages(true) . '</td></tr>';
         }
index 9bdec8e..c263442 100644 (file)
@@ -51,7 +51,7 @@ class Horde_Block_ansel_recent_comments extends Horde_Block
             }
             // Build the gallery name.
             if (isset($this->_params['gallery'])) {
-                $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset());
+                $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $style = $gallery->getStyle();
             $viewurl = Ansel::getUrlFor('view',
index 5056b9e..9552acc 100644 (file)
@@ -38,7 +38,7 @@ class Horde_Block_ansel_recent_faces extends Horde_Block
         $results = $faces->allFaces(0, $this->_params['limit']);
         $html = '';
         foreach ($results as $face_id => $face) {
-            $facename = htmlspecialchars($face['face_name'], ENT_COMPAT, Horde_Nls::getCharset());
+            $facename = htmlspecialchars($face['face_name'], ENT_COMPAT, $GLOBALS['registry']->getCharset());
             $html .= '<a href="' . Ansel_Faces::getLink($face) . '" title="' . $facename . '">'
                     . '<img src="' . $faces->getFaceUrl($face['image_id'], $face_id)
                     . '" style="padding-bottom: 5px; padding-left: 5px" alt="' . $facenane  . '" /></a>';
index db3511c..6f3d441 100644 (file)
@@ -54,7 +54,7 @@ class Horde_Block_ansel_recently_added extends Horde_Block
             // Build the gallery name.
             if (isset($this->_params['gallery'])) {
                 $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT,
-                                          Horde_Nls::getCharset());
+                                          $GLOBALS['registry']->getCharset());
             }
 
             $style = $gallery->getStyle();
@@ -130,7 +130,7 @@ HEADER;
                 true);
             $galleryLink = $galleryLink->link()
                 . @htmlspecialchars($gallery->get('name'), ENT_COMPAT,
-                                    Horde_Nls::getCharset())
+                                    $GLOBALS['registry']->getCharset())
                 . '</a>';
 
             $caption = substr($image->caption, 0, 30);
@@ -153,7 +153,7 @@ HEADER;
                           'onmouseover' => 'previewImage(event, ' . $image->id . ');'))
                 . @htmlspecialchars(
                     strlen($caption) ? $caption : $image->filename,
-                    ENT_COMPAT, Horde_Nls::getCharset())
+                    ENT_COMPAT, $GLOBALS['registry']->getCharset())
                 . '</a></td><td class="nowrap">' . $galleryLink . '</td></tr>';
         }
 
index 417a6c1..8cd6b43 100644 (file)
@@ -60,7 +60,7 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
 
             // Build the gallery name.
             if (isset($this->_params['gallery'])) {
-                $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset());
+                $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
 
             $style = $gallery->getStyle();
index 56bd32b..109c44d 100644 (file)
@@ -122,7 +122,7 @@ class Ansel_GalleryMode_Date
             $trail[] = array('title' => _("All dates"), 'navdata' => $navdata);
         }
 
-        $text = htmlspecialchars($this->_gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset());
+        $text = htmlspecialchars($this->_gallery->get('name'), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         $navdata = array('view' => 'Gallery',
                          'gallery' => $this->_gallery->id,
                          'slug' => $this->_gallery->get('slug'));
index b27ce2b..f4471a3 100644 (file)
@@ -1236,7 +1236,7 @@ class Ansel_Image Implements Iterator
                 $output[$field] = $value;
             } else {
                 $description = isset($data['description']) ? $data['description'] : $field;
-                $output[] = '<td><strong>' . $description . '</strong></td><td>' . htmlspecialchars($value, ENT_COMPAT, Horde_Nls::getCharset()) . '</td>';
+                $output[] = '<td><strong>' . $description . '</strong></td><td>' . htmlspecialchars($value, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</td>';
             }
         }
 
index 2833f01..f4cbdea 100644 (file)
@@ -516,9 +516,9 @@ class Ansel_Storage
                 Horde::logMessage($update, 'ERR');
                 throw new Ansel_Exception($update);
             }
-            $result = $update->execute(array(Horde_String::convertCharset($image->filename, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
+            $result = $update->execute(array(Horde_String::convertCharset($image->filename, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
                                              $image->type,
-                                             Horde_String::convertCharset($image->caption, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                             Horde_String::convertCharset($image->caption, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
                                              $image->sort,
                                              $image->originalDate,
                                              $image->lat,
@@ -556,9 +556,9 @@ class Ansel_Storage
         /* Perform the INSERT */
         $result = $insert->execute(array($image_id,
                                          $image->gallery,
-                                         Horde_String::convertCharset($image->filename, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                         Horde_String::convertCharset($image->filename, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
                                          $image->type,
-                                         Horde_String::convertCharset($image->caption, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                         Horde_String::convertCharset($image->caption, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
                                          $image->uploaded,
                                          $image->sort,
                                          $image->originalDate,
@@ -591,7 +591,7 @@ class Ansel_Storage
     public function saveImageAttribute($image_id, $attribute, $value)
     {
         $insert = $this->_db->prepare('INSERT INTO ansel_image_attributes (image_id, attr_name, attr_value) VALUES (?, ?, ?)');
-        $result = $insert->execute(array($image_id, $attribute, Horde_String::convertCharset($value, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset'])));
+        $result = $insert->execute(array($image_id, $attribute, Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset'])));
         if ($result instanceof PEAR_Error) {
             throw new Ansel_Exception($result);
         }
@@ -965,7 +965,7 @@ class Ansel_Storage
 
             if ($galleries[$gallery_id]['perm']) {
                 $data = array((string)Ansel::getImageUrl($image->id, $image_view, $full, $style),
-                    htmlspecialchars($image->filename, ENT_COMPAT, Horde_Nls::getCharset()),
+                    htmlspecialchars($image->filename, ENT_COMPAT, $GLOBALS['registry']->getCharset()),
                     Horde_Text_Filter::filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)),
                     $image->id,
                     0);
@@ -991,7 +991,7 @@ class Ansel_Storage
         }
 
         if (count($json)) {
-            return Horde_Serialize::serialize($json, Horde_Serialize::JSON, Horde_Nls::getCharset());
+            return Horde_Serialize::serialize($json, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
         } else {
             return '';
         }
index d7d727f..5783765 100644 (file)
@@ -49,13 +49,13 @@ class Ansel_Tags
                 }
                 $tag = Horde_String::lower(trim($tag));
                 $sql = $GLOBALS['ansel_db']->prepare('SELECT tag_id FROM ansel_tags WHERE tag_name = ?');
-                $result = $sql->execute(Horde_String::convertCharset($tag, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']));
+                $result = $sql->execute(Horde_String::convertCharset($tag, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']));
                 $results = $result->fetchRow(MDB2_FETCHMODE_ASSOC);
                 $result->free();
 
                 if (empty($results)) {
                     $id = $GLOBALS['ansel_db']->nextId('ansel_tags');
-                    $result = $insert->execute(array($id, Horde_String::convertCharset($tag, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset'])));
+                    $result = $insert->execute(array($id, Horde_String::convertCharset($tag, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset'])));
                     $tagkeys[] = $id;
                 } elseif ($results instanceof PEAR_Error) {
                     Horde::logMessage($results->getMessage(), 'ERR');
index ad54c99..385cdce 100644 (file)
@@ -105,7 +105,7 @@ class Ansel_Tile_DateGallery
 
         /* Variables used in the template file */
         $image_link = $view_link . $gallery_image . '</a>';
-        $text_link = $view_link . htmlspecialchars($caption, ENT_COMPAT, Horde_Nls::getCharset()) . '</a>';
+        $text_link = $view_link . htmlspecialchars($caption, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</a>';
         $gallery_count = $dgallery->countImages(true);
 
         /* Background color is needed if displaying a mini tile */
index a605bd2..6a16ce0 100644 (file)
@@ -81,7 +81,7 @@ class Ansel_Tile_Gallery
         }
 
         $image_link = $view_link . $gallery_image . '</a>';
-        $text_link = $view_link . htmlspecialchars($gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset())
+        $text_link = $view_link . htmlspecialchars($gallery->get('name'), ENT_COMPAT, $GLOBALS['registry']->getCharset())
                      . '</a>';
 
         if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT) && !$mini) {
@@ -105,7 +105,7 @@ class Ansel_Tile_Gallery
             if (empty($owner_string)) {
                 $owner_string = $gallery->get('owner');
             }
-            $owner_link .= htmlspecialchars($owner_string, ENT_COMPAT, Horde_Nls::getCharset()) . '</a>';
+            $owner_link .= htmlspecialchars($owner_string, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</a>';
         }
 
         $gallery_count = $gallery->countImages(true);
index ad7ad53..050ab79 100644 (file)
@@ -254,7 +254,7 @@ abstract class Ansel_View_Base
             }
 
             $data = array((string)Ansel::getImageUrl($image->id, $params['image_view'], $params['full'], $style['name']),
-                          htmlspecialchars($image->filename, ENT_COMPAT, Horde_Nls::getCharset()),
+                          htmlspecialchars($image->filename, ENT_COMPAT, $GLOBALS['registry']->getCharset()),
                           Horde_Text_Filter::filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)),
                           $image->id,
                           $curpage);
@@ -276,7 +276,7 @@ abstract class Ansel_View_Base
             $json[] = $data;
         }
 
-        return Horde_Serialize::serialize($json, Horde_Serialize::JSON, Horde_Nls::getCharset());
+        return Horde_Serialize::serialize($json, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
     }
 
     /**
index ec64859..36e67bb 100644 (file)
@@ -24,7 +24,7 @@ class Ansel_Widget_Links extends Ansel_Widget_Base
         $html = $this->_htmlBegin();
         $html .= Ansel::getUrlFor('rss_user', array('owner' => $owner))->link() . Horde::img('feed.png') . ' ' . ($owner ? sprintf(_("Recent photos by %s"), $owner) : _("Recent system photos")) . '</a>';
         $slug = $this->_view->gallery->get('slug');
-        $html .= '<br />' . Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))->link() . ' ' .  Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset())) . '</a>';
+        $html .= '<br />' . Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))->link() . ' ' .  Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'), ENT_COMPAT, $GLOBALS['registry']->getCharset())) . '</a>';
 
         /* Embed html */
         if (empty($this->_view->_params['image_id'])) {
index 726f359..f5fad6d 100644 (file)
@@ -269,10 +269,10 @@ if (empty($rss)) {
         }
     }
 
-    $charset = Horde_Nls::getCharset();
+    $charset = $GLOBALS['registry']->getCharset();
     $xsl = $registry->get('themesuri') . '/feed-rss.xsl';
-    $stream_name = @htmlspecialchars($params['name'], ENT_COMPAT, Horde_Nls::getCharset());
-    $stream_desc = @htmlspecialchars($params['desc'], ENT_COMPAT, Horde_Nls::getCharset());
+    $stream_name = @htmlspecialchars($params['name'], ENT_COMPAT, $GLOBALS['registry']->getCharset());
+    $stream_desc = @htmlspecialchars($params['desc'], ENT_COMPAT, $GLOBALS['registry']->getCharset());
     $stream_updated = htmlspecialchars(date('r', $params['last_modified']));
     $stream_official = htmlspecialchars($params['link']);
     $image_url = htmlspecialchars($params['image_url']);
index ab5db7c..4d5e64c 100755 (executable)
@@ -75,7 +75,7 @@ if (empty($dir)) {
     $cli->fatal(_("You must specify a valid directory."));
 }
 
-Horde_Nls::setCharset('utf-8');
+$registry->setCharset('utf-8');
 $gallery_id = processDirectory($dir);
 if (!$keepEmpties) {
     $gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope()->getGallery($gallery_id);
index 6f752ab..cc14724 100644 (file)
@@ -7,7 +7,7 @@
 <input type="hidden" name="day" value="<?php echo (empty($date['day']) ? 0 : $date['day']) ?>" />
 
 <h1 class="header">
- <?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?>
+ <?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?>
 </h1>
 
 <?php if ($gallery->get('desc')): ?>
@@ -33,7 +33,7 @@ if ($gallery->countImages()) {
         echo '<td width="10%" align="right" valign="top">';
         echo '<img src="' . $thumb_url . '" alt="' . htmlspecialchars($image->filename) . '" />' .
             '</td><td width="40%" valign="top"><textarea name="img' . $image->id . '" rows="5" cols="25">' .
-            htmlspecialchars($image->caption, ENT_COMPAT, Horde_Nls::getCharset()) . '</textarea></td>';
+            htmlspecialchars($image->caption, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</textarea></td>';
 
         $count++;
         if (($count % 2) == 0) {
index 99d87eb..7140be4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
@@ -21,7 +21,7 @@ Horde::outputMetaTags();
 Horde::includeScriptFiles();
 
 ?>
-<title><?php echo htmlspecialchars($page_title, ENT_COMPAT, Horde_Nls::getCharset()) ?></title>
+<title><?php echo htmlspecialchars($page_title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></title>
 <link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
 <?php echo Ansel::stylesheetLinks() ?>
 <?php echo Horde::wrapInlineScript(Ansel::initJSVars());?>
index f2f8e1f..cfdb56c 100644 (file)
@@ -32,7 +32,7 @@
 <?php echo $pager->render() ?>
 <script type="text/javascript">
 //<![CDATA[
-var imgids = <?php echo Horde_Serialize::serialize($imageids, Horde_Serialize::JSON, Horde_Nls::getCharset()); ?>;
+var imgids = <?php echo Horde_Serialize::serialize($imageids, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()); ?>;
 
 function proccessImageFaces(image_id, reget) {
     var url = '<?php echo Horde::applicationUrl('faces/image.php'); ?>';
index 165e29f..d688f86 100644 (file)
@@ -9,7 +9,7 @@
 <input type="hidden" name="url" value="<?php echo htmlspecialchars(Horde_Util::getFormData('url')) ?>" />
 
 <h1 class="header">
- <?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?>
+ <?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?>
 </h1>
 
 <table cellspacing="0" width="100%" class="striped headerbox">
index 1bc0e5b..d303faa 100644 (file)
@@ -83,7 +83,7 @@ function changeRatio()
 }
 </script>
 
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></h1>
 <div class="control anselActions" style="text-align: center">
 <?php
 $style = $gallery->getStyle();
index 0265d41..704037a 100644 (file)
@@ -1,4 +1,4 @@
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></h1>
 <div class="control anselActions" style="text-align: center">
 <div id="prevDiv"></div>
 <?php
index 1310004..f312f30 100644 (file)
@@ -1,4 +1,4 @@
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></h1>
 <?php
 $base_url = Horde::applicationUrl('image.php');
 $base_url = $base_url->copy()->add(array_merge(
index d9cd9c8..e5d564f 100644 (file)
@@ -1,4 +1,4 @@
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></h1>
 <?php
 $base_url = Horde::applicationUrl('image.php')->add(
         array_merge(
index e5d12f1..7e655eb 100644 (file)
@@ -29,7 +29,7 @@ function resetImage()
     document.slider.setValue(<?php echo $geometry['height'] ?>);
 }
 </script>
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></h1>
 <div class="control anselActions" style="text-align: center">
 <?php
 
index 62bdc35..c377a6d 100644 (file)
@@ -2,6 +2,6 @@
  <span class="rightFloat">
   <?php ($galleries_perpage < $num_galleries) ? printf(_("%d to %d of %d Galleries"), $start, $end, $num_galleries) : printf(ngettext("%d Gallery", "%d Galleries", $num_galleries), $num_galleries) ?>
  </span>
- <?php echo @htmlspecialchars($list_title, ENT_COMPAT, Horde_Nls::getCharset()) . ' ' . Horde::link(Horde::applicationUrl($refresh_link), _("Refresh List")) . Horde::img('reload.png', _("Refresh List")) . '</a>' ?>
+ <?php echo @htmlspecialchars($list_title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . ' ' . Horde::link(Horde::applicationUrl($refresh_link), _("Refresh List")) . Horde::img('reload.png', _("Refresh List")) . '</a>' ?>
 </div>
 <table width="100%" style="background:<?php echo $styleDef['background'] ?>;"><tr>
index 14e8c9b..9bee44d 100644 (file)
@@ -66,7 +66,7 @@ $allLink = (!empty($this->_owner)) ? Horde::selfUrl()->add(array('view' => 'Resu
 if ($total) {
     echo '<span class="rightFloat">' . ($total > $this->_perPage ? sprintf(_("%d to %d of %d Items"), $this->_pagestart, $this->_pageend, $total) : sprintf(ngettext("%d Item", "%d Items", $total), $total)) . '<small>' . $allLink . '</small></span>';
 }
-echo htmlspecialchars($this->getTitle(), ENT_COMPAT, Horde_Nls::getCharset()) . $this->_search->getTagTrail();
+echo htmlspecialchars($this->getTitle(), ENT_COMPAT, $GLOBALS['registry']->getCharset()) . $this->_search->getTagTrail();
 ?>
 </div>
 
index 098b74d..4e9a16f 100755 (executable)
@@ -21,7 +21,7 @@
     <?php echo _("New Gallery Description") ?>
   </td>
   <td align="left">
-    <textarea name="gallery_desc" cols="33" rows="5"><?php echo htmlspecialchars($gallery_desc, ENT_COMPAT, Horde_Nls::getCharset()) ?></textarea>
+    <textarea name="gallery_desc" cols="33" rows="5"><?php echo htmlspecialchars($gallery_desc, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></textarea>
   </td>
 </tr>
 </table>
index 8f7218b..fd1fe09 100644 (file)
@@ -63,7 +63,7 @@ class Translate_Display {
         if (preg_match('/charset=(.*)/i', $headers, $m)) {
             return $m[1];
         }
-       return Horde_Nls::getCharset();
+       return $GLOBALS['registry']->getCharset();
     }
 
     function convert_string($msg) {
@@ -72,7 +72,7 @@ class Translate_Display {
        $f = array('/&lt;/', '/&gt;/');
        $t = array('<', '>');
        $msg = preg_replace($f, $t, $msg);
-       return Horde_String::convertCharset(html_entity_decode($msg), Horde_Nls::getCharset(), Translate_Display::parseCharset($po->meta['Content-Type']));
+       return Horde_String::convertCharset(html_entity_decode($msg), $GLOBALS['registry']->getCharset(), Translate_Display::parseCharset($po->meta['Content-Type']));
     }
 
     function display_string($msg) {
@@ -81,7 +81,7 @@ class Translate_Display {
        $f = array('/</', '/>/');
        $t = array('&lt;', '&gt;');
        $msg = preg_replace($f, $t, $msg);
-       return Horde_String::convertCharset($msg, Translate_Display::parseCharset($po->meta['Content-Type']), Horde_Nls::getCharset());
+       return Horde_String::convertCharset($msg, Translate_Display::parseCharset($po->meta['Content-Type']), $GLOBALS['registry']->getCharset());
     }
 
     function get_percent($used, $total) {
index 3dfb2b0..3a4bd44 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index d2a0803..1a8d776 100644 (file)
@@ -42,7 +42,7 @@ try {
     Chora::fatal($e);
 }
 
-$title = sprintf(_("Source Annotation of %s (revision %s)"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)), $rev);
+$title = sprintf(_("Source Annotation of %s (revision %s)"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)), $rev);
 $extraLink = sprintf('<a href="%s">%s</a> | <a href="%s">%s</a>',
                      Chora::url('co', $where, array('r' => $rev)), _("View"),
                      Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download"));
@@ -72,7 +72,7 @@ while (list(,$line) = each($lines)) {
     }
     $prev = $fl->queryPreviousRevision($rev);
 
-    $line = Horde_Text_Filter::filter($line['line'], 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true));
+    $line = Horde_Text_Filter::filter($line['line'], 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
     include CHORA_TEMPLATES . '/annotate/line.inc';
 }
 
index 19c0955..5d7bae5 100644 (file)
@@ -88,7 +88,7 @@ if ($dirList) {
             continue;
         }
         $url = Chora::url('browsedir', $where . '/' . $currentDir . '/', array('onb' => $onb));
-        $currDir = Horde_Text_Filter::filter($currentDir, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true));
+        $currDir = Horde_Text_Filter::filter($currentDir, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
         require CHORA_TEMPLATES . '/directory/dir.inc';
     }
     echo '</tbody>';
@@ -115,7 +115,7 @@ if ($fileList) {
         $log = $lg->queryLog();
         $attic = $currFile->isDeleted();
         $fileName = $where . ($attic ? '/' . 'Attic' : '') . '/' . $realname;
-        $name = Horde_Text_Filter::filter($realname, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true));
+        $name = Horde_Text_Filter::filter($realname, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
         $url = Chora::url('browsefile', $fileName, array('onb' => $onb));
         $readableDate = Chora::readableTime($date);
         if ($log) {
index 5a96b07..3776e59 100644 (file)
@@ -49,7 +49,7 @@ if (Horde_Util::getFormData('show_image')) {
     passthru($conf['paths']['cvsgraph'] . ' ' . $argstr . ' ' . $file);
 } else {
     // Display the wrapper page for the image.
-    $title = sprintf(_("Graph for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)));
+    $title = sprintf(_("Graph for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)));
     $extraLink = Chora::getFileViews($where, 'cvsgraph');
 
     require CHORA_TEMPLATES . '/common-header.inc';
index 0ede418..ccf9e56 100644 (file)
@@ -55,7 +55,7 @@ if ($type != 'colored') {
 $abbrev_r1 = $VC->abbrev($r1);
 $abbrev_r2 = $VC->abbrev($r2);
 $title = sprintf(_("Diff for %s between version %s and %s"),
-                 Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)), $abbrev_r1, $abbrev_r2);
+                 Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)), $abbrev_r1, $abbrev_r2);
 
 /* Format log entries. */
 $log_messages = array();
index 66382ef..11e6035 100644 (file)
@@ -127,7 +127,7 @@ foreach ($grid as $cols) {
     $maxCol = max($val, $maxCol);
 }
 
-$title = sprintf(_("Source Branching View for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)));
+$title = sprintf(_("Source Branching View for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)));
 $extraLink = Chora::getFileViews($where, 'history');
 
 require CHORA_TEMPLATES . '/common-header.inc';
index 51f881a..864738e 100644 (file)
@@ -60,7 +60,7 @@ class Chora
                 if (!empty($onb)) {
                     $url = Horde_Util::addParameter($url, array('onb' => $onb));
                 }
-                $bar .= '/ <a href="' . $url . '">'. Horde_Text_Filter::filter($dir, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)) . '</a> ';
+                $bar .= '/ <a href="' . $url . '">'. Horde_Text_Filter::filter($dir, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)) . '</a> ';
             }
         }
 
@@ -467,7 +467,7 @@ class Chora
      */
     static public function formatLogMessage($log)
     {
-        $log = Horde_Text_Filter::filter($log, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => Horde_Nls::getCharset(), 'class' => ''));
+        $log = Horde_Text_Filter::filter($log, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => $GLOBALS['registry']->getCharset(), 'class' => ''));
 
         return (empty($GLOBALS['conf']['tickets']['regexp']) || empty($GLOBALS['conf']['tickets']['replacement']))
             ? $log
index fc29805..ba53919 100644 (file)
@@ -29,7 +29,7 @@ foreach ($fl->queryLogs() as $lg) {
 }
 arsort($stats);
 
-$title = sprintf(_("Statistics for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)));
+$title = sprintf(_("Statistics for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)));
 Horde::addScriptFile('tables.js', 'horde');
 require CHORA_TEMPLATES . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
index 8cb7a32..e235bbe 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html><head>';
@@ -13,7 +13,7 @@ if (!empty($title)) {
 Horde::outputMetaTags();
 
 if (Horde_Util::nonInputVar('js_vars')) {
-    Horde::addInlineScript('var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, Horde_Nls::getCharset()));
+    Horde::addInlineScript('var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()));
 }
 
 Horde::includeScriptFiles();
index c54f0a4..1385eaf 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index c6c926b..eb3e488 100644 (file)
@@ -34,4 +34,4 @@ if ($block instanceof PEAR_Error) {
     }
 }
 
-echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, Horde_Nls::getCharset());
+echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
index d30ffc8..33689ed 100644 (file)
@@ -92,9 +92,9 @@ class Horde_Block_Layout_View_Js extends Horde_Block_Layout_View {
             }
         }
 
-        $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON, Horde_Nls::getCharset());
-        $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON, Horde_Nls::getCharset());
-        $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON, Horde_Nls::getCharset());
+        $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
+        $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
+        $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset());
 
         $js_init .= 'portal.add(new Xilinus.Widget().'
                     . 'setTitle(title_' . $js_id .').'
index e9c5fee..aa0ee84 100644 (file)
@@ -86,7 +86,7 @@ case 'export':
                 break;
             case 'eo':
             case 'desc':
-                $row[$key] = Horde_String::convertCharset($value, Horde_Nls::getCharset(), $params['charset']);
+                $row[$key] = Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $params['charset']);
                 break;
             default:
                 break;
@@ -216,7 +216,7 @@ if ($next_step == Horde_Data::IMPORT_FILE) {
             $charsets[$charset] = $charset;
         }
     }
-    $my_charset = Horde_Nls::getCharset(true);
+    $my_charset = $GLOBALS['registry']->getCharset(true);
 }
 
 foreach ($templates[$next_step] as $template) {
index eff602a..7ebda33 100644 (file)
@@ -532,9 +532,9 @@ class Fima_Driver_sql extends Fima_Driver {
                         $this->_ledger,
                         sprintf('%\'04d', $number),
                         $type,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)(bool)$eo,
-                        Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)(bool)$closed);
 
         /* Log the query at a DEBUG log level. */
@@ -576,9 +576,9 @@ class Fima_Driver_sql extends Fima_Driver {
                          $this->_params['table_accounts']);
         $values = array(sprintf('%\'04d', $number),
                         $type,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)(bool)$eo,
-                        Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)(bool)$closed,
                         $this->_ledger,
                         $accountId);
@@ -722,7 +722,7 @@ class Fima_Driver_sql extends Fima_Driver {
                         $account,
                         (int)(bool)$eo,
                         (float)$amount,
-                        Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']));
+                        Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']));
 
         /* Log the query at a DEBUG log level. */
         Horde::logMessage(sprintf('Fima_Driver_sql::_addPosting(): %s', $query), 'DEBUG');
@@ -769,7 +769,7 @@ class Fima_Driver_sql extends Fima_Driver {
                         $account,
                         (int)(bool)$eo,
                         (float)$amount,
-                        Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         $this->_ledger,
                         $postingId);
 
index edf5663..47ad7c5 100644 (file)
@@ -45,7 +45,7 @@ require_once FIMA_BASE . '/lib/Driver.php';
 Horde::compressOutput();
 
 // Set the timezone variable.
-Horde_Nls::setTimeZone();
+$registry->setTimeZone();
 
 // Create a share instance.
 $GLOBALS['fima_shares'] = $GLOBALS['injector']->getInstance('Horde_Share')->getScope();
index 796bc69..2f7e2db 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index f7d03f1..d49051e 100644 (file)
@@ -308,7 +308,7 @@ class Folks_Hooks
                 $value = hash('md5', $value);
             }
             $fields[] = 'user_' . Horde_String::lower($field);
-            $values[] = Horde_String::convertCharset($value, Horde_Nls::getCharset(), $conf['sql']['charset']);
+            $values[] = Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $conf['sql']['charset']);
         }
 
         $values[] = $userID;
index 77b3e82..c143803 100644 (file)
@@ -235,7 +235,7 @@ class Folks {
      */
     static public function sendMail($to, $subject, $body, $attaches = array())
     {
-        $mail = new Horde_Mime_Mail(array('subject' => $subject, 'body' => $body, 'to' => $to, 'from' => $GLOBALS['conf']['support'], 'charset' => Horde_Nls::getCharset()));
+        $mail = new Horde_Mime_Mail(array('subject' => $subject, 'body' => $body, 'to' => $to, 'from' => $GLOBALS['conf']['support'], 'charset' => $GLOBALS['registry']->getCharset()));
 
         $mail->addHeader('User-Agent', 'Folks ' . $GLOBALS['registry']->getVersion());
         $mail->addHeader('X-Originating-IP', $_SERVER['REMOTE_ADDR']);
@@ -243,7 +243,7 @@ class Folks {
 
         foreach ($attaches as $file) {
             if (file_exists($file)) {
-                $mail->addAttachment($file, null, null, Horde_Nls::getCharset());
+                $mail->addAttachment($file, null, null, $GLOBALS['registry']->getCharset());
             }
         }
 
index 459d414..e921cd2 100644 (file)
@@ -57,7 +57,7 @@ class Folks_Notification_mail extends Folks_Notification {
         $mail = new Horde_Mime_Mail(array('subject' => $subject,
                                           'body' => $body,
                                           'from' => $this->_params['from_addr'],
-                                          'charset' => Horde_Nls::getCharset()));
+                                          'charset' => $GLOBALS['registry']->getCharset()));
 
         $mail->addHeader('User-Agent', 'Folks ' . $GLOBALS['registry']->getVersion());
         $mail->addHeader('X-Originating-IP', $_SERVER['REMOTE_ADDR']);
@@ -65,7 +65,7 @@ class Folks_Notification_mail extends Folks_Notification {
 
         foreach ($attachments as $file) {
             if (file_exists($file)) {
-                $mail->addAttachment($file, null, null, Horde_Nls::getCharset());
+                $mail->addAttachment($file, null, null, $GLOBALS['registry']->getCharset());
             }
         }
 
@@ -78,7 +78,7 @@ class Folks_Notification_mail extends Folks_Notification {
             if (empty($to)) {
                 continue;
             }
-            $mail->addHeader('To', $to, Horde_Nls::getCharset(), true);
+            $mail->addHeader('To', $to, $GLOBALS['registry']->getCharset(), true);
             $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
         }
 
index fc556f1..eac4f43 100644 (file)
@@ -89,7 +89,7 @@ foreach (array('host', 'user', 'pass', 'port', 'protocol', 'folder') as $opt) {
 
 // Set charset to UTF-8 for most flexible conversion between email charset and
 // backend charset.
-Horde_Nls::setCharsetEnvironment('UTF-8');
+$registry->setCharsetEnvironment('UTF-8');
 
 // Read and parse the message.
 $messages = array();
index 6a0ad86..d2690fb 100644 (file)
@@ -110,7 +110,7 @@ while ($row =& $res->fetchRow()) {
     $body2 = sprintf($body, $row[0], $registry->get('name', 'horde'), Folks::getUrlFor('user', $row[0], true, -1));
 
     // Send mail
-    $mail = new MIME_Mail($subject, $body2, $row[1], $conf['support'], Horde_Nls::getCharset());
+    $mail = new MIME_Mail($subject, $body2, $row[1], $conf['support'], $GLOBALS['registry']->getCharset());
     $mail->addHeader('User-Agent', 'Folks' . $registry->getVersion());
     $sent = $mail->send($conf['mailer']['type'], $conf['mailer']['params']);
     if ($sent instanceof PEAR_Error) {
index 8666bc0..0a2ca34 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 36ec3dc..731f5c5 100644 (file)
@@ -1,4 +1,4 @@
-<?php echo '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '"?>' ?>
+<?php echo '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '"?>' ?>
 
 <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
index ed79402..5c53ee7 100644 (file)
@@ -1,4 +1,4 @@
-<?php echo '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '"?>' ?>
+<?php echo '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '"?>' ?>
 
 <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
index 81e7962..c91ef53 100644 (file)
@@ -72,7 +72,7 @@ class Horde_Ajax_Imple_SpellChecker extends Horde_Ajax_Imple_Base
         }
 
         Horde::addInlineScript(array(
-            $this->_params['id'] . ' = new SpellChecker(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ')'
+            $this->_params['id'] . ' = new SpellChecker(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . ')'
         ), 'dom');
     }
 
index bfbaa69..c8c0b16 100644 (file)
@@ -419,7 +419,7 @@ class Horde_Alarm_Sql extends Horde_Alarm
      */
     protected function _toDriver($value)
     {
-        return Horde_String::convertCharset($value, Horde_Nls::getCharset(), $this->_params['charset']);
+        return Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $this->_params['charset']);
     }
 
 }
index a78ba1c..a472fb6 100644 (file)
@@ -245,7 +245,7 @@ class Horde_Auth_Cyrsql extends Horde_Auth_Sql
         }
 
         try {
-            $mailbox = Horde_String::convertCharset($this->_params['userhierarchy'] . $userId, Horde_Nls::getCharset(), 'utf7-imap');
+            $mailbox = Horde_String::convertCharset($this->_params['userhierarchy'] . $userId, $GLOBALS['registry']->getCharset(), 'utf7-imap');
             $this->_imap->createMailbox($mailbox);
             $this->_imap->setACL($mailbox, $this->_params['cyradm'], 'lrswipcda');
         } catch (Horde_Imap_Client_Exception $e) {
@@ -257,12 +257,12 @@ class Horde_Auth_Cyrsql extends Horde_Auth_Sql
                 ($this->_params['domain_field'] != 'none')) {
                 list($userName, $domain) = explode('@', $userName);
                 $tmp = $userName . $this->_separator . $value . '@' . $domain;
-Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $domain, Horde_Nls::getCharset(), 'utf7-imap');
+Horde_String::convertCharset($userName . $this->_separator . $value . '@' . $domain, $GLOBALS['registry']->getCharset(), 'utf7-imap');
             } else {
                 $tmp = $userName . $this->_separator . $value;
             }
 
-            $tmp = Horde_String::convertCharset($tmp, Horde_Nls::getCharset(), 'utf7-imap');
+            $tmp = Horde_String::convertCharset($tmp, $GLOBALS['registry']->getCharset(), 'utf7-imap');
             $this->_imap->createMailbox($tmp);
             $this->_oimap>setACL($tmp, $this->_params['cyradm'], 'lrswipcda');
         }
index 4e002b4..958f1d9 100644 (file)
@@ -119,7 +119,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
     {
         $this->_backend->addUser($userId, $credentials);
 
-        $mailbox = Horde_String::convertCharset('user' . $this->_params['separator'] . $userId, Horde_Nls::getCharset(), 'utf7-imap');
+        $mailbox = Horde_String::convertCharset('user' . $this->_params['separator'] . $userId, $GLOBALS['registry']->getCharset(), 'utf7-imap');
 
         try {
             $this->_imap->createMailbox($mailbox);
@@ -131,7 +131,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
             is_array($this->_params['folders'])) {
             foreach ($this->_params['folders'] as $folder) {
                 try {
-                    $this->_imap->createMailbox($mailbox . Horde_String::convertCharset($this->_params['separator'] . $folder, Horde_Nls::getCharset(), 'utf7-imap'));
+                    $this->_imap->createMailbox($mailbox . Horde_String::convertCharset($this->_params['separator'] . $folder, $GLOBALS['registry']->getCharset(), 'utf7-imap'));
                 } catch (Horde_Imap_Client_Exception $e) {}
             }
         }
@@ -157,7 +157,7 @@ class Horde_Auth_Cyrus extends Horde_Auth_Base
     {
         $this->_backend->removeUser($userId);
 
-        $mailbox = Horde_String::convertCharset('user' . $this->_params['separator'] . $userId, Horde_Nls::getCharset(), 'utf7-imap');
+        $mailbox = Horde_String::convertCharset('user' . $this->_params['separator'] . $userId, $GLOBALS['registry']->getCharset(), 'utf7-imap');
 
         /* Set ACL for mailbox deletion. */
         list($admin) = explode('@', $this->_params['cyradmin']);
index cc82a0a..7627796 100644 (file)
@@ -99,7 +99,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
     {
         try {
             $ob = $this->_getOb($this->_params['admin_user'], $this->_params['admin_password']);
-            $mailbox = Horde_String::convertCharset($this->_params['userhierarchy'] . $userId, Horde_Nls::getCharset(), 'utf7-imap');
+            $mailbox = Horde_String::convertCharset($this->_params['userhierarchy'] . $userId, $GLOBALS['registry']->getCharset(), 'utf7-imap');
             $ob->createMailbox($mailbox);
             $ob->setACL($mailbox, $this->_params['admin_user'], 'lrswipcda');
         } catch (Horde_Imap_Client_Exception $e) {
@@ -119,7 +119,7 @@ class Horde_Auth_Imap extends Horde_Auth_Base
         try {
             $ob = $this->_getOb($this->_params['admin_user'], $this->_params['admin_password']);
             $ob->setACL($mailbox, $this->_params['admin_user'], 'lrswipcda');
-            $ob->deleteMailbox(Horde_String::convertCharset($this->_params['userhierarchy'] . $userId, Horde_Nls::getCharset(), 'utf7-imap'));
+            $ob->deleteMailbox(Horde_String::convertCharset($this->_params['userhierarchy'] . $userId, $GLOBALS['registry']->getCharset(), 'utf7-imap'));
         } catch (Horde_Imap_Client_Exception $e) {
             throw new Horde_Auth_Exception($e);
         }
index 274dca6..6021335 100644 (file)
@@ -240,7 +240,7 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout
                     try {
                         $message = Horde::callHook('perms_denied', array('horde:max_blocks'));
                     } catch (Horde_Exception_HookNotSet $e) {
-                        $message = @htmlspecialchars(sprintf(ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", Horde::hasPermission('max_blocks')), Horde::hasPermission('max_blocks')), ENT_COMPAT, Horde_Nls::getCharset());
+                        $message = @htmlspecialchars(sprintf(ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", Horde::hasPermission('max_blocks')), Horde::hasPermission('max_blocks')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
                     }
                     $GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
                     break;
index 675724e..3057cbe 100644 (file)
@@ -535,7 +535,7 @@ HTML;
      */
     static public function sendHTTPResponse($data, $ct)
     {
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
 
         // Output headers and encoded response.
         switch ($ct) {
@@ -587,7 +587,7 @@ HTML;
      * @param array $options  Additional options:
      * <pre>
      * 'charset' - (string) The charset of $data.
-     *             DEFAULT: Horde_Nls::getCharset()
+     *             DEFAULT: Horde_Registry::getCharset()
      * 'urlencode' - (boolean) URL encode the json string
      *               DEFAULT: No
      * </pre>
@@ -596,7 +596,7 @@ HTML;
      */
     static public function escapeJson($data, $options = array())
     {
-        $json = '/*-secure-' . Horde_Serialize::serialize($data, Horde_Serialize::JSON, empty($options['charset']) ? Horde_Nls::getCharset() : $options['charset']) . '*/';
+        $json = '/*-secure-' . Horde_Serialize::serialize($data, Horde_Serialize::JSON, empty($options['charset']) ? $GLOBALS['registry']->getCharset() : $options['charset']) . '*/';
         return empty($options['urlencode'])
             ? $json
             : '\'' . rawurlencode($json) . '\'';
@@ -1152,7 +1152,7 @@ HTML;
         }
         if (!empty($title)) {
             if ($escape) {
-                $charset = Horde_Nls::getCharset();
+                $charset = $GLOBALS['registry']->getCharset();
                 $old_error = error_reporting(0);
                 $title = str_replace(
                     array("\r", "\n"), '',
@@ -1189,7 +1189,7 @@ HTML;
                                        $attributes = array())
     {
         if (!empty($title)) {
-            $charset = Horde_Nls::getCharset();
+            $charset = $GLOBALS['registry']->getCharset();
             $old_error = error_reporting(0);
             $title = '&lt;pre&gt;' . preg_replace(array('/\n/', '/((?<!<br)\s{1,}(?<!\/>))/em', '/<br \/><br \/>/', '/<br \/>/'), array('', 'str_repeat("&nbsp;", strlen("$1"))', '&lt;br /&gt; &lt;br /&gt;', '&lt;br /&gt;'), nl2br(htmlspecialchars(htmlspecialchars($title, ENT_QUOTES, $charset), ENT_QUOTES, $charset))) . '&lt;/pre&gt;';
             error_reporting($old_error);
@@ -1309,7 +1309,7 @@ HTML;
      */
     static public function img($src, $alt = '', $attr = '')
     {
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
 
         /* If browser does not support images, simply return the ALT text. */
         if (!$GLOBALS['browser']->hasFeature('images')) {
@@ -1355,7 +1355,7 @@ HTML;
      */
     static public function fullSrcImg($src, $options = array())
     {
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
 
         /* If browser does not support images, simply return the ALT text. */
         if (!$GLOBALS['browser']->hasFeature('images')) {
@@ -1611,11 +1611,7 @@ HTML;
      */
     static public function stripAccessKey($label)
     {
-        if (!isset(Horde_Nls::$config['multibyte'])) {
-            self::loadConfiguration('nls.php', null, 'horde');
-        }
-
-        $multibyte = isset(Horde_Nls::$config['multibyte'][Horde_Nls::getCharset(true)]);
+        $multibyte = isset($GLOBALS['registry']->nlsconfig['multibyte'][$GLOBALS['registry']->getCharset(true)]);
         return preg_replace('/_([A-Za-z])/',
                             $multibyte && preg_match('/[\x80-\xff]/', $label) ? '' : '\1',
                             $label);
@@ -1638,15 +1634,17 @@ HTML;
             return $stripped_label;
         }
 
-        if (isset($GLOBALS['nls']['multibyte'][Horde_Nls::getCharset(true)])) {
+        if (isset($GLOBALS['registry']->nlsconfig['multibyte'][$GLOBALS['registry']->getCharset(true)])) {
             /* Prefix parenthesis with the UTF-8 representation of the LRO
              * (Left-to-Right-Override) Unicode codepoint U+202D. */
-            $prefix = Horde_Nls::getCharset() == 'UTF-8' ? "\xe2\x80\xad" : '';
+            $prefix = ($GLOBALS['registry']->getCharset() == 'UTF-8')
+                ? "\xe2\x80\xad"
+                : '';
             return $stripped_label . $prefix . '(<span class="accessKey">'
                 . strtoupper($accessKey) . '</span>' . ')';
-        } else {
-            return str_replace('_' . $accessKey, '<span class="accessKey">' . $accessKey . '</span>', $label);
         }
+
+        return str_replace('_' . $accessKey, '<span class="accessKey">' . $accessKey . '</span>', $label);
     }
 
     /**
index b2df8a0..fec37cc 100644 (file)
@@ -1514,7 +1514,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\", \"' . Horde_Nls::getCharset() . '\")", "Horde_String::convertCharset(html_entity_decode(\"$1\", ENT_COMPAT, \"iso-8859-1\"), \"iso-8859-1\", \"' . Horde_Nls::getCharset() . '\")"), $val);'), Horde_Nls::$config['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\", \"' . $GLOBALS['registry']->getCharset() . '\")", "Horde_String::convertCharset(html_entity_decode(\"$1\", ENT_COMPAT, \"iso-8859-1\"), \"iso-8859-1\", \"' . $GLOBALS['registry']->getCharset() . '\")"), $val);'), $GLOBALS['registry']->nlsconfig['languages']);
 
         case 'list-blocks':
             $collection = Horde_Block_Collection::singleton('portal');
index ddff4cc..7d6f7de 100644 (file)
@@ -89,7 +89,7 @@ abstract class Horde_Core_Auth_Signup_Base
                 'body' => $message,
                 'to' => $conf['signup']['email'],
                 'from' => $conf['signup']['email'],
-                'subject' => Horde_Nls::getCharset()));
+                'subject' => $GLOBALS['registry']->getCharset()));
             $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
         }
     }
diff --git a/framework/Core/lib/Horde/Core/Autoloader/Callback/Nls.php b/framework/Core/lib/Horde/Core/Autoloader/Callback/Nls.php
new file mode 100644 (file)
index 0000000..2bc7e9d
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @category Horde
+ * @package  Core
+ */
+class Horde_Core_Autoloader_Callback_Nls
+{
+    /**
+     * TODO
+     */
+    static public function callback()
+    {
+        Horde_Nls::$dnsResolver = $GLOBALS['injector']->getInstance('Net_DNS_Resolver');
+    }
+
+}
index 27fa7ee..8c5b23e 100644 (file)
@@ -41,7 +41,7 @@ class Horde_Core_Binder_Alarm implements Horde_Injector_Binder
         $handler_params = array(
             'identity' => $injector->getInstance('Horde_Prefs_Identity'),
             'mail' => $injector->getInstance('Horde_Mail'),
-            'charset' => Horde_Nls::getCharset()
+            'charset' => $GLOBALS['registry']->getCharset()
         );
         $alarm->addHandler('mail', new Horde_Alarm_Handler_Mail($handler_params));
 
index c8b1de4..3e2d1b4 100644 (file)
@@ -748,7 +748,7 @@ class Horde_Core_Prefs_Ui
                     // Fall-through
 
                 default:
-                    $val2 = Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'UTF-8');
+                    $val2 = Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), 'UTF-8');
                 }
 
                 // [0] = pref name
index bce7bb0..cb1d9fa 100644 (file)
@@ -83,7 +83,7 @@ class Horde_Core_Prefs_Ui_Widgets
                 );
             }
             Horde::addInlineScript(array(
-                'HordeSourceSelectPrefs.source_list = ' . Horde_Serialize::serialize($js, Horde_Serialize::JSON, Horde_Nls::getCharset())
+                'HordeSourceSelectPrefs.source_list = ' . Horde_Serialize::serialize($js, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
             ));
         }
 
@@ -223,8 +223,8 @@ class Horde_Core_Prefs_Ui_Widgets
             }
 
             Horde::addInlineScript(array(
-                'HordeAddressbooksPrefs.fields = ' . Horde_Serialize::serialize($js, Horde_Serialize::JSON, Horde_Nls::getCharset()),
-                'HordeAddressbooksPrefs.nonetext = ' . Horde_Serialize::serialize(_("No address book selected."), Horde_Serialize::JSON, Horde_Nls::getCharset())
+                'HordeAddressbooksPrefs.fields = ' . Horde_Serialize::serialize($js, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()),
+                'HordeAddressbooksPrefs.nonetext = ' . Horde_Serialize::serialize(_("No address book selected."), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
             ));
         }
 
index 3f2f07f..23f14a0 100644 (file)
@@ -36,6 +36,13 @@ class Horde_Registry
     protected $_cache = array();
 
     /**
+     * NLS cached information.
+     *
+     * @var array
+     */
+    protected $_nlscache = array();
+
+    /**
      * The last modified time of the newest modified registry file.
      *
      * @var integer
@@ -71,18 +78,25 @@ class Horde_Registry
     public $applications = array();
 
     /**
-     * The session handler object.
+     * The application that called appInit().
      *
-     * @var Horde_SessionHandler
+     * @var string
      */
-    public $sessionHandler = null;
+    public $initialApp;
 
     /**
-     * The application that called appInit().
+     * NLS configuration.
      *
-     * @var string
+     * @var array
      */
-    public $initialApp;
+    public $nlsconfig = array();
+
+    /**
+     * The session handler object.
+     *
+     * @var Horde_SessionHandler
+     */
+    public $sessionHandler = null;
 
     /**
      * Application bootstrap initialization.
@@ -94,6 +108,7 @@ class Horde_Registry
      *
      * Global variables defined:
      *   $cli - Horde_Cli object (if 'cli' is true)
+     *   $language - Language
      *   $registry - Horde_Registry object
      *
      * @param string $app  The application to initialize.
@@ -120,6 +135,8 @@ class Horde_Registry
      *   'none' - Do not start a session
      *   'readonly' - Start session readonly
      *   [DEFAULT] - Start read/write session
+     * 'timezone' - (boolean) Set the time zone?
+     *              DEFAULT: false
      * 'user_admin' - (boolean) Set authentication to an admin user?
      *                DEFAULT: false
      * </pre>
@@ -143,6 +160,7 @@ class Horde_Registry
             'nologintasks' => false,
             'session_cache_limiter' => null,
             'session_control' => null,
+            'timezone' => false,
             'user_admin' => null
         ), $args);
 
@@ -204,6 +222,10 @@ class Horde_Registry
 
         $registry->initialApp = $app;
 
+        if ($args['timezone']) {
+            $registry->setTimeZone();
+        }
+
         if (!$args['nocompress']) {
             Horde::compressOutput();
         }
@@ -231,7 +253,8 @@ class Horde_Registry
     {
         /* Define autoloader callbacks. */
         $callbacks = array(
-            'Horde_Mime' => 'Horde_Core_Autoloader_Callback_Mime'
+            'Horde_Mime' => 'Horde_Core_Autoloader_Callback_Mime',
+            'Horde_Nls' => 'Horde_Core_Autoloader_Callback_Nls'
         );
 
         /* Define binders. */
@@ -304,7 +327,6 @@ class Horde_Registry
             $GLOBALS['__autoloader']->addCallback($key, array($val, 'callback'));
         }
 
-
         /* Initialize browser object. */
         $GLOBALS['browser'] = $injector->getInstance('Horde_Browser');
 
@@ -312,8 +334,7 @@ class Horde_Registry
          * and egg issue - since loadConfiguration() uses registry in certain
          * instances. However, if HORDE_BASE is defined, and app is
          * 'horde', registry is not used in the method so we are free to
-         * call it here (prevents us from duplicating a bunch of code
-         * here. */
+         * call it here (prevents us from duplicating a bunch of code). */
         $this->_cache['conf-horde'] = Horde::loadConfiguration('conf.php', 'conf', 'horde');
         $conf = $GLOBALS['conf'] = &$this->_cache['conf-horde'];
 
@@ -363,12 +384,11 @@ class Horde_Registry
         /* Always need to load applications information. */
         $this->_loadApplicationsCache($vhost);
 
-        /* Initialize the localization routines and variables. We can't use
-         * Horde_Nls::setLanguageEnvironment() here because that depends on the
-         * registry to be already initialized. */
-        Horde_Nls::setLanguage();
-        Horde_Nls::setTextdomain('horde', HORDE_BASE . '/locale', Horde_Nls::getCharset());
-        Horde_String::setDefaultCharset(Horde_Nls::getCharset());
+        /* Load the language configuration. */
+        $this->nlsconfig = Horde::loadConfiguration('nls.php', 'horde_nls_config', 'horde');
+
+        /* Initialize the localization routines and variables. */
+        $this->setLanguageEnvironment(null, 'horde');
 
         $this->_regmtime = max(filemtime(HORDE_BASE . '/config/registry.php'),
                                filemtime(HORDE_BASE . '/config/registry.d'));
@@ -1124,10 +1144,10 @@ class Horde_Registry
         /* Chicken and egg problem: the language environment has to be loaded
          * before loading the configuration file, because it might contain
          * gettext strings. Though the preferences can specify a different
-         * language for this app, the have to be loaded after the
+         * language for this app, they have to be loaded after the
          * configuration, because they rely on configuration settings. So try
          * with the current language, and reset the language later. */
-        Horde_Nls::setLanguageEnvironment($GLOBALS['language'], $app);
+        $this->setLanguageEnvironment($GLOBALS['language'], $app);
 
         /* Load config and prefs and set proper language from the prefs. */
         $this->_onAppSwitch($app);
@@ -1209,7 +1229,7 @@ class Horde_Registry
          * preferences. */
         $language = $GLOBALS['prefs']->getValue('language');
         if ($language != $GLOBALS['language']) {
-            Horde_Nls::setLanguageEnvironment($language, $app);
+            $this->setLanguageEnvironment($language, $app);
         }
     }
 
@@ -2013,7 +2033,7 @@ class Horde_Registry
         $_SESSION['horde_auth'] = array(
             'app' => array(),
             'authId' => $authId,
-            'browser' => $GLOBALS['injector']->getInstance('Horde_Browser')->getAgentString(),
+            'browser' => $GLOBALS['browser']->getAgentString(),
             'change' => !empty($options['change']),
             'credentials' => $app,
             'remoteAddr' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null,
@@ -2025,7 +2045,7 @@ class Horde_Registry
 
         /* Reload preferences for the new user. */
         $this->loadPrefs();
-        Horde_Nls::setLanguageEnvironment($GLOBALS['prefs']->getValue('language'), $app);
+        $this->setLanguageEnvironment($GLOBALS['prefs']->getValue('language'), $app);
     }
 
     /**
@@ -2045,7 +2065,7 @@ class Horde_Registry
         }
 
         if (!empty($GLOBALS['conf']['auth']['checkbrowser']) &&
-            ($_SESSION['horde_auth']['browser'] != $GLOBALS['injector']->getInstance('Horde_Browser')->getAgentString())) {
+            ($_SESSION['horde_auth']['browser'] != $GLOBALS['browser']->getAgentString())) {
             $auth->setError(Horde_Core_Auth_Application::REASON_BROWSER);
             return false;
         }
@@ -2053,4 +2073,352 @@ class Horde_Registry
         return $auth->validateAuth();
     }
 
+    /* NLS functions. */
+
+    /**
+     * Returns the charset for the current language.
+     *
+     * @param boolean $original  If true returns the original charset of the
+     *                           translation, the actually used one otherwise.
+     *
+     * @return string  The character set that should be used with the current
+     *                 locale settings.
+     */
+    public function getCharset($original = false)
+    {
+        /* Get cached results. */
+        $cacheKey = intval($original);
+        $charset = $this->_cachedCharset($cacheKey);
+        if (!is_null($charset)) {
+            return $charset;
+        }
+
+        if ($original) {
+            $charset = empty($this->nlsconfig['charsets'][$GLOBALS['language']])
+                ? 'ISO-8859-1'
+                : $this->nlsconfig['charsets'][$GLOBALS['language']];
+        } elseif ($GLOBALS['browser']->hasFeature('utf') &&
+                  (Horde_Util::extensionExists('iconv') ||
+                   Horde_Util::extensionExists('mbstring'))) {
+            $charset = 'UTF-8';
+        }
+
+        if (is_null($charset)) {
+            $charset = $this->getExternalCharset();
+        }
+
+        $this->_cachedCharset($cacheKey, $charset);
+
+        return $charset;
+    }
+
+    /**
+     * Returns the current charset of the environment
+     *
+     * @return string  The character set that should be used with the current
+     *                 locale settings.
+     */
+    public function getExternalCharset()
+    {
+        /* Get cached results. */
+        $charset = $this->_cachedCharset(2);
+        if (!is_null($charset)) {
+            return $charset;
+        }
+
+        $lang_charset = setlocale(LC_ALL, 0);
+        if ((strpos($lang_charset, ';') === false) &&
+            (strpos($lang_charset, '/') === false)) {
+            $lang_charset = explode('.', $lang_charset);
+            if ((count($lang_charset) == 2) && !empty($lang_charset[1])) {
+                $this->_cachedCharset(2, $lang_charset[1]);
+                return $lang_charset[1];
+            }
+        }
+
+        return empty($this->nlsconfig['charsets'][$GLOBALS['language']])
+            ? 'ISO-8859-1'
+            : $this->nlsconfig['charsets'][$GLOBALS['language']];
+    }
+
+    /**
+     * Returns the charset to use for outgoing emails.
+     *
+     * @return string  The preferred charset for outgoing mails based on
+     *                 the user's preferences and the current language.
+     */
+    public function getEmailCharset()
+    {
+        $charset = $GLOBALS['prefs']->getValue('sending_charset');
+        if (!empty($charset)) {
+            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');
+    }
+
+    /**
+     * Selects the most preferred language for the current client session.
+     *
+     * @param string $lang  Force to use this language.
+     *
+     * @return string  The selected language abbreviation.
+     */
+    public function preferredLang($lang = null)
+    {
+        /* First, check if language pref is locked and, if so, set it to its
+         * value */
+        if (isset($GLOBALS['prefs']) &&
+            $GLOBALS['prefs']->isLocked('language')) {
+            $language = $GLOBALS['prefs']->getValue('language');
+        /* Check if the user selected a language from the login screen */
+        } elseif (!empty($lang) && $this->isValidLang($lang)) {
+            $language = $lang;
+        /* Check if we have a language set in the session */
+        } elseif (isset($_SESSION['horde_language'])) {
+            $language = $_SESSION['horde_language'];
+        /* Use site-wide default, if one is defined */
+        } elseif (!empty($this->nlsconfig['defaults']['language'])) {
+            $language = $this->nlsconfig['defaults']['language'];
+        /* Try browser-accepted languages. */
+        } elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+            /* The browser supplies a list, so return the first valid one. */
+            $browser_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+            foreach ($browser_langs as $lang) {
+                /* Strip quality value for language */
+                if (($pos = strpos($lang, ';')) !== false) {
+                    $lang = substr($lang, 0, $pos);
+                }
+                $lang = $this->_mapLang(trim($lang));
+                if ($this->isValidLang($lang)) {
+                    $language = $lang;
+                    break;
+                }
+
+                /* In case there's no full match, save our best guess. Try
+                 * 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)) {
+                        $partial_lang = $ll_LL;
+                    } else {
+                        $ll = $this->_mapLang(substr($lang, 0, 2));
+                        if ($this->isValidLang($ll))  {
+                            $partial_lang = $ll;
+                        }
+                    }
+                }
+            }
+        }
+
+        if (!isset($language)) {
+            $language = isset($partial_lang)
+                ? $partial_lang
+                /* No dice auto-detecting, default to US English. */
+                : 'en_US';
+        }
+
+        return basename($language);
+    }
+
+    /**
+     * 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 UI charset.
+     *
+     * In general, the applied charset is automatically determined by browser
+     * language and browser capabilities and there's no need to manually call
+     * setCharset. However for headless (RPC) operations the charset may be
+     * set manually to ensure correct character conversion in the backend.
+     *
+     * @param string $charset  The new UI charset.
+     */
+    public function setCharset($charset)
+    {
+        $this->_cachedCharset(0, $charset);
+    }
+
+    /**
+     * Sets the charset and reloads the whole NLS environment.
+     *
+     * When setting the charset, the gettext catalogs have to be reloaded too,
+     * to match the new charset, among other things. This method takes care of
+     * all this.
+     *
+     * @param string $charset  The new UI charset.
+     */
+    public function setCharsetEnvironment($charset)
+    {
+        unset($GLOBALS['language']);
+        $this->setCharset($charset);
+        $this->setLanguageEnvironment();
+    }
+
+    /**
+     * Sets the language.
+     *
+     * @param string $lang  The language abbreviation.
+     *
+     * @throws Horde_Exception
+     */
+    public function setLanguage($lang = null)
+    {
+        if (empty($lang) || !$this->isValidLang($lang)) {
+            $lang = $this->preferredLang();
+        }
+
+        $_SESSION['horde_language'] = $lang;
+
+        if (isset($GLOBALS['language'])) {
+            if ($GLOBALS['language'] == $lang) {
+                return;
+            }
+            $this->clearCache();
+        }
+        $GLOBALS['language'] = $lang;
+
+        /* First try language with the current charset. */
+        $lang_charset = $lang . '.' . $this->getCharset();
+        if ($lang_charset != setlocale(LC_ALL, $lang_charset)) {
+            /* Next try language with its default charset. */
+            $charset = empty($this->nlsconfig['charsets'][$lang])
+                ? 'ISO-8859-1'
+                : $this->nlsconfig['charsets'][$lang];
+            $lang_charset = $lang . '.' . $charset;
+            $this->_cachedCharset(0, $charset);
+            if ($lang_charset != setlocale(LC_ALL, $lang_charset)) {
+                /* At last try language solely. */
+                $lang_charset = $lang;
+                setlocale(LC_ALL, $lang_charset);
+            }
+        }
+
+        @putenv('LC_ALL=' . $lang_charset);
+        @putenv('LANG=' . $lang_charset);
+        @putenv('LANGUAGE=' . $lang_charset);
+    }
+
+    /**
+     * Sets the language and reloads the whole NLS environment.
+     *
+     * When setting the language, the gettext catalogs have to be reloaded
+     * too, charsets have to be updated etc. This method takes care of all
+     * this.
+     *
+     * @param string $language  The new language.
+     * @param string $app       The application for reloading the gettext
+     *                          catalog. The current application if empty.
+     */
+    public function setLanguageEnvironment($lang = null, $app = null)
+    {
+        if (empty($app)) {
+            $app = $this->getApp();
+        }
+
+        $this->setLanguage($lang);
+        $this->setTextdomain(
+            $app,
+            $this->get('fileroot', $app) . '/locale'
+        );
+        Horde_String::setDefaultCharset($this->getCharset());
+    }
+
+    /**
+     * Sets the gettext domain.
+     *
+     * @param string $app        The application name.
+     * @param string $directory  The directory where the application's
+     *                           LC_MESSAGES directory resides.
+     * @param string $charset    The charset.
+     */
+    public function setTextdomain($app, $directory, $charset = null)
+    {
+        bindtextdomain($app, $directory);
+        textdomain($app);
+
+        if (is_null($charset)) {
+            $charset = $this->getCharset();
+        }
+
+        /* The existence of this function depends on the platform. */
+        if (function_exists('bind_textdomain_codeset')) {
+            $this->_cachedCharset(0, bind_textdomain_codeset($app, $charset));
+        }
+
+        if (!Horde::contentSent()) {
+            header('Content-Type: text/html; charset=' . $charset);
+        }
+    }
+
+    /**
+     * Sets the current timezone, if available.
+     */
+    public function setTimeZone()
+    {
+        $tz = $GLOBALS['prefs']->getValue('timezone');
+        if (!empty($tz)) {
+            @date_default_timezone_set($tz);
+        }
+    }
+
+    /**
+     * Maps languages with common two-letter codes (such as nl) to the
+     * full gettext code (in this case, nl_NL). Returns the language
+     * unmodified if it isn't an alias.
+     *
+     * @param string $language  The language code to map.
+     *
+     * @return string  The mapped language code.
+     */
+    protected function _mapLang($language)
+    {
+        // Translate the $language to get broader matches.
+        // (eg. de-DE should match de_DE)
+        $trans_lang = str_replace('-', '_', $language);
+        $lang_parts = explode('_', $trans_lang);
+        $trans_lang = Horde_String::lower($lang_parts[0]);
+        if (isset($lang_parts[1])) {
+            $trans_lang .= '_' . Horde_String::upper($lang_parts[1]);
+        }
+
+        return empty($this->nlsconfig['aliases'][$trans_lang])
+            ? $trans_lang
+            : $this->nlsconfig['aliases'][$trans_lang];
+    }
+
+
+    /**
+     * Sets or returns the charset used under certain conditions.
+     *
+     * @param integer $index   The ID of a cache slot. 0 for the UI charset, 1
+     *                         for the translation charset and 2 for the
+     *                         external charset.
+     * @param string $charset  If specified, this charset will be stored in
+     *                         the given cache slot. Otherwise the content of
+     *                         the specified cache slot will be returned.
+     */
+    protected function _cachedCharset($index, $charset = null)
+    {
+        if (is_null($charset)) {
+            return isset($this->_nlscache['charset'][$index])
+                ? $this->_nlscache['charset'][$index]
+                : null;
+        }
+
+        $this->_nlscache['charset'][$index] = $charset;
+    }
+
 }
index fd648aa..f13530b 100644 (file)
@@ -76,6 +76,7 @@ Application Framework.</description>
       <dir name="Autoloader">
        <dir name="Callback">
         <file name="Mime.php" role="php" />
+        <file name="Nls.php" role="php" />
        </dir> <!-- /lib/Horde/Core/Autoloader/Callback -->
       </dir> <!-- /lib/Horde/Core/Autoloader -->
       <dir name="Binder">
@@ -276,6 +277,10 @@ Application Framework.</description>
     <channel>pear.horde.org</channel>
    </package>
    <package>
+    <name>Nls</name>
+    <channel>pear.horde.org</channel>
+   </package>
+   <package>
     <name>Text_Filter</name>
     <channel>pear.horde.org</channel>
    </package>
@@ -303,6 +308,7 @@ Application Framework.</description>
    <install as="Horde/Core/Auth/Signup/Sql.php" name="lib/Horde/Core/Auth/Signup/Sql.php" />
    <install as="Horde/Core/Auth/Signup/SqlObject.php" name="lib/Horde/Core/Auth/Signup/SqlObject.php" />
    <install as="Horde/Core/Autoloader/Callback/Mime.php" name="lib/Horde/Core/Autoloader/Callback/Mime.php" />
+   <install as="Horde/Core/Autoloader/Callback/Nls.php" name="lib/Horde/Core/Autoloader/Callback/Nls.php" />
    <install as="Horde/Core/Binder/Alarm.php" name="lib/Horde/Core/Binder/Alarm.php" />
    <install as="Horde/Core/Binder/Auth.php" name="lib/Horde/Core/Binder/Auth.php" />
    <install as="Horde/Core/Binder/AuthSignup.php" name="lib/Horde/Core/Binder/AuthSignup.php" />
index 1d3a8a6..5357012 100644 (file)
@@ -936,7 +936,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         if ($errno == 0) {
             throw new Horde_Exception(_("Connection refused to the public keyserver."));
         } else {
-            throw new Horde_Exception(sprintf(_("Connection refused to the public keyserver. Reason: %s (%s)"), Horde_String::convertCharset($errstr, Horde_Nls::getExternalCharset()), $errno));
+            throw new Horde_Exception(sprintf(_("Connection refused to the public keyserver. Reason: %s (%s)"), Horde_String::convertCharset($errstr, $GLOBALS['registry']->getExternalCharset()), $errno));
         }
     }
 
@@ -1316,7 +1316,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
             '--armor',
             '--always-trust',
             '--batch',
-            '--charset ' . Horde_Nls::getCharset(),
+            '--charset ' . $GLOBALS['registry']->getCharset(),
             $keyring,
             '--verify'
         );
@@ -1388,12 +1388,12 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $msg_sign = $this->encrypt($mime_part->toString(array('headers' => true, 'canonical' => true, 'encode' => Horde_Mime_Part::ENCODE_7BIT)), $params);
 
         /* Add the PGP signature. */
-        $charset = Horde_Nls::getEmailCharset();
+        $charset = $GLOBALS['registry']->getEmailCharset();
         $pgp_sign = new Horde_Mime_Part();
         $pgp_sign->setType('application/pgp-signature');
         $pgp_sign->setCharset($charset);
         $pgp_sign->setDisposition('inline');
-        $pgp_sign->setDescription(Horde_String::convertCharset(_("PGP Digital Signature"), Horde_Nls::getCharset(), $charset));
+        $pgp_sign->setDescription(Horde_String::convertCharset(_("PGP Digital Signature"), $GLOBALS['registry']->getCharset(), $charset));
         $pgp_sign->setContents($msg_sign);
 
         /* Get the algorithim information from the signature. Since we are
@@ -1433,12 +1433,12 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $message_encrypt = $this->encrypt($signenc_body, $params);
 
         /* Set up MIME Structure according to RFC 3156. */
-        $charset = Horde_Nls::getEmailCharset();
+        $charset = $GLOBALS['registry']->getEmailCharset();
         $part = new Horde_Mime_Part();
         $part->setType('multipart/encrypted');
         $part->setCharset($charset);
         $part->setContentTypeParameter('protocol', 'application/pgp-encrypted');
-        $part->setDescription(Horde_String::convertCharset(_("PGP Encrypted Data"), Horde_Nls::getCharset(), $charset));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Encrypted Data"), $GLOBALS['registry']->getCharset(), $charset));
         $part->setContents("This message is in MIME format and has been PGP encrypted.\n");
 
         $part1 = new Horde_Mime_Part();
@@ -1480,9 +1480,9 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $part = $this->encryptMIMEPart($part, $encrypt_params);
         $part->setContents("This message is in MIME format and has been PGP signed and encrypted.\n");
 
-        $charset = Horde_Nls::getEmailCharset();
+        $charset = $GLOBALS['registry']->getEmailCharset();
         $part->setCharset($charset);
-        $part->setDescription(Horde_String::convertCharset(_("PGP Signed/Encrypted Data"), Horde_Nls::getCharset(), $charset));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Signed/Encrypted Data"), $GLOBALS['registry']->getCharset(), $charset));
 
         return $part;
     }
@@ -1497,11 +1497,11 @@ class Horde_Crypt_Pgp extends Horde_Crypt
      */
     public function publicKeyMIMEPart($key)
     {
-        $charset = Horde_Nls::getEmailCharset();
+        $charset = $GLOBALS['registry']->getEmailCharset();
         $part = new Horde_Mime_Part();
         $part->setType('application/pgp-keys');
         $part->setCharset($charset);
-        $part->setDescription(Horde_String::convertCharset(_("PGP Public Key"), Horde_Nls::getCharset(), $charset));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Public Key"), $GLOBALS['registry']->getCharset(), $charset));
         $part->setContents($key);
 
         return $part;
index 856cf82..f8c7a28 100644 (file)
@@ -276,11 +276,11 @@ class Horde_Crypt_Smime extends Horde_Crypt
         $message = $this->encrypt($mime_part->toString(array('headers' => true, 'canonical' => true)), $params);
 
         /* Get charset for mime part description. */
-        $charset = Horde_Nls::getEmailCharset();
+        $charset = $GLOBALS['registry']->getEmailCharset();
 
         $msg = new Horde_Mime_Part();
         $msg->setCharset($charset);
-        $msg->setDescription(Horde_String::convertCharset(_("S/MIME Encrypted Message"), Horde_Nls::getCharset(), $charset));
+        $msg->setDescription(Horde_String::convertCharset(_("S/MIME Encrypted Message"), $GLOBALS['registry']->getCharset(), $charset));
         $msg->setDisposition('inline');
         $msg->setType('application/pkcs7-mime');
         $msg->setContentTypeParameter('smime-type', 'enveloped-data');
index f1ef6ed..e0a2a86 100644 (file)
@@ -5,17 +5,8 @@ Bug #6601
 --FILE--
 <?php
 
-// Fake preferences class to set the timezone to a consistent value.
-class mock_prefs {
-    function getValue($key)
-    {
-        return 'GMT';
-    }
-}
-$GLOBALS['prefs'] = new mock_prefs();
+@date_default_timezone_set('GMT');
 
-require_once 'Horde/Nls.php';
-Horde_Nls::setTimezone();
 require 'pgp.inc';
 
 echo $pgp->pgpPrettyKey(file_get_contents(dirname(__FILE__) . '/fixtures/bug_6601.asc'));
index a2e6af7..2518704 100644 (file)
@@ -5,17 +5,8 @@ Horde_Crypt_pgp::decrypt() signature.
 --FILE--
 <?php
 
-// Fake preferences class to set the timezone to a consistent value.
-class mock_prefs {
-    function getValue($key)
-    {
-        return 'GMT';
-    }
-}
-$GLOBALS['prefs'] = new mock_prefs();
+date_default_timezone_set('GMT');
 
-require_once 'Horde/Nls.php';
-Horde_Nls::setTimezone();
 require 'pgp.inc';
 
 echo $pgp->decrypt(file_get_contents(dirname(__FILE__) . '/fixtures/clear.txt'),
index 674383f..d4d022e 100644 (file)
@@ -88,14 +88,14 @@ class Horde_Data_Csv extends Horde_Data_Base
         if ($header) {
             $head = Horde_File_Csv::read($filename, $conf);
             if (!empty($charset)) {
-                $head = Horde_String::convertCharset($head, $charset, Horde_Nls::getCharset());
+                $head = Horde_String::convertCharset($head, $charset, $GLOBALS['registry']->getCharset());
             }
         }
 
         $data = array();
         while ($line = Horde_File_Csv::read($filename, $conf)) {
             if (!empty($charset)) {
-                $line = Horde_String::convertCharset($line, $charset, Horde_Nls::getCharset());
+                $line = Horde_String::convertCharset($line, $charset, $GLOBALS['registry']->getCharset());
             }
             if (!isset($head)) {
                 $data[] = $line;
@@ -232,7 +232,7 @@ class Horde_Data_Csv extends Horde_Data_Base
                 $line_no = 1;
                 while ($line_no < 3 && $line = fgets($fp)) {
                     if (!empty($_SESSION['import_data']['charset'])) {
-                        $line = Horde_String::convertCharset($line, $_SESSION['import_data']['charset'], Horde_Nls::getCharset());
+                        $line = Horde_String::convertCharset($line, $_SESSION['import_data']['charset'], $GLOBALS['registry']->getCharset());
                     }
                     $newline = Horde_String::length($line) > 100 ? "\n" : '';
                     $_SESSION['import_data']['first_lines'] .= substr($line, 0, 100) . $newline;
index 223597e..d0e5162 100644 (file)
@@ -451,7 +451,7 @@ class DataTree_sql extends DataTree {
             return null;
         } else {
             $name = Horde_String::convertCharset($name, $this->_params['charset'],
-                                           Horde_Nls::getCharset());
+                                           $GLOBALS['registry']->getCharset());
             // Get the parent names, if any.
             $parent = $this->getParentById($id);
             if ($parent && !is_a($parent, 'PEAR_Error') &&
@@ -524,7 +524,7 @@ class DataTree_sql extends DataTree {
             } else {
                 require_once 'Horde/Serialize.php';
                 $ser = Horde_Serialize::UTF7_BASIC;
-                $data = Horde_Serialize::serialize($object->getData(), $ser, Horde_Nls::getCharset());
+                $data = Horde_Serialize::serialize($object->getData(), $ser, $GLOBALS['registry']->getCharset());
             }
         } else {
             $fullname = $object;
@@ -599,7 +599,7 @@ class DataTree_sql extends DataTree {
                  ' VALUES (?, ?, ?, ?, ?, ?, ?, ?)';
         $values = array((int)$id,
                         $this->_params['group'],
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         is_null($order) ? NULL : (int)$order,
                         $data,
                         (string)$GLOBALS['registry']->getAuth(),
@@ -978,7 +978,7 @@ class DataTree_sql extends DataTree {
         $id = $this->getId($old_object);
         $query = 'UPDATE ' . $this->_params['table'] .
                  ' SET datatree_name = ? WHERE datatree_id = ?';
-        $values = array(Horde_String::convertCharset($new_object_name, Horde_Nls::getCharset(), $this->_params['charset']),
+        $values = array(Horde_String::convertCharset($new_object_name, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)$id);
 
         Horde::logMessage('SQL Query by DataTree_sql::rename(): ' . $query . ', ' . var_export($values, true), 'DEBUG');
@@ -1015,11 +1015,11 @@ class DataTree_sql extends DataTree {
             $data = array();
             foreach ($result as $id => $row) {
                 $data[$id] = Horde_Serialize::unserialize($row[0], $row[1],
-                                                          Horde_Nls::getCharset());
+                                                          $GLOBALS['registry']->getCharset());
                 /* Convert old data to the new format. */
                 if ($row[1] == Horde_Serialize::BASIC) {
                     $data[$id] = Horde_String::convertCharset($data[$id],
-                                                        Horde_Nls::getCharset(true));
+                                                        $GLOBALS['registry']->getCharset(true));
                 }
 
                 $data[$id] = (is_null($data[$id]) || !is_array($data[$id]))
@@ -1039,10 +1039,10 @@ class DataTree_sql extends DataTree {
 
             $data = Horde_Serialize::unserialize($row['datatree_data'],
                                                  $row['datatree_serialized'],
-                                                 Horde_Nls::getCharset());
+                                                 $GLOBALS['registry']->getCharset());
             /* Convert old data to the new format. */
             if ($row['datatree_serialized'] == Horde_Serialize::BASIC) {
-                $data = Horde_String::convertCharset($data, Horde_Nls::getCharset(true));
+                $data = Horde_String::convertCharset($data, $GLOBALS['registry']->getCharset(true));
             }
             return (is_null($data) || !is_array($data)) ? array() : $data;
         }
@@ -1090,7 +1090,7 @@ class DataTree_sql extends DataTree {
                 }
                 $data[$row['datatree_id']][] = array('name' => $row['name'],
                                                      'key' => $row['key'],
-                                                     'value' => Horde_String::convertCharset($row['value'], $this->_params['charset'], Horde_Nls::getCharset()));
+                                                     'value' => Horde_String::convertCharset($row['value'], $this->_params['charset'], $GLOBALS['registry']->getCharset()));
             }
             return $data;
         } else {
@@ -1104,7 +1104,7 @@ class DataTree_sql extends DataTree {
             for ($i = 0; $i < count($rows); $i++) {
                 $rows[$i]['value'] = Horde_String::convertCharset($rows[$i]['value'],
                                                             $this->_params['charset'],
-                                                            Horde_Nls::getCharset());
+                                                            $GLOBALS['registry']->getCharset());
             }
             return $rows;
         }
@@ -1808,7 +1808,7 @@ class DataTree_sql extends DataTree {
                 $values = array((int)$id,
                                 $attr['name'],
                                 $attr['key'],
-                                Horde_String::convertCharset($attr['value'], Horde_Nls::getCharset(), $this->_params['charset']));
+                                Horde_String::convertCharset($attr['value'], $GLOBALS['registry']->getCharset(), $this->_params['charset']));
 
                 Horde::logMessage('SQL Query by DataTree_sql::updateData(): ' . $query . ', ' . var_export($values, true), 'DEBUG');
 
@@ -1829,7 +1829,7 @@ class DataTree_sql extends DataTree {
             /* Write to the datatree_data field. */
             require_once 'Horde/Serialize.php';
             $ser = Horde_Serialize::UTF7_BASIC;
-            $data = Horde_Serialize::serialize($object->getData(), $ser, Horde_Nls::getCharset());
+            $data = Horde_Serialize::serialize($object->getData(), $ser, $GLOBALS['registry']->getCharset());
 
             $query = 'UPDATE ' . $this->_params['table'] .
                      ' SET datatree_data = ?, datatree_serialized = ?' .
index 417de41..ca16689 100644 (file)
@@ -213,7 +213,7 @@ try {
                 }
             }
         }
-        echo '<input type="hidden" name="_formvars" value="' . @htmlspecialchars(serialize($vars), ENT_QUOTES, Horde_Nls::getCharset()) . '" />';
+        echo '<input type="hidden" name="_formvars" value="' . @htmlspecialchars(serialize($vars), ENT_QUOTES, $GLOBALS['registry']->getCharset()) . '" />';
     }
 
     function renderFormActive(&$form, &$vars)
index c42864b..8d7ba73 100644 (file)
@@ -304,7 +304,7 @@ class Horde_Group_Kolab extends Horde_Group_Ldap
             }
 
             $groups = array();
-            $current_charset = Horde_Nls::getCharset();
+            $current_charset = $GLOBALS['registry']->getCharset();
             for ($i = 0; $i < $result['count']; $i++) {
                 $utf8_dn = Horde_String::convertCharset($result[$i]['dn'], 'UTF-8', $current_charset);
                 $groups[$utf8_dn] = $this->getGroupName($utf8_dn);
index 7bc2b17..4711c1e 100644 (file)
@@ -370,7 +370,7 @@ class Horde_Group_Ldap extends Horde_Group
      */
     public function getGroupName($dn)
     {
-        $dn = Horde_String::convertCharset($dn, Horde_Nls::getCharset(), 'UTF-8');
+        $dn = Horde_String::convertCharset($dn, $GLOBALS['registry']->getCharset(), 'UTF-8');
         $result = @ldap_explode_dn($dn, 1);
         if ($result === false) {
             throw new Horde_Group_Exception('Invalid group ID passed (bad DN syntax)');
@@ -653,7 +653,7 @@ class Horde_Group_Ldap extends Horde_Group
             }
 
             $groups = array();
-            $current_charset = Horde_Nls::getCharset();
+            $current_charset = $GLOBALS['registry']->getCharset();
             for ($i = 0; $i < $result['count']; $i++) {
                 $utf8_dn = Horde_String::convertCharset($result[$i]['dn'], 'UTF-8', $current_charset);
                 $groups[$utf8_dn] = $this->getGroupName($utf8_dn);
index 776a76e..ad3628b 100644 (file)
@@ -526,7 +526,7 @@ class Kolab {
 
     function &setElemStr(&$parent, $name, $value = '')
     {
-        return $this->setElemVal($parent, $name, Horde_String::convertCharset($value, Horde_Nls::getCharset(), 'utf-8'));
+        return $this->setElemVal($parent, $name, Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), 'utf-8'));
     }
 
     function &setVal($name, $value = '')
@@ -553,7 +553,7 @@ class Kolab {
      */
     function encodeImapFolderName($name)
     {
-        return Horde_String::convertCharset($name, Horde_Nls::getCharset(), 'UTF7-IMAP');
+        return Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), 'UTF7-IMAP');
     }
 
     /**
index 7808e0f..66ea633 100644 (file)
@@ -221,11 +221,11 @@ class Horde_Kolab_Filter_Base
 
         Horde::logMessage(sprintf("Arguments: %s", print_r($values, true)), 'DEBUG');
 
-        Horde_Nls::setCharset('utf-8');
+        $GLOBALS['registry']->setCharset('utf-8');
 
         if (!empty($conf['kolab']['filter']['locale_path'])
             && !empty($conf['kolab']['filter']['locale'])) {
-            Horde_Nls::setTextdomain('Kolab_Filter', $conf['kolab']['filter']['locale_path'], Horde_Nls::getCharset());
+            $GLOBALS['registry']->setTextdomain('Kolab_Filter', $conf['kolab']['filter']['locale_path']);
             setlocale(LC_ALL, $conf['kolab']['filter']['locale']);
         }
 
index 6d8215d..f935b24 100644 (file)
@@ -16,7 +16,7 @@
  */
 require_once 'Horde/Autoloader.php';
 
-Horde_Nls::setCharset('utf-8');
+$registry->setCharset('utf-8');
 
 /** Generate the format handler */
 $format = Horde_Kolab_Format::factory('Xml', 'Event');
index 64feb49..839546b 100644 (file)
@@ -60,7 +60,7 @@ class Horde_Kolab_Format_Xml_String extends Horde_Kolab_Format_Xml
     }
 }
 
-Horde_Nls::setCharset('utf-8');
+$registry->setCharset('utf-8');
 
 /** Generate the format handler */
 $format = Horde_Kolab_Format::factory('Xml', 'String');
index b7252cf..d2a78de 100644 (file)
@@ -775,7 +775,7 @@ class Horde_Kolab_Format_Xml
      */
     protected function _createTextNode($parent, $name, $value)
     {
-        $value = Horde_String::convertCharset($value, Horde_Nls::getCharset(),
+        $value = Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(),
                                               'utf-8');
 
         $node = $this->_xmldoc->createElement($name);
index e39fc8d..acfdbdb 100644 (file)
@@ -42,7 +42,7 @@ extends PHPUnit_Framework_TestCase
      */
     protected function setUp()
     {
-        Horde_Nls::setCharset('utf-8');
+        $GLOBALS['registry']->setCharset('utf-8');
     }
 
     /**
index 640f059..7872c17 100644 (file)
@@ -43,7 +43,7 @@ extends PHPUnit_Framework_TestCase
      */
     protected function setUp()
     {
-        Horde_Nls::setCharset('utf-8');
+        $GLOBALS['registry']->setCharset('utf-8');
         Horde_String::setDefaultCharset('iso-8859-1');
     }
 
index d936c13..fd2b28b 100644 (file)
@@ -42,7 +42,7 @@ extends PHPUnit_Framework_TestCase
      */
     protected function setUp()
     {
-        Horde_Nls::setCharset('utf-8');
+        $GLOBALS['registry']->setCharset('utf-8');
     }
 
     /**
index 3a2cdef..9281a45 100644 (file)
@@ -44,7 +44,7 @@ extends PHPUnit_Framework_TestCase
      */
     protected function setUp()
     {
-        Horde_Nls::setCharset('utf-8');
+        $GLOBALS['registry']->setCharset('utf-8');
     }
 
     /**
@@ -140,4 +140,4 @@ class Horde_Kolab_Format_Xml_Hprefs_Dummy extends Horde_Kolab_Format_Xml_Hprefs
                                    0,
                                    array('type' => self::TYPE_DATETIME));
     }
-}
\ No newline at end of file
+}
index 5189a01..aea4e5a 100644 (file)
@@ -49,7 +49,7 @@ extends PHPUnit_Framework_TestCase
             $this->markTestSkipped('The Horde_Date_Recurrence class is missing.');
         }
 
-        Horde_Nls::setCharset('utf-8');
+        $GLOBALS['registry']->setCharset('utf-8');
 
         $this->_oldTimezone = date_default_timezone_get();
         date_default_timezone_set('Europe/Berlin');
index 91a4a3c..2bf0d2b 100644 (file)
@@ -42,7 +42,7 @@ extends PHPUnit_Framework_TestCase
      */
     protected function setUp()
     {
-        Horde_Nls::setCharset('utf-8');
+        $GLOBALS['registry']->setCharset('utf-8');
     }
 
 
index a907aec..67a7c11 100644 (file)
@@ -84,7 +84,7 @@ implements Iterator
      */
     public function __construct()
     {
-        $this->_charset = Horde_Nls::getCharset();
+        $this->_charset = $GLOBALS['registry']->getCharset();
         if (empty($this->_primaryPersonalNamespace)) {
             $personal = null;
             foreach ($this->_namespaces as $namespace) {
index 8e91fa5..d77c657 100644 (file)
@@ -902,7 +902,7 @@ implements Horde_Kolab_Storage_Folder
                 $part = new Horde_Mime_Part();
                 $part->setType(isset($data['type']) ? $data['type'] : null);
                 $part->setContents(isset($data['content']) ? $data['content'] : file_get_contents($data['path']));
-                $part->setCharset(Horde_Nls::getCharset());
+                $part->setCharset($GLOBALS['registry']->getCharset());
                 $part->setTransferEncoding('quoted-printable');
                 $part->setDisposition('attachment');
                 $part->setName($attachment);
@@ -925,7 +925,7 @@ implements Horde_Kolab_Storage_Folder
             $part = new Horde_Mime_Part();
             $part->setType($handlers[$type]->getMimeType());
             $part->setContents($new_content);
-            $part->setCharset(Horde_Nls::getCharset());
+            $part->setCharset($GLOBALS['registry']->getCharset());
             $part->setTransferEncoding('quoted-printable');
             $part->setDisposition($handlers[$type]->getDisposition());
             $part->setDispositionParameter('x-kolab-type', $type);
@@ -1056,8 +1056,8 @@ implements Horde_Kolab_Storage_Folder
         $part = new Horde_Mime_Part();
         $part->setType('text/plain');
         $part->setName('Kolab Groupware Information');
-        $part->setContents(Horde_String::wrap($kolab_text, 76, "\r\n", Horde_Nls::getCharset()));
-        $part->setCharset(Horde_Nls::getCharset());
+        $part->setContents(Horde_String::wrap($kolab_text, 76, "\r\n", $GLOBALS['registry']->getCharset()));
+        $part->setCharset($GLOBALS['registry']->getCharset());
 
         $part->setTransferEncoding('quoted-printable');
         $mime_message->addPart($part);
index 6dbe68c..9bc5962 100644 (file)
@@ -42,7 +42,7 @@ extends PHPUnit_Framework_TestCase
 
     public function testGetNamespaceReturnsNamespaceHandler()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         $driver = new Horde_Kolab_Storage_Driver_Cclient(
             $this->group,
             array()
@@ -55,7 +55,7 @@ extends PHPUnit_Framework_TestCase
 
     public function testGetNamespaceReturnsExpectedNamespaces()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         $driver = new Horde_Kolab_Storage_Driver_Cclient(
             $this->group,
             array()
index 9fda3b2..a47e191 100644 (file)
@@ -42,7 +42,7 @@ extends PHPUnit_Framework_TestCase
 
     public function testGetNamespaceReturnsNamespaceHandler()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         $driver = new Horde_Kolab_Storage_Driver_Imap(
             $this->_getNamespaceMock(),
             $this->group,
@@ -56,7 +56,7 @@ extends PHPUnit_Framework_TestCase
 
     public function testGetNamespaceReturnsExpectedNamespaces()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         $driver = new Horde_Kolab_Storage_Driver_Imap(
             $this->_getNamespaceMock(),
             $this->group,
index 77e41cb..0f6b440 100644 (file)
@@ -58,7 +58,7 @@ extends PHPUnit_Framework_TestCase
 
     public function testGetNamespaceReturnsNamespaceHandler()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         $driver = new Horde_Kolab_Storage_Driver_Mock(
             $this->group,
             array()
@@ -71,7 +71,7 @@ extends PHPUnit_Framework_TestCase
 
     public function testGetNamespaceReturnsExpectedNamespaces()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         $driver = new Horde_Kolab_Storage_Driver_Mock(
             $this->group,
             array()
index dbc334d..517e0e6 100644 (file)
@@ -42,7 +42,7 @@ extends PHPUnit_Framework_TestCase
 
     public function testGetNamespaceReturnsNamespaceHandler()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         $driver = new Horde_Kolab_Storage_Driver_Pear(
             $this->_getNamespaceMock(),
             $this->group,
@@ -56,7 +56,7 @@ extends PHPUnit_Framework_TestCase
 
     public function testGetNamespaceReturnsExpectedNamespaces()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         $driver = new Horde_Kolab_Storage_Driver_Pear(
             $this->_getNamespaceMock(),
             $this->group,
index da160bf..2e24a98 100644 (file)
@@ -88,7 +88,7 @@ class Horde_Kolab_Storage_FolderTest extends PHPUnit_Framework_TestCase
         $folder = new Horde_Kolab_Storage_Folder_Base('INBOX/Contacts');
         $folder->restore($storage, $connection);
         $folder->setName('TestAÖÜ');
-        $this->assertEquals(Horde_String::convertCharset('INBOX/TestAÖÜ', Horde_Nls::getCharset(), 'UTF7-IMAP'), $folder->new_name);
+        $this->assertEquals(Horde_String::convertCharset('INBOX/TestAÖÜ', $GLOBALS['registry']->getCharset(), 'UTF7-IMAP'), $folder->new_name);
     }
 
     /**
index bbdce74..3d0784e 100644 (file)
@@ -72,7 +72,7 @@ class Horde_Kolab_Storage_NamespaceTest extends PHPUnit_Framework_TestCase
 
     public function testFolderTitleConvertsUtf7()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         foreach ($this->_getNamespaces() as $namespace) {
             $name = Horde_String::convertCharset('äöü', 'UTF8', 'UTF7-IMAP');
             $folder = $this->_getFolder('INBOX/' . $name, $namespace);
@@ -190,7 +190,7 @@ class Horde_Kolab_Storage_NamespaceTest extends PHPUnit_Framework_TestCase
 
     public function testSetnameConvertsToUtf7()
     {
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
         foreach ($this->_getNamespaces() as $namespace) {
             $folder = $this->_getFolder(null, $namespace);
             $folder->restore($this->_storage, $this->_connection);
index 51507db..d08c329 100644 (file)
@@ -48,7 +48,7 @@ class Horde_Kolab_Storage_Server_DriverTest extends PHPUnit_Framework_TestCase
         }
 
         /** @todo: FIXME -> required for namespace handling */
-        Horde_Nls::setCharset('UTF8');
+        $GLOBALS['registry']->setCharset('UTF8');
 
         /** Setup group handler */
         require_once 'Horde/Group.php';
index 583a55d..e21d883 100644 (file)
@@ -97,7 +97,7 @@ class Horde_Mime
     static public function encode($text, $charset = null)
     {
         if (is_null($charset)) {
-            $charset = Horde_Nls::getCharset();
+            $charset = $GLOBALS['registry']->getCharset();
         }
         $charset = Horde_String::lower($charset);
 
@@ -322,7 +322,7 @@ class Horde_Mime
         $rest = substr($string, (strlen($preceding . $charset . $encoding . $encoded_text) + 6));
 
         if (is_null($to_charset)) {
-            $to_charset = Horde_Nls::getCharset();
+            $to_charset = $GLOBALS['registry']->getCharset();
         }
 
         switch ($encoding) {
index a643c43..e5513d3 100644 (file)
@@ -179,7 +179,7 @@ class Horde_Mime_Mdn
         $msg->setType('multipart/report');
         $msg->setContentTypeParameter('report-type', 'disposition-notification');
 
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
 
         /* The first part is a human readable message. */
         $part_one = new Horde_Mime_Part('text/plain');
index 859ced9..6b8bbf0 100644 (file)
@@ -95,7 +95,7 @@ class Horde_Mime_Viewer_Css extends Horde_Mime_Viewer_Source
             $this->_mimepart->getMimeId() => array(
                 'data' => $this->_lineNumber(trim($css)),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 7d56c95..8a02c67 100644 (file)
@@ -78,7 +78,7 @@ class Horde_Mime_Viewer_Deb extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => '<pre>' . htmlspecialchars($data) . '</pre>',
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index f730fb2..92ee224 100644 (file)
@@ -64,7 +64,7 @@ class Horde_Mime_Viewer_Enriched extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => Horde_String::convertCharset($this->_toHTML(true), $this->_mimepart->getCharset()),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index f3c2f44..cf79886 100644 (file)
@@ -36,7 +36,7 @@ class Horde_Mime_Viewer_Enscript extends Horde_Mime_Viewer_Source
             $this->_mimepart->getMimeId() => array(
                 'data' => $this->_toHTML(),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
@@ -52,7 +52,7 @@ class Horde_Mime_Viewer_Enscript extends Horde_Mime_Viewer_Source
             $this->_mimepart->getMimeId() => array(
                 'data' => $this->_toHTML(),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index eb479e5..4509ef1 100644 (file)
@@ -72,7 +72,7 @@ class Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => Horde_String::convertCharset($html['data'], $this->_mimepart->getCharset()),
                 'status' => $html['status'],
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 7f7cc92..caed161 100644 (file)
@@ -50,7 +50,7 @@ class Horde_Mime_Viewer_Msexcel extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => file_get_contents($tmp_out),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 40aaaf9..0e5c77f 100644 (file)
@@ -53,7 +53,7 @@ class Horde_Mime_Viewer_Mspowerpoint extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $data,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 02c400c..6b3ec03 100644 (file)
@@ -59,7 +59,7 @@ class Horde_Mime_Viewer_Msword extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $data,
                 'status' => array(),
-                'type' => $type . '; charset=' . Horde_Nls::getCharset()
+                'type' => $type . '; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index a53825f..5753893 100644 (file)
@@ -65,7 +65,7 @@ class Horde_Mime_Viewer_Php extends Horde_Mime_Viewer_Source
             $this->_mimepart->getMimeId() => array(
                 'data' => $text,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 9068539..71d3597 100644 (file)
@@ -71,7 +71,7 @@ class Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $data,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 1f80551..6a22a7b 100644 (file)
@@ -65,7 +65,7 @@ class Horde_Mime_Viewer_Rar extends Horde_Mime_Viewer_Driver
         $rar = Horde_Compress::factory('rar');
         $rarData = $rar->decompress($contents);
 
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
         $fileCount = count($rarData);
 
         $name = $this->_mimepart->getName(true);
index e3df91c..226cda5 100644 (file)
@@ -36,7 +36,7 @@ class Horde_Mime_Viewer_Rfc822 extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $this->_mimepart->getContents(),
                 'status' => array(),
-                'type' => 'text/plain; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/plain; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
@@ -85,7 +85,7 @@ class Horde_Mime_Viewer_Rfc822 extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => empty($header_output) ? '' : ('<div class="fixed mimeHeaders">' . Horde_Text_Filter::filter(implode("<br />\n", $header_output), 'emails') . '</div>'),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index f8c33b2..ef39696 100644 (file)
@@ -73,7 +73,7 @@ class Horde_Mime_Viewer_Richtext extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => Horde_String::convertCharset($this->_toHTML(), $this->_mimepart->getCharset()),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 2e4de1f..a16dda9 100644 (file)
@@ -79,7 +79,7 @@ class Horde_Mime_Viewer_Rpm extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => '<pre>' . htmlentities($data) . '</pre>',
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 1404ad7..75a29f0 100644 (file)
@@ -57,7 +57,7 @@ class Horde_Mime_Viewer_Rtf extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $data,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 2f93f0c..a956aed 100644 (file)
@@ -70,7 +70,7 @@ class Horde_Mime_Viewer_Smil extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $this->_content,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index c765b44..8c688e0 100644 (file)
@@ -79,7 +79,7 @@ class Horde_Mime_Viewer_Srchighlite extends Horde_Mime_Viewer_Source
             $this->_mimepart->getMimeId() => array(
                 'data' => $this->_lineNumber($results),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 9449bf6..0883b0a 100644 (file)
@@ -92,7 +92,7 @@ class Horde_Mime_Viewer_Tgz extends Horde_Mime_Viewer_Driver
         $tar = Horde_Compress::factory('tar');
         $tarData = $tar->decompress($contents);
 
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
         $fileCount = count($tarData);
 
         $name = $this->_mimepart->getName(true);
index 5bd6df3..6fc3643 100644 (file)
@@ -79,7 +79,7 @@ class Horde_Mime_Viewer_Tnef extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $data,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 8549151..ce96ba5 100644 (file)
@@ -401,7 +401,7 @@ class Horde_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => Horde::endBuffer() . $html,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index d076005..8533c3e 100644 (file)
@@ -102,7 +102,7 @@ class Horde_Mime_Viewer_Webcpp extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $results,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 4b11df7..c6bd76d 100644 (file)
@@ -57,7 +57,7 @@ class Horde_Mime_Viewer_Wordperfect extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $data,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 0d38b33..1089f7d 100644 (file)
@@ -114,7 +114,7 @@ class Horde_Mime_Viewer_Zip extends Horde_Mime_Viewer_Driver
                 Horde_String::pad(_("Ratio"), 10, ' ', STR_PAD_LEFT) .
                 "\n",
                 'space2html',
-                array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)
+                array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)
             ) . str_repeat('-', 59 + $maxlen) . "\n";
 
         foreach ($zipInfo as $key => $val) {
@@ -131,7 +131,7 @@ class Horde_Mime_Viewer_Zip extends Horde_Mime_Viewer_Driver
 
             reset($val);
             while (list($k, $v) = each($val)) {
-                $val[$k] = Horde_Text_Filter::filter($v, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true));
+                $val[$k] = Horde_Text_Filter::filter($v, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
             }
 
             if (!is_null($this->_callback)) {
@@ -147,7 +147,7 @@ class Horde_Mime_Viewer_Zip extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => nl2br($text . str_repeat('-', 59 + $maxlen) . "\n</span></td></tr></table>"),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 9468c58..3944323 100644 (file)
@@ -131,7 +131,7 @@ if (document.getElementById(%1$s)){
             }
         }
         echo '<input type="hidden" name="_formvars" value="'
-            . htmlspecialchars(serialize($vars), ENT_QUOTES, Horde_Nls::getCharset())
+            . htmlspecialchars(serialize($vars), ENT_QUOTES, $GLOBALS['registry']->getCharset())
             . '" />';
     }
 
index e164d3b..be1b5ad 100644 (file)
@@ -91,7 +91,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
             . 'id="%2$s" value="%3$s"%4$s%5$s%6$s />',
             ($var->isDisabled() ? ' form-input-disabled" ' : ''),
             $var->getVarName(),
-            htmlspecialchars($var->getValue($vars), ENT_QUOTES, Horde_Nls::getCharset()),
+            htmlspecialchars($var->getValue($vars), ENT_QUOTES, $GLOBALS['registry']->getCharset()),
             ($var->isDisabled() ? ' disabled="disabled" ' : ''),
             ($var->type->maxlength ? ' maxlength="' . $var->type->maxlength . '"' : ''),
             $this->_getActionScripts($form, $var)
@@ -113,7 +113,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
         return sprintf(
             '<input type="text" class="form-input-phone" name="%1$s" id="%1$s" value="%2$s" %3$s%4$s />',
             $var->getVarName(),
-            htmlspecialchars($var->getValue($vars), ENT_QUOTES, Horde_Nls::getCharset()),
+            htmlspecialchars($var->getValue($vars), ENT_QUOTES, $GLOBALS['registry']->getCharset()),
             ($var->isDisabled() ? ' disabled="disabled" ' : ''),
             $this->_getActionScripts($form, $var)
         );
@@ -128,7 +128,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
     {
         return sprintf('    <input type="text" class="form-input-ipaddress" name="%1$s" id="%1$s" value="%2$s" %3$s%4$s />',
                        $var->getVarName(),
-                       htmlspecialchars($var->getValue($vars), ENT_QUOTES, Horde_Nls::getCharset()),
+                       htmlspecialchars($var->getValue($vars), ENT_QUOTES, $GLOBALS['registry']->getCharset()),
                        $var->isDisabled() ? ' disabled="disabled" ' : '',
                        $this->_getActionScripts($form, $var)
                );
@@ -454,7 +454,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
         $prompt = $var->type->prompt;
         $htmlchars = $var->getOption('htmlchars');
         if ($prompt) {
-            $prompt = '<option value="">' . ($htmlchars ? htmlspecialchars($prompt, ENT_QUOTES, Horde_Nls::getCharset()) : $prompt) . '</option>';
+            $prompt = '<option value="">' . ($htmlchars ? htmlspecialchars($prompt, ENT_QUOTES, $GLOBALS['registry']->getCharset()) : $prompt) . '</option>';
         }
         return sprintf('    <select name="%1$s" id="%1$s"%2$s>%3$s%4$s    </select>',
                $var->getVarName(),
@@ -483,7 +483,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
         /* Hidden tag to store the current first level. */
         $html = sprintf('    <input type="hidden" name="%1$s[old]" id="%1$s[old]" value="%2$s" />',
                         $varname,
-                        htmlspecialchars($selected['1'], ENT_QUOTES, Horde_Nls::getCharset()));
+                        htmlspecialchars($selected['1'], ENT_QUOTES, $GLOBALS['registry']->getCharset()));
 
         /* First level. */
         $values_1 = Horde_Array::valuesToKeys(array_keys($values));
@@ -492,7 +492,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
                          'if (this.value) { document.' . $form->getName() . '.formname.value=\'\';' . 'document.' . $form->getName() . '.submit() }',
                          ($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : ''));
         if (!empty($prompts)) {
-            $html .= '<option value="">' . htmlspecialchars($prompts[0], ENT_QUOTES, Horde_Nls::getCharset()) . '</option>';
+            $html .= '<option value="">' . htmlspecialchars($prompts[0], ENT_QUOTES, $GLOBALS['registry']->getCharset()) . '</option>';
         }
         $html .= $this->_selectOptions($values_1, $selected['1']);
         $html .= '    </select>';
@@ -502,7 +502,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
                          $varname,
                          ($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : ''));
         if (!empty($prompts)) {
-            $html .= '<option value="">' . htmlspecialchars($prompts[1], ENT_QUOTES, Horde_Nls::getCharset()) . '</option>';
+            $html .= '<option value="">' . htmlspecialchars($prompts[1], ENT_QUOTES, $GLOBALS['registry']->getCharset()) . '</option>';
         }
         $values_2 = array();
         if (!empty($selected['1'])) {
@@ -774,7 +774,7 @@ EOT;
     function _renderVarDisplayDefault($form, $var, $vars)
     {
         return nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES,
-            Horde_Nls::getCharset()));
+            $GLOBALS['registry']->getCharset()));
     }
 
     function _renderVarDisplay_html($form, $var, $vars)
@@ -818,7 +818,7 @@ EOT;
             return Horde::link($mail_link, $email_val)
                 . htmlspecialchars($display_email) . '</a>';
         } else {
-            return nl2br(htmlspecialchars($display_email, ENT_QUOTES, Horde_Nls::getCharset()));
+            return nl2br(htmlspecialchars($display_email, ENT_QUOTES, $GLOBALS['registry']->getCharset()));
         }
     }
 
@@ -849,7 +849,7 @@ EOT;
         if (count($values) == 0) {
             return _("No values");
         } elseif (isset($values[$value]) && $value != '') {
-            return htmlspecialchars($values[$value], ENT_QUOTES, Horde_Nls::getCharset());
+            return htmlspecialchars($values[$value], ENT_QUOTES, $GLOBALS['registry']->getCharset());
         }
     }
 
@@ -859,7 +859,7 @@ EOT;
         if (count($values) == 0) {
             return _("No values");
         } elseif (isset($values[$var->getValue($vars)])) {
-            return htmlspecialchars($values[$var->getValue($vars)], ENT_QUOTES, Horde_Nls::getCharset());
+            return htmlspecialchars($values[$var->getValue($vars)], ENT_QUOTES, $GLOBALS['registry']->getCharset());
         }
     }
 
@@ -876,7 +876,7 @@ EOT;
                     $display[] = $name;
                 }
             }
-            return htmlspecialchars(implode(', ', $display), ENT_QUOTES, Horde_Nls::getCharset());
+            return htmlspecialchars(implode(', ', $display), ENT_QUOTES, $GLOBALS['registry']->getCharset());
         }
     }
 
@@ -893,7 +893,7 @@ EOT;
                     $display[] = $name;
                 }
             }
-            return htmlspecialchars(implode(', ', $display), ENT_QUOTES, Horde_Nls::getCharset());
+            return htmlspecialchars(implode(', ', $display), ENT_QUOTES, $GLOBALS['registry']->getCharset());
         }
     }
 
@@ -1064,7 +1064,7 @@ EOT;
             }
         }
 
-        $html = nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES, Horde_Nls::getCharset()));
+        $html = nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES, $GLOBALS['registry']->getCharset()));
         if (!empty($mapurl)) {
             $html .= '&nbsp;&nbsp;' . Horde::link(Horde::externalUrl($mapurl), $desc, null, '_blank') . Horde::img($icon, $desc) . '</a>';
         }
@@ -1102,7 +1102,7 @@ EOT;
     function _renderVarDisplay_invalid($form, $var, $vars)
     {
         return '<p class="form-error form-inline">'
-                . htmlspecialchars($var->type->message, ENT_QUOTES, Horde_Nls::getCharset())
+                . htmlspecialchars($var->type->message, ENT_QUOTES, $GLOBALS['registry']->getCharset())
                 . '</p>';
     }
 
@@ -1221,7 +1221,7 @@ EOT;
                 $selected = '';
             }
             $result .= '        <option value="';
-            $result .= ($htmlchars) ? htmlspecialchars($value, ENT_QUOTES, Horde_Nls::getCharset()) : $value;
+            $result .= ($htmlchars) ? htmlspecialchars($value, ENT_QUOTES, $GLOBALS['registry']->getCharset()) : $value;
             $result .= '"' . $selected . '>';
             $result .= ($htmlchars) ? htmlspecialchars($display) : $display;
             $result .= "</option>\n";
@@ -1241,7 +1241,7 @@ EOT;
                 $selected = '';
             }
             $result .= " <option value=\""
-                . htmlspecialchars($value, ENT_QUOTES, Horde_Nls::getCharset())
+                . htmlspecialchars($value, ENT_QUOTES, $GLOBALS['registry']->getCharset())
                 . "\"$selected>" . htmlspecialchars($display) . "</option>\n";
         }
 
index 081da8b..ec721c8 100644 (file)
@@ -1,28 +1,30 @@
 <?php
 /**
  * The Horde_Nls:: class provides Native Language Support. This includes
- * common methods for handling language detection and selection, timezones,
- * and hostname->country lookups.
+ * common methods for handling language data, timezones, and hostname->country
+ * lookups.
  *
  * Copyright 1999-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  Jon Parise <jon@horde.org>
- * @author  Chuck Hagenbuch <chuck@horde.org>
- * @author  Jan Schneider <jan@horde.org>
- * @author  Michael Slusarz <slusarz@horde.org>
- * @package Nls
+ * @author   Jon Parise <jon@horde.org>
+ * @author   Chuck Hagenbuch <chuck@horde.org>
+ * @author   Jan Schneider <jan@horde.org>
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package  Nls
  */
 class Horde_Nls
 {
     /**
-     * Config values.
+     * DNS resolver.
      *
-     * @var array
+     * @var Net_DNS_Resolver
      */
-    static public $config = array();
+    static public $dnsResolver;
 
     /**
      * Cached values.
@@ -32,316 +34,6 @@ class Horde_Nls
     static protected $_cache = array();
 
     /**
-     * Selects the most preferred language for the current client session.
-     *
-     * @return string  The selected language abbreviation.
-     */
-    static public function select()
-    {
-        $lang = Horde_Util::getFormData('new_lang');
-
-        /* First, check if language pref is locked and, if so, set it to its
-         * value */
-        if (isset($GLOBALS['prefs']) &&
-            $GLOBALS['prefs']->isLocked('language')) {
-            $language = $GLOBALS['prefs']->getValue('language');
-        /* Check if the user selected a language from the login screen */
-        } elseif (!empty($lang) && self::isValid($lang)) {
-            $language = $lang;
-        /* Check if we have a language set in the session */
-        } elseif (isset($_SESSION['horde_language'])) {
-            $language = $_SESSION['horde_language'];
-        /* Use site-wide default, if one is defined */
-        } elseif (!empty(self::$config['defaults']['language'])) {
-            $language = self::$config['defaults']['language'];
-        /* Try browser-accepted languages. */
-        } elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
-            /* The browser supplies a list, so return the first valid one. */
-            $browser_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
-            foreach ($browser_langs as $lang) {
-                /* Strip quality value for language */
-                if (($pos = strpos($lang, ';')) !== false) {
-                    $lang = substr($lang, 0, $pos);
-                }
-                $lang = self::_map(trim($lang));
-                if (self::isValid($lang)) {
-                    $language = $lang;
-                    break;
-                }
-
-                /* In case there's no full match, save our best guess. Try
-                 * 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 (self::isValid($ll_LL)) {
-                        $partial_lang = $ll_LL;
-                    } else {
-                        $ll = self::_map(substr($lang, 0, 2));
-                        if (self::isValid($ll))  {
-                            $partial_lang = $ll;
-                        }
-                    }
-                }
-            }
-        }
-
-        if (!isset($language)) {
-            $language = isset($partial_lang)
-                ? $partial_lang
-                /* No dice auto-detecting, default to US English. */
-                : 'en_US';
-        }
-
-        return basename($language);
-    }
-
-    /**
-     * Sets the language.
-     *
-     * @param string $lang  The language abbreviation.
-     *
-     * @throws Horde_Exception
-     */
-    static public function setLanguage($lang = null)
-    {
-        Horde::loadConfiguration('nls.php', null, 'horde');
-
-        if (empty($lang) || !self::isValid($lang)) {
-            $lang = self::select();
-        }
-
-        $_SESSION['horde_language'] = $lang;
-
-        if (isset($GLOBALS['language'])) {
-            if ($GLOBALS['language'] == $lang) {
-                return;
-            } elseif (isset($GLOBALS['registry'])) {
-                $GLOBALS['registry']->clearCache();
-            }
-        }
-        $GLOBALS['language'] = $lang;
-
-        /* First try language with the current charset. */
-        $lang_charset = $lang . '.' . self::getCharset();
-        if ($lang_charset != setlocale(LC_ALL, $lang_charset)) {
-            /* Next try language with its default charset. */
-            $charset = empty(self::$config['charsets'][$lang])
-                ? 'ISO-8859-1'
-                : self::$config['charsets'][$lang];
-            $lang_charset = $lang . '.' . $charset;
-            self::_cachedCharset(0, $charset);
-            if ($lang_charset != setlocale(LC_ALL, $lang_charset)) {
-                /* At last try language solely. */
-                $lang_charset = $lang;
-                setlocale(LC_ALL, $lang_charset);
-            }
-        }
-
-        @putenv('LC_ALL=' . $lang_charset);
-        @putenv('LANG=' . $lang_charset);
-        @putenv('LANGUAGE=' . $lang_charset);
-    }
-
-    /**
-     * Sets the gettext domain.
-     *
-     * @param string $app        The application name.
-     * @param string $directory  The directory where the application's
-     *                           LC_MESSAGES directory resides.
-     * @param string $charset    The charset.
-     */
-    static public function setTextdomain($app, $directory, $charset)
-    {
-        bindtextdomain($app, $directory);
-        textdomain($app);
-
-        /* The existence of this function depends on the platform. */
-        if (function_exists('bind_textdomain_codeset')) {
-            self::_cachedCharset(0, bind_textdomain_codeset($app, $charset));
-        }
-
-        if (!headers_sent()) {
-            header('Content-Type: text/html; charset=' . $charset);
-        }
-    }
-
-    /**
-     * Sets the language and reloads the whole NLS environment.
-     *
-     * When setting the language, the gettext catalogs have to be reloaded
-     * too, charsets have to be updated etc. This method takes care of all
-     * this.
-     *
-     * @param string $language  The new language.
-     * @param string $app       The application for reloading the gettext
-     *                          catalog. The current application if empty.
-     */
-    static public function setLanguageEnvironment($language = null, $app = null)
-    {
-        if (empty($app)) {
-            $app = $GLOBALS['registry']->getApp();
-        }
-        self::setLanguage($language);
-        self::setTextdomain(
-            $app,
-            $GLOBALS['registry']->get('fileroot', $app) . '/locale',
-            self::getCharset()
-        );
-        Horde_String::setDefaultCharset(self::getCharset());
-    }
-
-    /**
-     * 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.
-     */
-    static public function isValid($language)
-    {
-        return !empty(self::$config['languages'][$language]);
-    }
-
-    /**
-     * Maps languages with common two-letter codes (such as nl) to the
-     * full gettext code (in this case, nl_NL). Returns the language
-     * unmodified if it isn't an alias.
-     *
-     * @param string $language  The language code to map.
-     *
-     * @return string  The mapped language code.
-     */
-    static protected function _map($language)
-    {
-        // Translate the $language to get broader matches.
-        // (eg. de-DE should match de_DE)
-        $trans_lang = str_replace('-', '_', $language);
-        $lang_parts = explode('_', $trans_lang);
-        $trans_lang = Horde_String::lower($lang_parts[0]);
-        if (isset($lang_parts[1])) {
-            $trans_lang .= '_' . Horde_String::upper($lang_parts[1]);
-        }
-
-        // See if we get a match for this
-        if (!empty(self::$config['aliases'][$trans_lang])) {
-            return self::$config['aliases'][$trans_lang];
-        }
-
-        // If we get that far down, the language cannot be found.
-        // Return $trans_lang.
-        return $trans_lang;
-    }
-
-    /**
-     * Returns the charset for the current language.
-     *
-     * @param boolean $original  If true returns the original charset of the
-     *                           translation, the actually used one otherwise.
-     *
-     * @return string  The character set that should be used with the current
-     *                 locale settings.
-     */
-    static public function getCharset($original = false)
-    {
-        /* Get cached results. */
-        $cacheKey = intval($original);
-        $charset = self::_cachedCharset($cacheKey);
-        if (!is_null($charset)) {
-            return $charset;
-        }
-
-        if ($original) {
-            $charset = empty(self::$config['charsets'][$GLOBALS['language']])
-                ? 'ISO-8859-1'
-                : self::$config['charsets'][$GLOBALS['language']];
-        } else {
-            $browser = new Horde_Browser();
-            if ($browser->hasFeature('utf') &&
-                (Horde_Util::extensionExists('iconv') ||
-                 Horde_Util::extensionExists('mbstring'))) {
-                $charset = 'UTF-8';
-            }
-        }
-
-        if (is_null($charset)) {
-            $charset = self::getExternalCharset();
-        }
-
-        self::_cachedCharset($cacheKey, $charset);
-
-        return $charset;
-    }
-
-    /**
-     * Returns the current charset of the environment
-     *
-     * @return string  The character set that should be used with the current
-     *                 locale settings.
-     */
-    static public function getExternalCharset()
-    {
-        /* Get cached results. */
-        $charset = self::_cachedCharset(2);
-        if (!is_null($charset)) {
-            return $charset;
-        }
-
-        $lang_charset = setlocale(LC_ALL, 0);
-        if (strpos($lang_charset, ';') === false &&
-            strpos($lang_charset, '/') === false) {
-            $lang_charset = explode('.', $lang_charset);
-            if ((count($lang_charset) == 2) && !empty($lang_charset[1])) {
-                self::_cachedCharset(2, $lang_charset[1]);
-                return $lang_charset[1];
-            }
-        }
-
-        return empty(self::$config['charsets'][$GLOBALS['language']])
-            ? 'ISO-8859-1'
-            : self::$config['charsets'][$GLOBALS['language']];
-    }
-
-    /**
-     * Sets or returns the charset used under certain conditions.
-     *
-     * @param integer $index   The ID of a cache slot. 0 for the UI charset, 1
-     *                         for the translation charset and 2 for the
-     *                         external charset.
-     * @param string $charset  If specified, this charset will be stored in the
-     *                         given cache slot. Otherwise the content of the
-     *                         specified cache slot will be returned.
-     */
-    static public function _cachedCharset($index, $charset = null)
-    {
-        if (is_null($charset)) {
-            return isset(self::$_cache['charset'][$index])
-                ? self::$_cache['charset'][$index]
-                : null;
-        } else {
-            self::$_cache['charset'][$index] = $charset;
-        }
-    }
-
-    /**
-     * Returns the charset to use for outgoing emails.
-     *
-     * @return string  The preferred charset for outgoing mails based on
-     *                 the user's preferences and the current language.
-     */
-    static public function getEmailCharset()
-    {
-        $charset = $GLOBALS['prefs']->getValue('sending_charset');
-        if (!empty($charset)) {
-            return $charset;
-        }
-
-        return isset(self::$config['emails'][$GLOBALS['language']])
-            ? self::$config['emails'][$GLOBALS['language']]
-            : (isset(self::$config['charsets'][$GLOBALS['language']]) ? self::$config['charsets'][$GLOBALS['language']] : 'ISO-8859-1');
-    }
-
-    /**
      * Check to see if character set is valid for htmlspecialchars() calls.
      *
      * @param string $charset  The character set to check.
@@ -354,12 +46,6 @@ class Horde_Nls
             return false;
         }
 
-        if (isset(self::$_cache['check'][$charset])) {
-            return self::$_cache['check'][$charset];
-        } elseif (!isset($check)) {
-            $check = array();
-        }
-
         $valid = true;
 
         ini_set('track_errors', 1);
@@ -369,49 +55,10 @@ class Horde_Nls
         }
         ini_restore('track_errors');
 
-        self::$_cache['check'][$charset] = $valid;
-
         return $valid;
     }
 
     /**
-     * Sets the charset.
-     *
-     * In general, the applied charset is automatically determined by browser
-     * language and browser capabilities and there's no need to manually call
-     * setCharset. However for headless (RPC) operations the charset may be
-     * set manually to ensure correct character conversion in the backend.
-     *
-     * @param string $charset  If specified, this charset will be stored in the
-     *                         given cache slot.
-     * @param integer $index   The ID of a cache slot. 0 for the UI charset, 1
-     *                         for the translation charset and 2 for the
-     *                         external charset. Defaults to 0: this is the
-     *                         charset returned by getCharset and used for
-     *                         conversion.
-     */
-    static public function setCharset($charset, $index = 0)
-    {
-        self::_cachedCharset($index, $charset);
-    }
-
-    /**
-     * Sets the charset and reloads the whole NLS environment.
-     *
-     * When setting the charset, the gettext catalogs have to be reloaded too,
-     * to match the new charset, among other things. This method takes care of
-     * all this.
-     *
-     * @param string $charset  The new charset.
-     */
-    static public function setCharsetEnvironment($charset)
-    {
-        unset($GLOBALS['language']);
-        self::setCharset($charset);
-        self::setLanguageEnvironment();
-    }
-
-    /**
      * Returns a list of available timezones.
      *
      * @return array  List of timezones.
@@ -423,17 +70,6 @@ class Horde_Nls
     }
 
     /**
-     * Sets the current timezone, if available.
-     */
-    static public function setTimeZone()
-    {
-        $tz = $GLOBALS['prefs']->getValue('timezone');
-        if (!empty($tz)) {
-            @date_default_timezone_set($tz);
-        }
-    }
-
-    /**
      * Get the locale info returned by localeconv(), but cache it, to
      * avoid repeated calls.
      *
@@ -465,25 +101,25 @@ class Horde_Nls
         if (!isset(self::$_cache['nl_info'])) {
             self::$_cache['nl_info'] = array();
         }
+
         if (!isset(self::$_cache['nl_info'][$item])) {
             self::$_cache['nl_info'][$item] = nl_langinfo($item);
         }
+
         return self::$_cache['nl_info'][$item];
     }
 
     /**
      * Get country information from a hostname or IP address.
      *
-     * @param string $host           The hostname or IP address.
-     * @param Net_DNS_Resolver $dns  A DNS resolver object used to look up the
-     *                               hostname.
+     * @param string $host  The hostname or IP address.
      *
      * @return mixed  On success, return an array with the following entries:
      *                'code'  =>  Country Code
      *                'name'  =>  Country Name
      *                On failure, return false.
      */
-    static public function getCountryByHost($host, $dns = null)
+    static public function getCountryByHost($host)
     {
         /* List of generic domains that we know is not in the country TLD
            list. See: http://www.iana.org/gtld/gtld.htm */
@@ -494,15 +130,16 @@ class Horde_Nls
 
         $checkHost = $host;
         if (preg_match('/^\d+\.\d+\.\d+\.\d+$/', $host)) {
-            if (is_null($dns)) {
-                $checkHost = @gethostbyaddr($host);
-            } elseif ($response = $dns->query($host, 'PTR')) {
+            if (isset(self::$dnsResolver) &&
+                ($response = self::$dnsResolver->query($host, 'PTR'))) {
                 foreach ($response->answer as $val) {
                     if (isset($val->ptrdname)) {
                         $checkHost = $val->ptrdname;
                         break;
                     }
                 }
+            } else {
+                $checkHost = @gethostbyaddr($host);
             }
         }
 
@@ -552,28 +189,6 @@ class Horde_Nls
     }
 
     /**
-     * Returns a Horde image link to the country flag.
-     *
-     * @param string $host           The hostname or IP address.
-     * @param Net_DNS_Resolver $dns  A DNS resolver object used to look up the
-     *                               hostname.
-     *
-     * @return string  The image URL, or the empty string on error.
-     */
-    static public function generateFlagImageByHost($host, $dns = null)
-    {
-        $data = self::getCountryByHost($host, $dns);
-        if ($data === false) {
-            return '';
-        }
-
-        $img = $data['code'] . '.png';
-        return file_exists($GLOBALS['registry']->get('themesfs', 'horde') . '/graphics/flags/' . $img)
-            ? Horde::img('flags/' . $img, $data['name'], array('title' => $data['name']))
-            : '[' . $data['name'] . ']';
-    }
-
-    /**
      * Returns either a specific or all ISO-3166 country names.
      *
      * @param string $code  The ISO 3166 country code.
index 9b25f52..e6af73b 100644 (file)
@@ -5,8 +5,9 @@ http://pear.php.net/dtd/package-2.0
 http://pear.php.net/dtd/package-2.0.xsd">
  <name>Nls</name>
  <channel>pear.horde.org</channel>
- <summary>Localization Package</summary>
- <description>TODO
+ <summary>This package provides Native Language Support (NLS).
+ </summary>
+ <description>Provide common methods for handling language data, timezones, and hostname->country lookups.
  </description>
  <lead>
   <name>Chuck Hagenbuch</name>
@@ -30,7 +31,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Initial Horde 4 package.
+ <notes>* Eliminate dependency on horde/Browser and horde/Core.
+ * Initial Horde 4 package.
  </notes>
  <contents>
   <dir name="/">
@@ -57,14 +59,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
     <min>1.5.4</min>
    </pearinstaller>
    <package>
-    <name>Browser</name>
-    <channel>pear.horde.org</channel>
-   </package>
-   <package>
-    <name>Core</name>
-    <channel>pear.horde.org</channel>
-   </package>
-   <package>
     <name>Util</name>
     <channel>pear.horde.org</channel>
    </package>
index 86c0c7d..fafee18 100644 (file)
@@ -23,7 +23,7 @@ class Horde_Notification_Event_Status extends Horde_Notification_Event
         $text = $this->message;
 
         if (!in_array('content.raw', $this->flags) && class_exists('Horde_Nls')) {
-            $text = htmlspecialchars($text, ENT_COMPAT, Horde_Nls::getCharset());
+            $text = htmlspecialchars($text, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
 
         return $text;
index c853114..6279d81 100644 (file)
@@ -35,7 +35,7 @@ class Horde_Notification_Class_Notification_Event_StatusTest extends PHPUnit_Fra
         if (!class_exists('Horde_Nls')) {
             $this->markTestSkipped('The Horde_Nls class is not available!');
         }
-        Horde_Nls::setCharset('ISO-8859-1');
+        $GLOBALS['registry']->setCharset('ISO-8859-1');
         $event = new Horde_Notification_Event_Status('<b>test</b>');
         $this->assertEquals('&lt;b&gt;test&lt;/b&gt;', (string) $event);
     }
index 55e9527..dba7dfc 100644 (file)
@@ -226,7 +226,7 @@ class Horde_Prefs
      */
     public function getCharset()
     {
-        return Horde_Nls::getCharset();
+        return $GLOBALS['registry']->getCharset();
     }
 
     /**
@@ -339,7 +339,7 @@ class Horde_Prefs
         global $conf;
 
         if ($convert) {
-            $val = $this->convertToDriver($val, Horde_Nls::getCharset());
+            $val = $this->convertToDriver($val, $GLOBALS['registry']->getCharset());
         }
 
         // If the preference's value is already equal to $val, don't
@@ -396,8 +396,8 @@ class Horde_Prefs
                 /* Default values have the current UI charset.
                  * Stored values have the backend charset. */
                 $value = $this->isDefault($pref)
-                    ? Horde_String::convertCharset($this->_prefs[$pref]['v'], Horde_Nls::getCharset(), Horde_Nls::getCharset())
-                    : $this->convertFromDriver($this->_prefs[$pref]['v'], Horde_Nls::getCharset());
+                    ? Horde_String::convertCharset($this->_prefs[$pref]['v'], $GLOBALS['registry']->getCharset(), $GLOBALS['registry']->getCharset())
+                    : $this->convertFromDriver($this->_prefs[$pref]['v'], $GLOBALS['registry']->getCharset());
             } else {
                 $value = $this->_prefs[$pref]['v'];
             }
@@ -841,7 +841,7 @@ class Horde_Prefs
                 if ($this->_scopes[$pref_scope][$name]['m'] & self::PREFS_DEFAULT) {
                     $this->_scopes[$pref_scope][$name]['v'] = $val;
                 } else {
-                    $this->_scopes[$pref_scope][$name]['v'] = $this->convertToDriver($val, Horde_Nls::getCharset());
+                    $this->_scopes[$pref_scope][$name]['v'] = $this->convertToDriver($val, $GLOBALS['registry']->getCharset());
                 }
                 if (!($this->_scopes[$pref_scope][$name]['m'] & self::LOCKED)) {
                     $this->_scopes[$pref_scope][$name]['m'] |= self::DIRTY;
index 66cde77..feb49f4 100644 (file)
@@ -71,7 +71,7 @@ class Horde_Prefs_Identity
         if (!($this->_identities = @unserialize($this->_prefs->getValue('identities', false)))) {
             $this->_identities = $this->_prefs->getDefault('identities');
         } else {
-            $this->_identities = $this->_prefs->convertFromDriver($this->_identities, Horde_Nls::getCharset());
+            $this->_identities = $this->_prefs->convertFromDriver($this->_identities, $GLOBALS['registry']->getCharset());
         }
 
         $this->setDefault($this->_prefs->getValue('default_identity'));
@@ -114,7 +114,7 @@ class Horde_Prefs_Identity
     {
         $identities = $this->_identities;
         if (is_array($identities)) {
-            $identities = $this->_prefs->convertToDriver($identities, Horde_Nls::getCharset());
+            $identities = $this->_prefs->convertToDriver($identities, $GLOBALS['registry']->getCharset());
         }
 
         $this->_prefs->setValue('identities', serialize($identities), false);
@@ -406,10 +406,10 @@ class Horde_Prefs_Identity
 
         $pref = @unserialize($this->_prefs->getValue('confirm_email', false));
         $pref = $pref
-            ? $this->_prefs->convertFromDriver($pref, Horde_Nls::getCharset())
+            ? $this->_prefs->convertFromDriver($pref, $GLOBALS['registry']->getCharset())
             : array();
         $pref[$hash] = $this->get($id);
-        $pref = $this->_prefs->convertToDriver($pref, Horde_Nls::getCharset());
+        $pref = $this->_prefs->convertToDriver($pref, $GLOBALS['registry']->getCharset());
         $this->_prefs->setValue('confirm_email', serialize($pref), false);
 
         $new_addr = $this->getValue('from_addr', $id);
@@ -429,7 +429,7 @@ class Horde_Prefs_Identity
         $body = new Horde_Mime_Part();
         $body->setType('text/plain');
         $body->setContents(Horde_String::wrap($message, 76, "\n"));
-        $body->setCharset(Horde_Nls::getCharset());
+        $body->setCharset($GLOBALS['registry']->getCharset());
 
         $body->send($new_addr, $msg_headers, $GLOBALS['injector']->getInstance('Horde_Mail'));
 
@@ -458,7 +458,7 @@ class Horde_Prefs_Identity
             return array(_("Email addresses to confirm not found."), 'horde.message');
         }
 
-        $identity = $this->_prefs->convertFromDriver($confirm[$hash], Horde_Nls::getCharset());
+        $identity = $this->_prefs->convertFromDriver($confirm[$hash], $GLOBALS['registry']->getCharset());
         $id = array_search($identity['id'], $this->getAll('id'));
         if ($id === false) {
             /* Adding a new identity. */
index e616324..01060de 100644 (file)
@@ -850,7 +850,7 @@ function render_field($field)
     case 'mediumtext':
     case 'longblob':
     case 'longtext':
-        return "nl2br(Horde_Text::linkUrls(Horde_Text_Filter::filter(\$zitem['$n'], 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)), false, 'text'))";
+        return "nl2br(Horde_Text::linkUrls(Horde_Text_Filter::filter(\$zitem['$n'], 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)), false, 'text'))";
 
     case 'bool':
     case 'boolean':
@@ -1224,7 +1224,7 @@ function field_get_quoted($field)
     case 'mediumtext':
     case 'longblob':
     case 'longtext':
-        return "Horde_String::convertCharset(\$this->_db->quote(\$zitem['$n']), Horde_Nls::getCharset(), \$this->_params['charset'])";
+        return "Horde_String::convertCharset(\$this->_db->quote(\$zitem['$n']), $GLOBALS['registry']->getCharset(), \$this->_params['charset'])";
 
     // Integer types
     case 'bit':
index da1522f..0f18874 100644 (file)
@@ -34,7 +34,7 @@ class Horde_Rpc_Jsonrpc extends Horde_Rpc
     function __construct($request, $params = array())
     {
         parent::__construct($request, $params);
-        Horde_Nls::setCharsetEnvironment('UTF-8');
+        $GLOBALS['registry']->setCharsetEnvironment('UTF-8');
     }
 
     /**
index ec60526..9950ede 100644 (file)
@@ -48,7 +48,7 @@ class Horde_Rpc_Soap extends Horde_Rpc
      */
     public function __construct($request, $params = array())
     {
-        Horde_Nls::setCharset('UTF-8');
+        $GLOBALS['registry']->setCharset('UTF-8');
 
         parent::__construct($request, $params);
 
index ccd5775..fed5be8 100644 (file)
@@ -588,7 +588,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc
 
         // Handle certain standard properties specially
         if (in_array('displayname', $properties['DAV:'])) {
-            $props[] = $this->mkprop('displayname', Horde_String::convertCharset($item['name'], Horde_Nls::getCharset(), 'UTF-8'));
+            $props[] = $this->mkprop('displayname', Horde_String::convertCharset($item['name'], $GLOBALS['registry']->getCharset(), 'UTF-8'));
             unset($properties['DAV:']['displayname']);
         }
         if (in_array('getlastmodified', $properties['DAV:'])) {
index d919537..0c10c14 100644 (file)
@@ -908,7 +908,7 @@ class Horde_Share_Sql extends Horde_Share
         foreach ($data as $key => $value) {
             if (substr($key, 0, 9) == 'attribute') {
                 $data[$key] = Horde_String::convertCharset(
-                    $data[$key], Horde_Nls::getCharset(), $this->_params['charset']);
+                    $data[$key], $GLOBALS['registry']->getCharset(), $this->_params['charset']);
             }
         }
 
index 16051ad..32c900f 100644 (file)
@@ -46,7 +46,7 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker
             throw new Horde_Exception('Spellcheck failed. Command line: ' . $this->_cmd());
         }
 
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
 
         // Write to stdin.
         if ($this->_encoding) {
index 576b767..5c25607 100644 (file)
@@ -45,7 +45,7 @@ class SyncML_Backend_Horde extends SyncML_Backend {
     {
         parent::setCharset($charset);
 
-        Horde_Nls::setCharset($this->getCharset());
+        $GLOBALS['registry']->setCharset($this->getCharset());
         Horde_String::setDefaultCharset($this->getCharset());
     }
 
index 06c59e0..4678bcb 100755 (executable)
@@ -89,7 +89,7 @@ if ($syncml_backend_driver == 'Horde') {
     require_once dirname(__FILE__) . '/../../../lib/Application.php';
     Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true, 'session_control' => 'none'));
     Horde_String::setDefaultCharset('UTF-8');
-    Horde_Nls::setCharset('UTF-8');
+    $registry->setCharset('UTF-8');
 }
 
 if (!empty($testsetuponly)) {
index 74a3bae..1f3436e 100644 (file)
@@ -88,7 +88,7 @@ class Horde_Tree_Javascript extends Horde_Tree
         );
 
         Horde::addInlineScript(array(
-            'window.' . $this->_instance . ' = new Horde_Tree(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ')',
+            'window.' . $this->_instance . ' = new Horde_Tree(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . ')',
             $this->renderNodeDefinitions()
         ), 'dom');
 
@@ -115,7 +115,7 @@ class Horde_Tree_Javascript extends Horde_Tree
     {
         $this->_buildIndents($this->_root_nodes);
 
-        return 'window.' . $this->_instance . '.renderTree(' . Horde_Serialize::serialize($this->_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . Horde_Serialize::serialize($this->_root_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . ($this->_static ? 'true' : 'false') . ');';
+        return 'window.' . $this->_instance . '.renderTree(' . Horde_Serialize::serialize($this->_nodes, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . ',' . Horde_Serialize::serialize($this->_root_nodes, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . ',' . ($this->_static ? 'true' : 'false') . ');';
     }
 
 }
diff --git a/framework/Ui/lib/Horde/Ui/FlagImage.php b/framework/Ui/lib/Horde/Ui/FlagImage.php
new file mode 100644 (file)
index 0000000..ab1cf4a
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * The Horde_Ui_FlagImage:: class provides a widget for linking to a flag
+ * image.
+ *
+ * Copyright 2003-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  Ui
+ */
+class Horde_Ui_FlagImage
+{
+    /**
+     * Render the language selection.
+     *
+     * @param boolean $form  Return the selection box as a complete standalone
+     *                       form.
+     *
+     * @return string  The HTML selection box.
+     */
+    static public function generateFlagImageByHost($host)
+    {
+        $data = Horde_Nls::getCountryByHost($host);
+        if ($data === false) {
+            return '';
+        }
+
+        $img = $data['code'] . '.png';
+        return file_exists($GLOBALS['registry']->get('themesfs', 'horde') . '/graphics/flags/' . $img)
+            ? Horde::img('flags/' . $img, $data['name'], array('title' => $data['name']))
+            : '[' . $data['name'] . ']';
+    }
+
+}
index 5f15b6d..ff7ff20 100644 (file)
@@ -33,8 +33,8 @@ class Horde_Ui_JsCalendar
         Horde::addScriptFile('calendar.js', 'horde');
         Horde::addInlineScript(array(
             'Horde_Calendar.firstDayOfWeek = ' . (isset($GLOBALS['prefs']) ? intval($GLOBALS['prefs']->getValue('first_week_day')) : 1),
-            'Horde_Calendar.weekdays = ' . Horde_Serialize::serialize($weekdays, Horde_Serialize::JSON, Horde_Nls::getCharset()),
-            'Horde_Calendar.months = ' . Horde_Serialize::serialize(self::months(), Horde_Serialize::JSON, Horde_Nls::getCharset()),
+            'Horde_Calendar.weekdays = ' . Horde_Serialize::serialize($weekdays, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()),
+            'Horde_Calendar.months = ' . Horde_Serialize::serialize(self::months(), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()),
         ));
     }
 
index ee1d35f..d4552fe 100644 (file)
@@ -26,7 +26,7 @@ class Horde_Ui_Language {
         $html = '';
 
         if (!$GLOBALS['prefs']->isLocked('language')) {
-            $_SESSION['horde_language'] = Horde_Nls::select();
+            $_SESSION['horde_language'] = $GLOBALS['registry']->preferredLang();
             $html = sprintf('<form name="language" action="%s">',
                             Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/language.php', false, -1));
             $html .= '<input type="hidden" name="url" value="' . @htmlspecialchars(Horde::selfUrl(false, false, true)) . '" />';
index 503c0ff..d0ce59a 100644 (file)
@@ -36,7 +36,7 @@ class Horde_Ui_VarRenderer
     public function __construct($params = array())
     {
         $this->_params = $params;
-        $this->_charset = Horde_Nls::getCharset();
+        $this->_charset = $GLOBALS['registry']->getCharset();
     }
 
     /**
index 5215f72..bcd189e 100644 (file)
@@ -30,7 +30,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Initial Horde 4 package.
+ <notes>* Added Horde_Ui_FlagImage::.
+ * Initial Horde 4 package.
  </notes>
  <contents>
   <dir name="/">
@@ -41,6 +42,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
        <file name="Html.php" role="php" />
        <file name="TablesetHtml.php" role="php" />
       </dir> <!-- /lib/Horde/Ui/VarRenderer -->
+      <file name="FlagImage.php" role="php" />
       <file name="JsCalendar.php" role="php" />
       <file name="Language.php" role="php" />
       <file name="Pager.php" role="php" />
@@ -61,12 +63,21 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <pearinstaller>
     <min>1.7.0</min>
    </pearinstaller>
+   <package>
+    <name>Core</name>
+    <channel>pear.horde.org</channel>
+   </package>
+   <package>
+    <name>Nls</name>
+    <channel>pear.horde.org</channel>
+   </package>
   </required>
  </dependencies>
  <phprelease>
   <filelist>
    <install name="lib/Horde/Ui/VarRenderer/Html.php" as="Horde/Ui/VarRenderer/Html.php" />
    <install name="lib/Horde/Ui/VarRenderer/TablesetHtml.php" as="Horde/Ui/VarRenderer/TablesetHtml.php" />
+   <install name="lib/Horde/Ui/FlagImage.php" as="Horde/Ui/FlagImage.php" />
    <install name="lib/Horde/Ui/JsCalendar.php" as="Horde/Ui/JsCalendar.php" />
    <install name="lib/Horde/Ui/Language.php" as="Horde/Ui/Language.php" />
    <install name="lib/Horde/Ui/Pager.php" as="Horde/Ui/Pager.php" />
index 5147b8f..874e7c7 100644 (file)
@@ -1025,7 +1025,7 @@ class Horde_iCalendar {
                         // Add CHARSET as well. At least the synthesis client
                         // gets confused otherwise
                         if (empty($params['CHARSET'])) {
-                            $params['CHARSET'] = Horde_Nls::getCharset();
+                            $params['CHARSET'] = $GLOBALS['registry']->getCharset();
                             $params_str .= ';CHARSET=' . $params['CHARSET'];
                         }
                     }
index 74fb55d..b2b6173 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index b689904..d5059f1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-$charset = Horde_Nls::getCharset();
+$charset = $GLOBALS['registry']->getCharset();
 
 /* Variables used in core javascript files. */
 $var = array(
index 32c314d..1d99cc1 100644 (file)
@@ -29,7 +29,7 @@ if ($form->validate($vars)) {
     }
     $now = time();
     $timers[$now] = array('name' => Horde_String::convertCharset($vars->get('description'),
-                                                       Horde_Nls::getCharset(),
+                                                       $GLOBALS['registry']->getCharset(),
                                                        $prefs->getCharset()),
                           'time' => $now);
     $prefs->setValue('running_timers', serialize($timers), false);
index 2c0b5cf..b294549 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 7a88916..d64b752 100644 (file)
@@ -47,7 +47,7 @@ try {
             } else {
                 $host = @gethostbyaddr($data['remoteAddr']);
             }
-            $entry[_("Remote Host:")] = $host . ' [' . $data['remoteAddr'] . '] ' . Horde_Nls::generateFlagImageByHost($host, $injector->getInstance('Net_DNS_Resolver'));
+            $entry[_("Remote Host:")] = $host . ' [' . $data['remoteAddr'] . '] ' . Horde_Ui_FlagImage::generateFlagImageByHost($host);
         }
 
         echo '<li><div class="sesstoggle">' . $plus . $minus . htmlspecialchars($data['userid']) . ' [' . htmlspecialchars($id) . ']'
index a919ec6..1a4d351 100644 (file)
@@ -57,7 +57,7 @@ if (Horde_Util::getFormData('submitbutton') == _("Revert Configuration")) {
     }
     if ($fp = @fopen($path . '/conf.php', 'w')) {
         /* Can write, so output to file. */
-        fwrite($fp, Horde_String::convertCharset($php, Horde_Nls::getCharset(), 'iso-8859-1'));
+        fwrite($fp, Horde_String::convertCharset($php, $GLOBALS['registry']->getCharset(), 'iso-8859-1'));
         fclose($fp);
         $notification->push(sprintf(_("Successfully wrote %s"), Horde_Util::realPath($path . '/conf.php')), 'horde.success');
         $registry->clearCache();
index d50fc89..a501510 100644 (file)
@@ -60,7 +60,7 @@ if ($setup == 'conf' && $type == 'php') {
         $data .= Horde_String::convertCharset(str_replace(array('\\', '\''),
                                                     array('\\\\', '\\\''),
                                                     $php),
-                                        Horde_Nls::getCharset(), 'iso-8859-1');
+                                        $GLOBALS['registry']->getCharset(), 'iso-8859-1');
         $data .= '\');' . "\n";
         $data .= '    fclose($fp);' . "\n";
         $data .= '    echo \'' . sprintf('Saved %s configuration.', $app) . '\' . "\n";' . "\n";
index f43f0d9..b9cadca 100644 (file)
@@ -48,7 +48,7 @@ if (Horde_Util::getFormData('list-tables')) {
     }
 
     // Parse out the query results.
-    $result = $dbh->query(Horde_String::convertCharset($command, Horde_Nls::getCharset(), $conf['sql']['charset']));
+    $result = $dbh->query(Horde_String::convertCharset($command, $GLOBALS['registry']->getCharset(), $conf['sql']['charset']));
 }
 
 if (isset($result)) {
index 6c48ecd..6249880 100644 (file)
@@ -288,7 +288,7 @@ class Horde_Hooks
 //        $ldapPort = '389';
 //        $searchBase = 'ou=people,o=example.com';
 //        $ldapcharset = 'utf-8';
-//        $outputcharset = Horde_Nls::getCharset();
+//        $outputcharset = $GLOBALS['registry']->getCharset();
 //
 //        $ds = @ldap_connect($ldapServer, $ldapPort);
 //
@@ -582,7 +582,7 @@ class Horde_Hooks
 //        $fields = $values = array();
 //        foreach ($extra as $field => $value) {
 //            $fields[] = 'object_' . Horde_String::lower($field);
-//            $values[] = $db->quote(Horde_String::convertCharset($value, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']));
+//            $values[] = $db->quote(Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']));
 //        }
 //        $fields[] = 'object_id';
 //        $values[] = $db->quote($userId);
index 8fc2924..0d12f95 100644 (file)
@@ -1,9 +1,13 @@
 <?php
 /**
  * NLS (National Language Support) configuration file.
+ *
+ * Local overrides should be placed in config/nls.local.php.
+ *
+ * $Id$
  */
 
-Horde_Nls::$config = array(
+$horde_nls_config = array(
     /* Defaults */
     'defaults' => array(
         /* The language to fall back on if we cannot determine one any other
@@ -208,11 +212,11 @@ Horde_Nls::$config = array(
 );
 
 /* Sort encodings. */
-asort(Horde_Nls::$config['encodings']);
+asort($horde_nls_config['encodings']);
 
 /* BSD charsets. */
 if (strpos(PHP_OS, 'BSD') !== false) {
-    Horde_Nls::$config['charsets'] = array_merge(Horde_Nls::$config['charsets'], array(
+    $horde_nls_config['charsets'] = array_merge($horde_nls_config['charsets'], array(
         'bs_BA' => 'ISO8859-2',
         'cs_CZ' => 'ISO8859-2',
         'el_GR' => 'ISO8859-7',
@@ -231,10 +235,10 @@ if (strpos(PHP_OS, 'BSD') !== false) {
 
 /* Turkish locales. */
 if (version_compare(PHP_VERSION, '6', 'ge')) {
-    Horde_Nls::$config['aliases']['tr'] = 'tr_TR';
-    Horde_Nls::$config['charsets']['tr_TR'] = (strpos(PHP_OS, 'BSD') === false) ? 'ISO-8859-9' : 'ISO8859-9';
-    Horde_Nls::$config['languages']['tr_TR'] = 'T&#xfc;rk&#xe7;e';
-    Horde_Nls::$config['spelling']['tr_TR'] = '-d tr';
+    $horde_nls_config['aliases']['tr'] = 'tr_TR';
+    $horde_nls_config['charsets']['tr_TR'] = (strpos(PHP_OS, 'BSD') === false) ? 'ISO-8859-9' : 'ISO8859-9';
+    $horde_nls_config['languages']['tr_TR'] = 'T&#xfc;rk&#xe7;e';
+    $horde_nls_config['spelling']['tr_TR'] = '-d tr';
 }
 
 /* Local overrides. */
index 9feec6e..aa08441 100644 (file)
@@ -39,7 +39,7 @@ class Horde_Block_Horde_sunrise extends Horde_Block {
         }
 
         // Set the timezone variable, if available.
-        Horde_Nls::setTimeZone();
+        $GLOBALS['registry']->setTimeZone();
 
         list($lat, $long) = explode(':', $this->_params['location']);
         $rise = $this->_calculateSunset(time(), $lat, $long, false, floor(date('Z') / 3600));
index c31add5..be544f2 100644 (file)
@@ -48,7 +48,7 @@ class Horde_Block_Horde_time extends Horde_Block {
         }
 
         // Set the timezone variable, if available.
-        Horde_Nls::setTimeZone();
+        $GLOBALS['registry']->setTimeZone();
 
         $html = '<div style="font-size:200%; font-weight:bold; text-align:center">' .
             strftime('%A, %B %d, %Y ');
index 21f662f..01f1427 100644 (file)
@@ -157,7 +157,7 @@ EOT;
         Horde::addInlineScript($script, 'dom');
 
         /* Get the user's most recent tweet */
-        $latestStatus = htmlspecialchars($this->_profile->status->text, ENT_COMPAT, Horde_Nls::getCharset());
+        $latestStatus = htmlspecialchars($this->_profile->status->text, ENT_COMPAT, $GLOBALS['registry']->getCharset());
 
         // Bring in the Facebook CSS
         $csslink = $GLOBALS['registry']->get('themesuri', 'horde') . '/facebook.css';
index 2c63a35..6a0b9fd 100644 (file)
@@ -65,7 +65,7 @@ class Horde_Prefs_Ui
 
         case 'language':
             if (!$prefs->isLocked('language')) {
-                $ui->override['language'] = Horde_Nls::$config['languages'];
+                $ui->override['language'] = $registry->nlsconfig['languages'];
                 array_unshift($ui->override['language'], _("Default"));
             }
 
@@ -199,7 +199,7 @@ class Horde_Prefs_Ui
 
         if ($prefs->isDirty('language')) {
             if ($prefs->isDirty('language')) {
-                Horde_Nls::setLanguageEnvironment($prefs->getValue('language'));
+                $registry->setLanguageEnvironment($prefs->getValue('language'));
                 foreach ($registry->listAPIs() as $api) {
                     if ($registry->hasMethod($api . '/changeLanguage')) {
                         $registry->call($api . '/changeLanguage');
@@ -233,7 +233,7 @@ class Horde_Prefs_Ui
              * frame. */
             if ($old_sidebar) {
                 Horde::addInlineScript(
-                    'window.parent.frames.location = ' . Horde_Serialize::serialize((string)$url, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ';'
+                    'window.parent.frames.location = ' . Horde_Serialize::serialize((string)$url, Horde_Serialize::JSON, $registry->getCharset()) . ';'
                 );
             } else {
                 Horde::redirect($url);
index 443b0c9..6580176 100644 (file)
@@ -168,8 +168,7 @@ if ($error_reason) {
     }
 
     $registry->setupSessionHandler();
-
-    Horde_Nls::setLanguageEnvironment($language, $vars->app);
+    $registry->setLanguageEnvironment($language, $vars->app);
 
     /* Hook to preselect the correct language in the widget. */
     $_GET['new_lang'] = $language;
@@ -228,7 +227,7 @@ if ($error_reason) {
 } else {
     $new_lang = Horde_Util::getGet('new_lang');
     if ($new_lang) {
-        Horde_Nls::setLanguageEnvironment($new_lang);
+        $registry->setLanguageEnvironment($new_lang);
     }
 }
 
@@ -273,10 +272,10 @@ if (!empty($conf['auth']['alternate_login'])) {
 
 /* Build the <select> widget containing the available languages. */
 if (!$is_auth && !$prefs->isLocked('language')) {
-    $_SESSION['horde_language'] = Horde_Nls::select();
+    $_SESSION['horde_language'] = $registry->preferredLang($vars->new_lang);
     $langs = array();
 
-    foreach (Horde_Nls::$config['languages'] as $key => $val) {
+    foreach ($registry->nlsconfig['languages'] as $key => $val) {
         $langs[] = array(
             'sel' => ($key == $_SESSION['horde_language']),
             'val' => $key,
index 4c507f6..cc408b2 100755 (executable)
@@ -40,9 +40,9 @@ foreach ($g->listGroups(true) as $id => $name) {
     $parents = implode(':', array_keys($parents));
 
     $params = array($id,
-                    Horde_String::convertCharset($object->name, Horde_Nls::getCharset(), $conf['sql']['charset']),
-                    Horde_String::convertCharset($parents, Horde_Nls::getCharset(), $conf['sql']['charset']),
-                    Horde_String::convertCharset($object->get('email'), Horde_Nls::getCharset(), $conf['sql']['charset']),
+                    Horde_String::convertCharset($object->name, $GLOBALS['registry']->getCharset(), $conf['sql']['charset']),
+                    Horde_String::convertCharset($parents, $GLOBALS['registry']->getCharset(), $conf['sql']['charset']),
+                    Horde_String::convertCharset($object->get('email'), $GLOBALS['registry']->getCharset(), $conf['sql']['charset']),
     );
     $result = $db->query($group_query, $params);
     if (is_a($result, 'PEAR_Error')) {
index fd24ada..0158e9d 100644 (file)
@@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php';
 Horde_Registry::appInit('horde');
 
 /* Set the language. */
-$_SESSION['horde_language'] = Horde_Nls::select();
+$_SESSION['horde_language'] = $registry->preferredLanguage(Horde_Util::getForm('new_lang'));
 $prefs->setValue('language', $_SESSION['horde_language']);
 
 /* Update apps language */
index 7abd1f1..2d05ef1 100644 (file)
@@ -29,7 +29,7 @@ if (!count($layout_pref)) {
 // If we're serving a request to the JS update client, just return the blocks
 // updated HTML content.
 if (Horde_Util::getFormData('httpclient')) {
-    header('Content-Type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-Type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     $row = Horde_Util::getFormData('row');
     $col = Horde_Util::getFormData('col');
     if (!is_null($row) && !is_null($col) && !empty($layout_pref[$row][$col])) {
index a4f0d71..7a9fd81 100644 (file)
@@ -258,7 +258,7 @@ function sidebar()
     // If we're serving a request to the JS update client, just render the
     // updated node javascript.
     if (Horde_Util::getFormData('httpclient')) {
-        header('Content-Type: application/json; charset=' . Horde_Nls::getCharset());
+        header('Content-Type: application/json; charset=' . $GLOBALS['registry']->getCharset());
         $scripts = array(
             $tree->renderNodeDefinitions(),
             '$(\'horde_menu\').setStyle({ width: \'auto\', height: \'auto\' });');
index 97c9347..e2b2db1 100644 (file)
@@ -101,7 +101,7 @@ case 'send_problem_report':
                                               'body' => $body,
                                               'to' => $conf['problems']['email'],
                                               'from' => $email,
-                                              'charset' => Horde_Nls::getCharset()));
+                                              'charset' => $GLOBALS['registry']->getCharset()));
             $mail->addHeader('Sender', 'horde-problem@' . $conf['problems']['maildomain']);
 
             /* Add attachment. */
index b9a5840..7cbfc02 100644 (file)
@@ -75,7 +75,7 @@ if ($can_validate && $form->validate($vars)) {
                                                             $password),
                                           'to' => $email,
                                           'from' => $email,
-                                          'charset' => Horde_Nls::getCharset()));
+                                          'charset' => $GLOBALS['registry']->getCharset()));
         try {
             $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
             $notification->push(_("Your password has been reset, check your email and log in with your new password."), 'horde.success');
index a0010f4..a645dc4 100644 (file)
@@ -81,8 +81,8 @@ case 'getPage':
         /* These are all referencing the *original* tweet */
         $profileLink = Horde::externalUrl('http://twitter.com/' . htmlspecialchars($tweetObj->user->screen_name), true);
         $profileImg = $tweetObj->user->profile_image_url;
-        $authorName = htmlspecialchars($tweetObj->user->screen_name, ENT_COMPAT, Horde_Nls::getCharset());
-        $authorFullname = htmlspecialchars($tweetObj->user->name, ENT_COMPAT, Horde_Nls::getCharset());
+        $authorName = htmlspecialchars($tweetObj->user->screen_name, ENT_COMPAT, $GLOBALS['registry']->getCharset());
+        $authorFullname = htmlspecialchars($tweetObj->user->name, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         $createdAt = $tweetObj->created_at;
 
         $appText = Horde_Text_Filter::filter($tweet->source, 'xss', array());
index 2022421..d91f3c1 100644 (file)
@@ -60,7 +60,7 @@
 <label for="new_user" class="hidden"><?php echo _("User") ?></label>
 <input type="text" id="new_user" name="new_user" />
 <?php endif; ?>
-<input type="submit" class="button" value="<?php echo htmlspecialchars(sprintf(_("Save \"%s\""), $group->getShortName()), ENT_COMPAT, Horde_Nls::getCharset()) ?>" />
+<input type="submit" class="button" value="<?php echo htmlspecialchars(sprintf(_("Save \"%s\""), $group->getShortName()), ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?>" />
 </p>
 <br />
 
index c11cfd1..afb74f6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($GLOBALS['language'])) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 2f69c6a..348944a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 468ea91..4448955 100644 (file)
@@ -82,8 +82,8 @@ if ($conf['compose']['link_attachments_notify']) {
             /* Ignore missing addresses, which are returned as <>. */
             if (strlen($mail_address) > 2) {
                 $mail_address_full = $mail_identity->getDefaultFromAddress(true);
-                Horde_Nls::setTimeZone();
-                Horde_Nls::setLanguageEnvironment();
+                $registry->setTimeZone();
+                $registry->setLanguageEnvironment();
 
                 /* Set up the mail headers and read the log file. */
                 $msg_headers = new Horde_Mime_Headers();
@@ -100,7 +100,7 @@ if ($conf['compose']['link_attachments_notify']) {
 
                 $msg = new Horde_Mime_Part();
                 $msg->setType('text/plain');
-                $msg->setCharset(Horde_Nls::getCharset());
+                $msg->setCharset($registry->getCharset());
 
                 $d_url = new Horde_Url(Horde::selfUrl(true, false, true));
                 $msg->setContents(Horde_String::wrap(sprintf(_("Your linked attachment has been downloaded by at least one user.\n\nAttachment name: %s\nAttachment date: %s\n\nClick on the following link to permanently delete the attachment:\n%s"), $file_name, date('r', $time_stamp), $d_url->add('d', $id))));
index f721d16..47c01d4 100644 (file)
  */
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-Horde_Registry::appInit('imp', array('impmode' => 'dimp'));
+Horde_Registry::appInit('imp', array(
+    'impmode' => 'dimp',
+    'timezone' => true
+));
 
-Horde_Nls::setTimeZone();
 $vars = Horde_Variables::getDefaultVariables();
 
 /* Determine if compose mode is disabled. */
index 1772648..4ced357 100644 (file)
  */
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-Horde_Registry::appInit('imp', array('impmode' => 'mimp'));
+Horde_Registry::appInit('imp', array(
+    'impmode' => 'mimp',
+    'timezone' => true
+));
 
-Horde_Nls::setTimeZone();
 $vars = Horde_Variables::getDefaultVariables();
 
 /* The message text and headers. */
@@ -252,7 +254,7 @@ case _("Send"):
     switch ($vars->a) {
     case _("Save Draft"):
         try {
-            $notification->push($imp_compose->saveDraft($header, $message, Horde_Nls::getCharset(), false), 'horde.success');
+            $notification->push($imp_compose->saveDraft($header, $message, $registry->getCharset(), false), 'horde.success');
             if ($prefs->getValue('close_draft')) {
                 $imp_compose->destroy('save_draft');
                 require IMP_BASE . '/mailbox-mimp.php';
@@ -277,7 +279,7 @@ case _("Send"):
         );
 
         try {
-            if ($imp_compose->buildAndSendMessage($message, $header, Horde_Nls::getEmailCharset(), false, $options)) {
+            if ($imp_compose->buildAndSendMessage($message, $header, $GLOBALS['registry']->getEmailCharset(), false, $options)) {
                 $imp_compose->destroy('send');
 
                 $notification->push(_("Message sent successfully."), 'horde.success');
index 1a68a85..ada72ad 100644 (file)
@@ -17,7 +17,7 @@
 require_once dirname(__FILE__) . '/lib/Application.php';
 Horde_Registry::appInit('imp', array('session_control' => 'netscape'));
 
-Horde_Nls::setTimeZone();
+$registry->setTimeZone();
 
 /* The message headers and text. */
 $header = array();
@@ -127,10 +127,10 @@ $imp_ui = new IMP_Ui_Compose();
  * $encoding - best guessed charset offered to the user as the default value
  *             in the charset dropdown list. */
 $charset = $prefs->isLocked('sending_charset')
-    ? Horde_Nls::getEmailCharset()
+    ? $registry->getEmailCharset()
     : $vars->charset;
 $encoding = empty($charset)
-    ? Horde_Nls::getEmailCharset()
+    ? $registry->getEmailCharset()
     : $charset;
 
 /* Is this a popup window? */
@@ -373,7 +373,7 @@ case 'send_message':
     if (in_array($vars->actionID, array('auto_save_draft', 'save_draft'))) {
         if (!$readonly_drafts) {
             try {
-                $result = $imp_compose->saveDraft($header, $message, Horde_Nls::getCharset(), $rtemode);
+                $result = $imp_compose->saveDraft($header, $message, $registry->getCharset(), $rtemode);
 
                 /* Closing draft if requested by preferences. */
                 if ($vars->actionID == 'save_draft') {
@@ -819,7 +819,7 @@ if ($redirect) {
         $t->set('charset_label', Horde::label('charset', _("C_harset")));
         $t->set('charset_tabindex', ++$tabindex);
         $charset_array = array();
-        foreach (Horde_Nls::$config['encodings'] as $charset => $label) {
+        foreach ($registry->nlsconfig['encodings'] as $charset => $label) {
             $charset_array[] = array('value' => $charset, 'selected' => (strtolower($charset) == strtolower($encoding)), 'label' => $label);
         }
         $t->set('charset_array', $charset_array);
index 1b23465..8bbb8d1 100644 (file)
@@ -493,7 +493,7 @@ $_prefs['sending_charset'] = array(
     'value' => '',
     'shared' => true,
     'type' => 'enum',
-    'enum' => array_merge(array('' => _("Default")), Horde_Nls::$config['encodings']),
+    'enum' => array_merge(array('' => _("Default")), $GLOBALS['registry']->nlsconfig['encodings']),
     'desc' => _("Your default charset for sending messages:")
 );
 
@@ -835,14 +835,14 @@ $_prefs['mail_hdr'] = array(
 
 // default message character set
 $_prefs['default_msg_charset'] = array(
-    'value' => isset($GLOBALS['nls']['emails'][$GLOBALS['language']])
-        ? $GLOBALS['nls']['emails'][$GLOBALS['language']]
-        : (isset($GLOBALS['nls']['charsets'][$GLOBALS['language']])
-            ? $GLOBALS['nls']['charsets'][$GLOBALS['language']]
+    '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']]
             : ''),
     'type' => 'enum',
     'enum' => array_merge(
-        array('' => _("Default (US-ASCII)")), Horde_Nls::$config['encodings']
+        array('' => _("Default (US-ASCII)")), $GLOBALS['registry']->nlsconfig['encodings']
     ),
     'desc' => _("The default charset for messages with no charset information:"),
     'help' => 'prefs-default_msg_charset'
index cd76551..51930ad 100644 (file)
@@ -65,7 +65,7 @@ if ($vars->searched || $prefs->getValue('display_contact')) {
 $selected_addresses = array();
 foreach (explode('|', $vars->sa) as $addr) {
     if (strlen(trim($addr))) {
-        $selected_addresses[] = @htmlspecialchars($addr, ENT_QUOTES, Horde_Nls::getCharset());
+        $selected_addresses[] = @htmlspecialchars($addr, ENT_QUOTES, $registry->getCharset());
     }
 }
 
@@ -92,11 +92,11 @@ $a_list = array();
 foreach ($addresses as $addr) {
     if (!empty($addr['email'])) {
         if (strpos($addr['email'], ',') !== false) {
-            $a_list[] = @htmlspecialchars(Horde_Mime_Address::encode($addr['name'], 'personal') . ': ' . $addr['email'] . ';', ENT_QUOTES, Horde_Nls::getCharset());
+            $a_list[] = @htmlspecialchars(Horde_Mime_Address::encode($addr['name'], 'personal') . ': ' . $addr['email'] . ';', ENT_QUOTES, $registry->getCharset());
         } else {
             $mbox_host = explode('@', $addr['email']);
             if (isset($mbox_host[1])) {
-                $a_list[] = @htmlspecialchars(Horde_Mime_Address::writeAddress($mbox_host[0], $mbox_host[1], $addr['name']), ENT_QUOTES, Horde_Nls::getCharset());
+                $a_list[] = @htmlspecialchars(Horde_Mime_Address::writeAddress($mbox_host[0], $mbox_host[1], $addr['name']), ENT_QUOTES, $registry->getCharset());
             }
         }
     }
index 777af0e..d14165b 100644 (file)
@@ -31,7 +31,7 @@ if (!$conf['user']['allow_folders']) {
 $subscribe = $prefs->getValue('subscribe');
 $showAll = (!$subscribe || $_SESSION['imp']['showunsub']);
 
-$charset = Horde_Nls::getCharset();
+$charset = $registry->getCharset();
 
 /* Get the base URL for this page. */
 $folders_url = Horde::selfUrl();
@@ -403,7 +403,7 @@ if ($a_template->get('javascript')) {
     $a_template->set('go', _("Go"));
 }
 
-$a_template->set('create_folder', !empty($GLOBALS['conf']['hooks']['permsdenied']) || ($GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('create_folders') && $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_folders')));
+$a_template->set('create_folder', !empty($conf['hooks']['permsdenied']) || ($injector->getInstance('Horde_Perms')->hasAppPermission('create_folders') && $injector->getInstance('Horde_Perms')->hasAppPermission('max_folders')));
 if ($prefs->getValue('subscribe')) {
     $a_template->set('subscribe', true);
     $subToggleText = ($showAll) ? _("Hide Unsubscribed") : _("Show Unsubscribed");
index f19373b..9bc0336 100644 (file)
@@ -72,7 +72,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
         $imptree = $GLOBALS['injector']->getInstance('IMP_Imap_Tree');
         $imptree->eltDiffStart();
 
-        $new = Horde_String::convertCharset($this->_vars->mbox, Horde_Nls::getCharset(), 'UTF7-IMAP');
+        $new = Horde_String::convertCharset($this->_vars->mbox, $GLOBALS['registry']->getCharset(), 'UTF7-IMAP');
         try {
             $new = $imptree->createMailboxName($this->_vars->parent, $new);
 
@@ -165,7 +165,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
         $result = false;
 
         try {
-            $new = Horde_String::convertCharset($imptree->createMailboxName($this->_vars->new_parent, $this->_vars->new_name), Horde_Nls::getCharset(), 'UTF7-IMAP');
+            $new = Horde_String::convertCharset($imptree->createMailboxName($this->_vars->new_parent, $this->_vars->new_name), $GLOBALS['registry']->getCharset(), 'UTF7-IMAP');
 
             if (($this->_vars->old_name != $new) &&
                 $GLOBALS['injector']->getInstance('IMP_Folder')->rename($this->_vars->old_name, $new)) {
@@ -1447,7 +1447,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
 
         try {
             // TODO: Use 'sending_charset'
-            $sent = $imp_compose->buildAndSendMessage($this->_vars->message, $headers, Horde_Nls::getEmailCharset(), $this->_vars->html, $options);
+            $sent = $imp_compose->buildAndSendMessage($this->_vars->message, $headers, $GLOBALS['registry']->getEmailCharset(), $this->_vars->html, $options);
         } catch (IMP_Compose_Exception $e) {
             $result->success = 0;
 
@@ -1655,7 +1655,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
         }
 
         try {
-            $res = $imp_compose->saveDraft($headers, $this->_vars->message, Horde_Nls::getCharset(), $this->_vars->html);
+            $res = $imp_compose->saveDraft($headers, $this->_vars->message, $GLOBALS['registry']->getCharset(), $this->_vars->html);
             if ($this->_action == 'autoSaveDraft') {
                 $GLOBALS['notification']->push(_("Draft automatically saved."), 'horde.message');
             } else {
index 102bdb2..373b658 100644 (file)
@@ -66,7 +66,7 @@ class IMP_Ajax_Imple_ContactAutoCompleter extends Horde_Ajax_Imple_AutoCompleter
                 if (!isset($addrlist)) {
                     $addrlist = IMP_Compose::getAddressList();
                 }
-                Horde::addInlineScript('if (!window.IMP) window.IMP = {}; IMP.ac_list = '. Horde_Serialize::serialize($addrlist, Horde_Serialize::JSON, Horde_Nls::getCharset()));
+                Horde::addInlineScript('if (!window.IMP) window.IMP = {}; IMP.ac_list = '. Horde_Serialize::serialize($addrlist, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()));
                 self::$_listOutput = true;
             }
 
index 3ac6d5c..9ad0628 100644 (file)
@@ -33,7 +33,7 @@ class IMP_Block_Newmail extends Horde_Block
         if (empty($indices)) {
             $html .= '<tr><td><em>' . _("No unread messages") . '</em></td></tr>';
         } else {
-            $charset = Horde_Nls::getCharset();
+            $charset = $GLOBALS['registry']->getCharset();
             $imp_ui = new IMP_Ui_Mailbox('INBOX');
             $shown = empty($this->_params['msgs_shown'])
                 ? 3
index a9a5630..277d6f5 100644 (file)
@@ -537,7 +537,7 @@ class IMP_Compose
             $mdn->addMDNRequestHeaders($headers, $barefrom);
         }
 
-        $browser_charset = Horde_Nls::getCharset();
+        $browser_charset = $GLOBALS['registry']->getCharset();
 
         $headers->addHeader('From', Horde_String::convertCharset($header['from'], $browser_charset, $charset));
 
@@ -571,7 +571,7 @@ class IMP_Compose
             $headers_result = Horde::loadConfiguration('header.php', '_header');
             if (is_array($headers_result)) {
                 foreach ($headers_result as $key => $val) {
-                    $headers->addHeader(trim($key), Horde_String::convertCharset(trim($val), Horde_Nls::getCharset(), $charset));
+                    $headers->addHeader(trim($key), Horde_String::convertCharset(trim($val), $GLOBALS['registry']->getCharset(), $charset));
                 }
             }
         } catch (Horde_Exception $e) {}
@@ -675,7 +675,7 @@ class IMP_Compose
             }
 
             try {
-                $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->append(Horde_String::convertCharset($opts['sent_folder'], Horde_Nls::getCharset(), 'UTF-8'), array(array('data' => $fcc, 'flags' => $flags)));
+                $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->append(Horde_String::convertCharset($opts['sent_folder'], $GLOBALS['registry']->getCharset(), 'UTF-8'), array(array('data' => $fcc, 'flags' => $flags)));
             } catch (Horde_Imap_Client_Exception $e) {
                 $notification->push(sprintf(_("Message sent successfully, but not saved to %s"), IMP::displayFolder($opts['sent_folder'])));
                 $sent_saved = false;
@@ -770,7 +770,7 @@ class IMP_Compose
                 try {
                     $error = Horde::callHook('perms_denied', array('imp:max_timelimit'));
                 } catch (Horde_Exception_HookNotSet $e) {
-                    $error = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients within %d hours."), $timelimit, $GLOBALS['conf']['sentmail']['params']['limit_period']), ENT_COMPAT, Horde_Nls::getCharset());
+                    $error = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients within %d hours."), $timelimit, $GLOBALS['conf']['sentmail']['params']['limit_period']), ENT_COMPAT, $GLOBALS['registry']->getCharset());
                 }
                 throw new IMP_Compose_Exception($error);
             }
@@ -956,7 +956,7 @@ class IMP_Compose
                     try {
                         $message = Horde::callHook('perms_denied', array('imp:max_recipients'));
                     } catch (Horde_Exception_HookNotSet $e) {
-                        $message = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients."), $max_recipients), ENT_COMPAT, Horde_Nls::getCharset());
+                        $message = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients."), $max_recipients), ENT_COMPAT, $GLOBALS['registry']->getCharset());
                     }
                     throw new IMP_Compose_Exception($message);
                 }
@@ -980,7 +980,7 @@ class IMP_Compose
         // Convert IDN hosts to ASCII.
         if (Horde_Util::extensionExists('idn')) {
             $old_error = error_reporting(0);
-            $host = idn_to_ascii(Horde_String::convertCharset($host, Horde_Nls::getCharset(), 'UTF-8'));
+            $host = idn_to_ascii(Horde_String::convertCharset($host, $GLOBALS['registry']->getCharset(), 'UTF-8'));
             error_reporting($old_error);
         } elseif (Horde_Mime::is8bit($ob['mailbox'])) {
             throw new IMP_Compose_Exception(sprintf(_("Invalid character in e-mail address: %s."), $email));
@@ -1017,7 +1017,7 @@ class IMP_Compose
     protected function _createMimeMessage($to, $body, $charset,
                                           $options = array())
     {
-        $nls_charset = Horde_Nls::getCharset();
+        $nls_charset = $GLOBALS['registry']->getCharset();
         $body = Horde_String::convertCharset($body, $nls_charset, $charset);
 
         if (!empty($options['html'])) {
@@ -1582,7 +1582,7 @@ class IMP_Compose
 
         return array(
             'body' => $msg,
-            'encoding' => isset($msg_text) ? $msg_text['encoding'] : Horde_Nls::getCharset(),
+            'encoding' => isset($msg_text) ? $msg_text['encoding'] : $GLOBALS['registry']->getCharset(),
             'format' => $format,
             'headers' => $header,
             'identity' => $this->_getMatchingIdentity($h),
@@ -1629,10 +1629,10 @@ class IMP_Compose
         $resent_headers->addHeader('Resent-To', $recip['header']['to']);
         $resent_headers->addHeader('Resent-Message-ID', Horde_Mime::generateMessageId());
 
-        $header_text = trim($resent_headers->toString(array('encode' => Horde_Nls::getCharset()))) . "\n" . trim($contents->getHeaderOb(false));
+        $header_text = trim($resent_headers->toString(array('encode' => $GLOBALS['registry']->getCharset()))) . "\n" . trim($contents->getHeaderOb(false));
 
         $to = $this->_prepSendMessage($recipients);
-        $hdr_array = $headers->toArray(array('charset' => Horde_Nls::getCharset()));
+        $hdr_array = $headers->toArray(array('charset' => $GLOBALS['registry']->getCharset()));
         $hdr_array['_raw'] = $header_text;
 
         try {
@@ -1691,7 +1691,7 @@ class IMP_Compose
              $headerob = $contents->getHeaderOb();
 
              $part = new Horde_Mime_Part();
-             $part->setCharset(Horde_Nls::getCharset());
+             $part->setCharset($GLOBALS['registry']->getCharset());
              $part->setType('message/rfc822');
              $part->setName(_("Forwarded Message"));
              $part->setContents($contents->fullMessageText(array('stream' => true)));
@@ -1806,12 +1806,12 @@ class IMP_Compose
         if ($part->getPrimaryType() == 'text') {
             if ($analyzetype = Horde_Mime_Magic::analyzeFile($tempfile, empty($conf['mime']['magic_db']) ? null : $conf['mime']['magic_db'], array('nostrip' => true))) {
                 $analyzetype = Horde_Mime::decodeParam('Content-Type', $analyzetype);
-                $part->setCharset(isset($analyzetype['params']['charset']) ? $analyzetype['params']['charset'] : Horde_Nls::getCharset());
+                $part->setCharset(isset($analyzetype['params']['charset']) ? $analyzetype['params']['charset'] : $GLOBALS['registry']->getCharset());
             } else {
-                $part->setCharset(Horde_Nls::getCharset());
+                $part->setCharset($GLOBALS['registry']->getCharset());
             }
         } else {
-            $part->setHeaderCharset(Horde_Nls::getCharset());
+            $part->setHeaderCharset($GLOBALS['registry']->getCharset());
         }
         $part->setName($filename);
         $part->setBytes($_FILES[$name]['size']);
@@ -2156,13 +2156,13 @@ class IMP_Compose
             '/%r/' => $h->getValue('date'),
 
             /* Date as ddd, dd mmm yyyy. */
-            '/%d/' => Horde_String::convertCharset(strftime("%a, %d %b %Y", $udate), Horde_Nls::getExternalCharset()),
+            '/%d/' => Horde_String::convertCharset(strftime("%a, %d %b %Y", $udate), $GLOBALS['registry']->getExternalCharset()),
 
             /* Date in locale's default. */
-            '/%x/' => Horde_String::convertCharset(strftime("%x", $udate), Horde_Nls::getExternalCharset()),
+            '/%x/' => Horde_String::convertCharset(strftime("%x", $udate), $GLOBALS['registry']->getExternalCharset()),
 
             /* Date and time in locale's default. */
-            '/%c/' => Horde_String::convertCharset(strftime("%c", $udate), Horde_Nls::getExternalCharset()),
+            '/%c/' => Horde_String::convertCharset(strftime("%c", $udate), $GLOBALS['registry']->getExternalCharset()),
 
             /* Message-ID. */
             '/%m/' => $message_id,
@@ -2354,14 +2354,14 @@ class IMP_Compose
         $fullpath = sprintf('%s/%s/%d', self::VFS_LINK_ATTACH_PATH, $auth, $ts);
         $charset = $part->getCharset();
 
-        $trailer = Horde_String::convertCharset(_("Attachments"), Horde_Nls::getCharset(), $charset);
+        $trailer = Horde_String::convertCharset(_("Attachments"), $GLOBALS['registry']->getCharset(), $charset);
 
         if ($prefs->getValue('delete_attachments_monthly')) {
             /* Determine the first day of the month in which the current
              * attachments will be ripe for deletion, then subtract 1 second
              * to obtain the last day of the previous month. */
             $del_time = mktime(0, 0, 0, date('n') + $prefs->getValue('delete_attachments_monthly_keep') + 1, 1, date('Y')) - 1;
-            $trailer .= Horde_String::convertCharset(' (' . sprintf(_("Links will expire on %s"), strftime('%x', $del_time)) . ')', Horde_Nls::getCharset(), $charset);
+            $trailer .= Horde_String::convertCharset(' (' . sprintf(_("Links will expire on %s"), strftime('%x', $del_time)) . ')', $GLOBALS['registry']->getCharset(), $charset);
         }
 
         foreach ($this->getAttachments() as $att) {
@@ -2446,7 +2446,7 @@ class IMP_Compose
         $part = $contents->getMIMEPart($body_id);
         $type = $part->getType();
         $part_charset = $part->getCharset();
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
         $msg = Horde_String::convertCharset($part->getContents(), $part_charset);
 
         /* Enforce reply limits. */
@@ -2491,7 +2491,7 @@ class IMP_Compose
         }
 
         /* Determine default encoding. */
-        $encoding = Horde_Nls::getEmailCharset();
+        $encoding = $GLOBALS['registry']->getEmailCharset();
         if (($charset == 'UTF-8') &&
             (strcasecmp($part_charset, 'US-ASCII') !== 0) &&
             (strcasecmp($part_charset, $encoding) !== 0)) {
@@ -2539,7 +2539,7 @@ class IMP_Compose
 
         $part = new Horde_Mime_Part();
         $part->setType('text/x-vcard');
-        $part->setCharset(Horde_Nls::getCharset());
+        $part->setCharset($GLOBALS['registry']->getCharset());
         $part->setContents($vcard);
         $part->setName((strlen($name) ? $name : 'vcard') . '.vcf');
         $this->_attachVCard = $part;
index 9526ee9..b7ded3d 100644 (file)
@@ -417,7 +417,7 @@ class IMP_Contents
                                 'text' => $status
                             )
                         ),
-                        'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                        'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
                     )
                 );
             }
@@ -462,7 +462,7 @@ class IMP_Contents
             /* If this is a text/* part, AND the browser does not support
              * UTF-8, give the user a link to open the part in a new window
              * with the correct character set. */
-            $default_charset = Horde_String::upper(Horde_Nls::getCharset());
+            $default_charset = Horde_String::upper($GLOBALS['registry']->getCharset());
             if ($default_charset !== 'UTF-8') {
                 $charset_upper = Horde_String::upper($mime_part->getCharset());
                 if (($charset_upper != 'US-ASCII') &&
@@ -527,7 +527,7 @@ class IMP_Contents
         $ptext = $pmime->getContents();
         $ptext = Horde_String::convertCharset($ptext, $pmime->getCharset());
         if ($pmime->getType() == 'text/html') {
-            $ptext = Horde_Text_Filter::filter($ptext, 'Html2text', array('charset' => Horde_Nls::getCharset()));
+            $ptext = Horde_Text_Filter::filter($ptext, 'Html2text', array('charset' => $GLOBALS['registry']->getCharset()));
         }
 
         $this->_build = $oldbuild;
index 095d024..af87e04 100644 (file)
@@ -613,7 +613,7 @@ class IMP_Crypt_Pgp extends Horde_Crypt_Pgp
      */
     public function textWindowOutput($name, $msg)
     {
-        $GLOBALS['browser']->downloadHeaders($name, 'text/plain; charset=' . Horde_Nls::getCharset(), true, strlen($msg));
+        $GLOBALS['browser']->downloadHeaders($name, 'text/plain; charset=' . $GLOBALS['registry']->getCharset(), true, strlen($msg));
         echo $msg;
     }
 
index 0e9be87..64cee41 100644 (file)
@@ -451,7 +451,7 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime
      */
     public function textWindowOutput($name, $msg, $html = false)
     {
-        $GLOBALS['browser']->downloadHeaders($name, $html ? 'text/html' : 'text/plain; charset=' . Horde_Nls::getCharset(), true, strlen($msg));
+        $GLOBALS['browser']->downloadHeaders($name, $html ? 'text/html' : 'text/plain; charset=' . $GLOBALS['registry']->getCharset(), true, strlen($msg));
         echo $msg;
     }
 
index d32fb60..8ae34e8 100644 (file)
@@ -224,7 +224,7 @@ class IMP_Folder
             try {
                 $message = Horde::callHook('perms_denied', array('imp:create_folders'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(_("You are not allowed to create folders."), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(_("You are not allowed to create folders."), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             return false;
@@ -232,7 +232,7 @@ class IMP_Folder
             try {
                 $message = Horde::callHook('perms_denied', array('imp:max_folders'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_folders', array('opts' => array('value' => true)))), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_folders', array('opts' => array('value' => true)))), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             return false;
index 9b79f40..1489917 100644 (file)
@@ -143,7 +143,7 @@ class IMP
 
         $result = $registry->call('contacts/import', array(array('name' => $newName, 'email' => $newAddress), 'array', $prefs->getValue('add_source')));
 
-        $escapeName = @htmlspecialchars($newName, ENT_COMPAT, Horde_Nls::getCharset());
+        $escapeName = @htmlspecialchars($newName, ENT_COMPAT, $GLOBALS['registry']->getCharset());
 
         try {
             if ($contact_link = $registry->link('contacts/show', array('uid' => $result, 'source' => $prefs->getValue('add_source')))) {
@@ -221,7 +221,7 @@ class IMP
                     : $mbox['abbrev'];
 
                 $mbox_list[] = array(
-                    'l' => Horde_Text_Filter::filter($label, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)),
+                    'l' => Horde_Text_Filter::filter($label, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)),
                     'sel' => (!empty($options['selected']) && ($mbox['val'] === $options['selected'])),
                     'v' => htmlspecialchars($mbox['val'])
                 );
@@ -238,7 +238,7 @@ class IMP
                 $vfolder_sel = $imp_search->searchMboxID();
                 foreach ($vfolders as $id => $val) {
                     $vfolder_list[] = array(
-                        'l' => Horde_Text_Filter::filter($val, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)),
+                        'l' => Horde_Text_Filter::filter($val, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)),
                         'sel' => ($vfolder_sel == $id),
                         'v' => htmlspecialchars($imp_search->createSearchID($id))
                     );
@@ -257,7 +257,7 @@ class IMP
                     $tasklist_list = array();
                     foreach ($tasklists as $id => $tasklist) {
                         $tasklist_list[] = array(
-                            'l' => Horde_Text_Filter::filter($tasklist->get('name'), 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)),
+                            'l' => Horde_Text_Filter::filter($tasklist->get('name'), 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)),
                             'v' => '\0tasklist_' . $id
                         );
                     }
@@ -276,7 +276,7 @@ class IMP
                     $notepad_list[] = array();
                     foreach ($notepads as $id => $notepad) {
                         $notepad_list[] = array(
-                            'l' => Horde_Text_Filter::filter($notepad->get('name'), 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)),
+                            'l' => Horde_Text_Filter::filter($notepad->get('name'), 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)),
                             'v' => '\0notepad_' . $id
                         );
                     }
@@ -494,7 +494,7 @@ class IMP
                 stripos($out, $key) === 0) {
                 $len = strlen($key);
                 if ((strlen($out) == $len) || ($out[$len] == $delimiter)) {
-                    $out = substr_replace($out, Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'UTF7-IMAP'), 0, $len);
+                    $out = substr_replace($out, Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), 'UTF7-IMAP'), 0, $len);
                     break;
                 }
             }
index 3ec6b4a..5386d63 100644 (file)
@@ -181,7 +181,7 @@ class IMP_Imap_Flags
 
         /* IMAP keywords must conform to RFC 3501 [9] (flag-keyword). Convert
          * whitespace to underscore. */
-        $key = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->getUtils()->stripNonAtomChars(Horde_String::convertCharset(strtr($label, ' ', '_'), Horde_Nls::getCharset(), 'UTF7-IMAP'));
+        $key = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->getUtils()->stripNonAtomChars(Horde_String::convertCharset(strtr($label, ' ', '_'), $GLOBALS['registry']->getCharset(), 'UTF7-IMAP'));
         if (!isset($this->_flags[$key])) {
             $entry = $this->_createEntry($label);
 
index 2295379..aa66df6 100644 (file)
@@ -46,7 +46,7 @@ class IMP_LoginTasks_Task_DeleteSentmailMonthly extends Horde_LoginTasks_Task
         foreach (array_keys($old_folders) as $k) {
             foreach ($sent_mail_folders as $folder) {
                 if (preg_match('/^' . str_replace('/', '\/', $folder) . '-([^-]+)-([0-9]{4})$/i', $k, $regs)) {
-                    $folder_array[$k] = Horde_String::convertCharset((is_numeric($regs[1])) ? mktime(0, 0, 0, $regs[1], 1, $regs[2]) : strtotime("$regs[1] 1, $regs[2]"), Horde_Nls::getCharset(), 'UTF7-IMAP');
+                    $folder_array[$k] = Horde_String::convertCharset((is_numeric($regs[1])) ? mktime(0, 0, 0, $regs[1], 1, $regs[2]) : strtotime("$regs[1] 1, $regs[2]"), $GLOBALS['registry']->getCharset(), 'UTF7-IMAP');
                 }
             }
         }
index 0329aa9..cec5e4b 100644 (file)
@@ -101,7 +101,7 @@ class IMP_LoginTasks_Task_RenameSentmailMonthly extends Horde_LoginTasks_Task
 
         $text = (substr($GLOBALS['language'], 0, 2) == 'en') ? strtolower(strftime('-%b-%Y', $last_maintenance)) : strftime('-%m-%Y', $last_maintenance);
 
-        return $folder . Horde_String::convertCharset($text, Horde_Nls::getExternalCharset(), 'UTF7-IMAP');
+        return $folder . Horde_String::convertCharset($text, $GLOBALS['registry']->getExternalCharset(), 'UTF7-IMAP');
     }
 
 }
index 56b698d..5241763 100644 (file)
@@ -337,7 +337,7 @@ class IMP_Message
             /* TODO: When Horde_iCalendar supports setting of charsets
              * we need to set it there instead of relying on the fact
              * that both Nag and IMP use the same charset. */
-            $body = Horde_String::convertCharset($body, $body_part->getCharset(), Horde_Nls::getCharset());
+            $body = Horde_String::convertCharset($body, $body_part->getCharset(), $GLOBALS['registry']->getCharset());
 
             /* Create a new iCalendar. */
             $vCal = new Horde_iCalendar();
@@ -499,7 +499,7 @@ class IMP_Message
 
                 /* Need to make sure all text is in the correct charset. */
                 $part_name = $part->getName(true);
-                $newPart->setCharset(Horde_Nls::getCharset());
+                $newPart->setCharset($GLOBALS['registry']->getCharset());
                 $newPart->setContents(sprintf(_("[Attachment stripped: Original attachment type: %s, name: %s]"), $part->getType(), $part_name ? $part_name : _("unnamed")));
 
                 $parts[] = array(
index d1a628a..2f9276b 100644 (file)
@@ -107,7 +107,7 @@ class IMP_Horde_Mime_Viewer_Alternative extends Horde_Mime_Viewer_Driver
                         'type' => 'info'
                     )
                 ),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             );
             return $ret;
         }
index ec065ea..6d6e8b7 100644 (file)
@@ -108,7 +108,7 @@ class IMP_Horde_Mime_Viewer_Appledouble extends Horde_Mime_Viewer_Driver
                     ? array(
                           'data' => '',
                           'status' => array($status),
-                          'type' => 'text/html; charset=' . Horde_Nls::getCharset(),
+                          'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset(),
                           'wrap' => 'mimePartWrap'
                       )
                     : null;
index 1995194..3aae5d3 100644 (file)
@@ -118,7 +118,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
                             )
                         )
                     ),
-                    'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                    'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
                 )
             );
         }
@@ -166,7 +166,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
                         )
                     )
                 ),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
@@ -193,13 +193,13 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
          * text. */
         if (($_SESSION['imp']['view'] == 'mimp') ||
             (!$inline && Horde_Util::getFormData('convert_text'))) {
-            $data = Horde_Text_Filter::filter($data, 'Html2text', array('charset' => Horde_Nls::getCharset(), 'wrap' => false));
+            $data = Horde_Text_Filter::filter($data, 'Html2text', array('charset' => $GLOBALS['registry']->getCharset(), 'wrap' => false));
 
             // Filter bad language.
             return array(
                 'data' => IMP::filterText($data),
                 'status' => array(),
-                'type' => 'text/plain; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/plain; charset=' . $GLOBALS['registry']->getCharset()
             );
         }
 
@@ -306,7 +306,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
      */
     protected function _mailtoCallback($m)
     {
-        return 'href="' . $GLOBALS['registry']->call('mail/compose', array(Horde_String::convertCharset(html_entity_decode($m[2]), 'ISO-8859-1', Horde_Nls::getCharset()))) . '"';
+        return 'href="' . $GLOBALS['registry']->call('mail/compose', array(Horde_String::convertCharset(html_entity_decode($m[2]), 'ISO-8859-1', $GLOBALS['registry']->getCharset()))) . '"';
     }
 
     /**
index 105426f..cc4e23e 100644 (file)
@@ -93,7 +93,7 @@ class IMP_Horde_Mime_Viewer_Images extends Horde_Mime_Viewer_Images
                     $this->_mimepart->getMimeId() => array(
                         'data' => $this->_outputImgTag('data', $this->_mimepart->getName(true)),
                         'status' => array(),
-                        'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                        'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
                     )
                 );
             } else {
@@ -123,7 +123,7 @@ class IMP_Horde_Mime_Viewer_Images extends Horde_Mime_Viewer_Images
                         'text' => $status
                     )
                 ),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
@@ -161,7 +161,7 @@ class IMP_Horde_Mime_Viewer_Images extends Horde_Mime_Viewer_Images
                         'text' => $status
                     )
                 ),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
@@ -202,7 +202,7 @@ EOD;
             $this->_mimepart->getMimeId() => array(
                 'data' => $str,
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
@@ -293,7 +293,7 @@ EOD;
      */
     protected function _outputImgTag($type, $alt)
     {
-        return '<img src="' . $this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('imp_img_view' => $type))) . '" alt="' . htmlspecialchars($alt, ENT_COMPAT, Horde_Nls::getCharset()) . '" />';
+        return '<img src="' . $this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('imp_img_view' => $type))) . '" alt="' . htmlspecialchars($alt, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '" />';
     }
 
 }
index 376e49e..01a76aa 100644 (file)
@@ -75,7 +75,7 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver
     {
         global $registry;
 
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
         $data = $this->_mimepart->getContents();
         $mime_id = $this->_mimepart->getMimeId();
 
@@ -485,7 +485,7 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver
             }
             return array(
                 $mime_id => array(
-                    'data' => Horde_String::convertCharset(Horde::escapeJson(Horde::prepareResponse(null, true), array('charset' => Horde_Nls::getCharset())), Horde_Nls::getCharset(), 'UTF-8'),
+                    'data' => Horde_String::convertCharset(Horde::escapeJson(Horde::prepareResponse(null, true), array('charset' => $GLOBALS['registry']->getCharset())), $GLOBALS['registry']->getCharset(), 'UTF-8'),
                     'status' => array(),
                     'name' => null,
                     'type' => 'application/json'
index 50ca27b..b8ea59a 100644 (file)
@@ -109,7 +109,7 @@ class IMP_Horde_Mime_Viewer_Mdn extends Horde_Mime_Viewer_Driver
         $ret[$mdn_id] = array(
             'data' => $data,
             'status' => $status,
-            'type' => 'text/html; charset=' . Horde_Nls::getCharset(),
+            'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset(),
             'wrap' => 'mimePartWrap'
         );
 
index 8f6929c..013eb6e 100644 (file)
@@ -59,7 +59,7 @@ class IMP_Horde_Mime_Viewer_Partial extends Horde_Mime_Viewer_Driver
                 $id => array(
                     'data' => null,
                     'status' => array(self::$_statuscache[$id]),
-                    'type' => 'text/plain; charset=' . Horde_Nls::getCharset()
+                    'type' => 'text/plain; charset=' . $GLOBALS['registry']->getCharset()
                 )
             );
         } else {
index 94cd4a4..2ab3c7b 100644 (file)
@@ -95,7 +95,7 @@ class IMP_Horde_Mime_Viewer_Pdf extends Horde_Mime_Viewer_Pdf
                         'text' => $status
                     )
                 ),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
@@ -144,7 +144,7 @@ class IMP_Horde_Mime_Viewer_Pdf extends Horde_Mime_Viewer_Pdf
      */
     protected function _outputImgTag()
     {
-        return '<img src="' . $this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('pdf_view_thumbnail' => 1))) . '" alt="' . htmlspecialchars(_("View PDF File"), ENT_COMPAT, Horde_Nls::getCharset()) . '" />';
+        return '<img src="' . $this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('pdf_view_thumbnail' => 1))) . '" alt="' . htmlspecialchars(_("View PDF File"), ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '" />';
     }
 
 }
index 0244dee..cc7ce44 100644 (file)
@@ -77,7 +77,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver
             $id => array(
                 'data' => '',
                 'status' => array(),
-                'type' => 'text/plain; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/plain; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
 
@@ -130,7 +130,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver
                     $id => array(
                         'data' => null,
                         'status' => self::$_cache[$id]['status'],
-                        'type' => 'text/plain; charset=' . Horde_Nls::getCharset(),
+                        'type' => 'text/plain; charset=' . $GLOBALS['registry']->getCharset(),
                         'wrap' => self::$_cache[$id]['wrap']
                     )
                 ), self::$_cache[$id]['other']);
@@ -313,7 +313,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver
             $mime_id => array(
                 'data' => $data,
                 'status' => array($status),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
@@ -339,7 +339,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver
                         'text' => array()
                     )
                 ),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset(),
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset(),
                 'wrap' => 'mimePartWrap'
             ),
             $sig_id => null
index 87501b0..994c3cf 100644 (file)
@@ -79,7 +79,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain
         // Convert to the local charset.
         if ($inline) {
             $text = Horde_String::convertCharset($text, $charset);
-            $charset = Horde_Nls::getCharset();
+            $charset = $GLOBALS['registry']->getCharset();
         }
         $type = 'text/html; charset=' . $charset;
 
@@ -317,7 +317,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain
 
         $text_part = new Horde_Mime_Part();
         $text_part->setType('text/plain');
-        $text_part->setCharset(Horde_Nls::getCharset());
+        $text_part->setCharset($GLOBALS['registry']->getCharset());
         $text_part->setContents(preg_replace("/begin [0-7]{3} .+\r?\n.+\r?\nend/Us", "\n", $text));
         $new_part->addPart($text_part);
 
@@ -347,7 +347,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain
         // Escape text
         $filters = array(
             'text2html' => array(
-                'charset' => Horde_Nls::getCharset(),
+                'charset' => $GLOBALS['registry']->getCharset(),
                 'parselevel' => Horde_Text_Filter_Text2html::MICRO
             ),
             'tabs2spaces' => array(),
index 71e03e5..ac17474 100644 (file)
@@ -118,7 +118,7 @@ class IMP_Horde_Mime_Viewer_Smime extends Horde_Mime_Viewer_Driver
                     $id => array(
                         'data' => null,
                         'status' => self::$_cache[$id]['status'],
-                        'type' => 'text/plain; charset=' . Horde_Nls::getCharset(),
+                        'type' => 'text/plain; charset=' . $GLOBALS['registry']->getCharset(),
                         'wrap' => self::$_cache[$id]['wrap']
                     )
                 );
@@ -363,7 +363,7 @@ class IMP_Horde_Mime_Viewer_Smime extends Horde_Mime_Viewer_Driver
             $this->_mimepart->getMimeId() => array(
                 'data' => $this->_impsmime->certToHTML($sig_result->cert),
                 'status' => array(),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index 1958d68..9483f5b 100644 (file)
@@ -152,7 +152,7 @@ class IMP_Horde_Mime_Viewer_Status extends Horde_Mime_Viewer_Driver
         $ret[$this->_mimepart->getMimeId()] = array(
             'data' => $data,
             'status' => $status,
-            'type' => 'text/html; charset=' . Horde_Nls::getCharset(),
+            'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset(),
             'wrap' => 'mimePartWrap'
         );
 
index 58dd32b..1a49036 100644 (file)
@@ -132,7 +132,7 @@ class IMP_Horde_Mime_Viewer_Tnef extends Horde_Mime_Viewer_Tnef
                         'text' => array(_("The following files were attached to this part:"))
                     )
                 ),
-                'type' => 'text/html; charset=' . Horde_Nls::getCharset()
+                'type' => 'text/html; charset=' . $GLOBALS['registry']->getCharset()
             )
         );
     }
index f7ff012..8a07974 100644 (file)
@@ -105,7 +105,7 @@ class IMP_Prefs_Ui
         case 'display':
             /* Set the timezone on this page so the 'time_format' output uses
              * the configured time zone's time, not the system's time zone. */
-            Horde_Nls::setTimeZone();
+            $registry->setTimeZone();
             if ($pop3) {
                 $ui->suppress[] = 'nav_expanded';
                 $ui->suppress[] = 'tree_view';
@@ -224,7 +224,7 @@ class IMP_Prefs_Ui
             if (!empty($code)) {
                 Horde::addScriptFile('folderprefs.js', 'imp');
                 Horde::addInlineScript(array(
-                    'ImpFolderPrefs.folders = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, Horde_Nls::getCharset())
+                    'ImpFolderPrefs.folders = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
                 ));
             }
             break;
@@ -540,7 +540,7 @@ class IMP_Prefs_Ui
         $ui->nobuttons = true;
 
         Horde::addInlineScript(array(
-            'ImpAccountsPrefs.confirm_delete = ' . Horde_Serialize::serialize(_("Are you sure you want to delete this account?"), Horde_Serialize::JSON, Horde_Nls::getCharset())
+            'ImpAccountsPrefs.confirm_delete = ' . Horde_Serialize::serialize(_("Are you sure you want to delete this account?"), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
         ));
 
         $t = $GLOBALS['injector']->createInstance('Horde_Template');
@@ -864,8 +864,8 @@ class IMP_Prefs_Ui
     protected function _flagManagement()
     {
         Horde::addInlineScript(array(
-            'ImpFlagPrefs.new_prompt = ' . Horde_Serialize::serialize(_("Please enter the label for the new flag:"), Horde_Serialize::JSON, Horde_Nls::getCharset()),
-            'ImpFlagPrefs.confirm_delete = ' . Horde_Serialize::serialize(_("Are you sure you want to delete this flag?"), Horde_Serialize::JSON, Horde_Nls::getCharset())
+            'ImpFlagPrefs.new_prompt = ' . Horde_Serialize::serialize(_("Please enter the label for the new flag:"), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()),
+            'ImpFlagPrefs.confirm_delete = ' . Horde_Serialize::serialize(_("Are you sure you want to delete this flag?"), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
         ));
 
         $msgflags_locked = $GLOBALS['prefs']->isLocked('msgflags');
@@ -1189,8 +1189,8 @@ class IMP_Prefs_Ui
         Horde::addInlineScript(array(
             'ImpFolderPrefs.folders = ' . Horde_Serialize::serialize(array(
                 'sent_mail_folder' => _("Create a new sent-mail folder")
-            ), Horde_Serialize::JSON, Horde_Nls::getCharset()),
-            'ImpFolderPrefs.sentmail = ' . Horde_Serialize::serialize($js, Horde_Serialize::JSON, Horde_Nls::getCharset())
+            ), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()),
+            'ImpFolderPrefs.sentmail = ' . Horde_Serialize::serialize($js, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
         ));
 
         $t = $GLOBALS['injector']->createInstance('Horde_Template');
@@ -1223,7 +1223,7 @@ class IMP_Prefs_Ui
 
         $sent_mail_folder = $ui->vars->sent_mail_folder;
         if (empty($sent_mail_folder)) {
-            $sent_mail_new = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->appendNamespace(Horde_String::convertCharset($ui->vars->sent_mail_folder_new, Horde_Nls::getCharset(), 'UTF7-IMAP'));
+            $sent_mail_new = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->appendNamespace(Horde_String::convertCharset($ui->vars->sent_mail_folder_new, $GLOBALS['registry']->getCharset(), 'UTF7-IMAP'));
         } elseif (($sent_mail_folder == '-1') &&
                   ($sm_default = $prefs->getDefault('sent_mail_folder'))) {
             $sent_mail_folder = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->appendNamespace($sm_default);
@@ -1392,7 +1392,7 @@ class IMP_Prefs_Ui
         };
 
         Horde::addInlineScript(array(
-            'ImpHtmlSignaturePrefs.sigs = ' . Horde_Serialize::serialize($js, Horde_Serialize::JSON, Horde_Nls::getCharset())
+            'ImpHtmlSignaturePrefs.sigs = ' . Horde_Serialize::serialize($js, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
         ));
 
         $t = $GLOBALS['injector']->createInstance('Horde_Template');
@@ -1558,7 +1558,7 @@ class IMP_Prefs_Ui
         }
 
         if ($updated) {
-            $GLOBALS['prefs']->setValue('stationery', serialize(Horde_String::convertCharset(array_values($ob->stationery_list), Horde_Nls::getCharset(), $GLOBALS['prefs']->getCharset())), false);
+            $GLOBALS['prefs']->setValue('stationery', serialize(Horde_String::convertCharset(array_values($ob->stationery_list), $GLOBALS['registry']->getCharset(), $GLOBALS['prefs']->getCharset())), false);
             $GLOBALS['notification']->push($updated, 'horde.success');
         }
     }
@@ -1595,7 +1595,7 @@ class IMP_Prefs_Ui
 
         if ($ui->vars->last_type != $type) {
             $content = ($type == 'plain')
-                ? Horde_Text_Filter::filter($content, 'Html2text', array('charset' => Horde_Nls::getCharset()))
+                ? Horde_Text_Filter::filter($content, 'Html2text', array('charset' => $GLOBALS['registry']->getCharset()))
                 : nl2br(htmlspecialchars(htmlspecialchars($content)));
         }
 
@@ -1688,7 +1688,7 @@ class IMP_Prefs_Ui
             return false;
         }
 
-        $new = Horde_String::convertCharset($new, Horde_Nls::getCharset(), 'UTF7-IMAP');
+        $new = Horde_String::convertCharset($new, $GLOBALS['registry']->getCharset(), 'UTF7-IMAP');
 
         if ($folder == IMP::PREF_NO_FOLDER) {
             $prefs->setValue($pref, '');
index cef418a..b9ad898 100644 (file)
@@ -140,7 +140,7 @@ class IMP_Spam
 
                     /* Send the message. */
                     try {
-                        $imp_compose->sendMessage($to, $spam_headers, $mime, Horde_Nls::getCharset());
+                        $imp_compose->sendMessage($to, $spam_headers, $mime, $GLOBALS['registry']->getCharset());
                         $report_flag = true;
                     } catch (IMP_Compose_Exception $e) {
                         Horde::logMessage($e, 'ERR');
index 79d15a4..5a81fb0 100644 (file)
@@ -354,7 +354,7 @@ class IMP_Ui_Compose
                 }
             }
 
-            $data = Horde_Text_Filter::filter($data, 'Html2text', array('charset' => Horde_Nls::getCharset(), 'wrap' => false));
+            $data = Horde_Text_Filter::filter($data, 'Html2text', array('charset' => $GLOBALS['registry']->getCharset(), 'wrap' => false));
             $sig = $txt_sig;
             break;
         }
index 2b98bfc..4a8edf2 100644 (file)
@@ -252,7 +252,7 @@ class IMP_Ui_Mailbox
         $new_subject = $subject = IMP::filterText(preg_replace("/\s+/", ' ', $subject));
 
         if ($htmlspaces) {
-            $new_subject = Horde_Text_Filter::filter($subject, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true));
+            $new_subject = Horde_Text_Filter::filter($subject, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true));
             if (empty($new_subject)) {
                 $new_subject = htmlspecialchars($subject);
             }
index 8313e5d..295f1fe 100644 (file)
@@ -77,7 +77,7 @@ class IMP_Views_ListMessages
         }
 
         /* Set the current time zone. */
-        Horde_Nls::setTimeZone();
+        $GLOBALS['registry']->setTimeZone();
 
         /* Run filters now. */
         if (!$is_search &&
@@ -367,7 +367,7 @@ class IMP_Views_ListMessages
 
         /* Get mailbox information. */
         $overview = $imp_mailbox->getMailboxArray($msglist, array('headers' => true, 'structure' => $GLOBALS['prefs']->getValue('atc_flag')));
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
         $imp_ui = new IMP_Ui_Mailbox($folder);
         $no_flags_hook = false;
 
index 89fbc86..cb2655c 100644 (file)
@@ -104,7 +104,7 @@ class IMP_Views_ShowMessage
         );
 
         /* Set the current time zone. */
-        Horde_Nls::setTimeZone();
+        $GLOBALS['registry']->setTimeZone();
 
         /* Get envelope/header information. We don't use flags in this
          * view. */
index f84db26..bcafdc3 100644 (file)
  */
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-Horde_Registry::appInit('imp', array('impmode' => 'mimp'));
-
-Horde_Nls::setTimeZone();
+Horde_Registry::appInit('imp', array(
+    'impmode' => 'mimp',
+    'timezone' => true
+));
 
 $imp_search = $injector->getInstance('IMP_Search');
 $imp_ui_mimp = $injector->getInstance('IMP_Ui_Mimp');
index 8dfafee..cdc4336 100644 (file)
@@ -36,7 +36,7 @@ function _outputSummaries($msgs)
 require_once dirname(__FILE__) . '/lib/Application.php';
 Horde_Registry::appInit('imp');
 
-Horde_Nls::setTimeZone();
+$registry->setTimeZone();
 
 /* Call the mailbox redirection hook, if requested. */
 try {
@@ -241,7 +241,7 @@ if ($readonly) {
 
 /* Generate paging links. */
 if ($pageOb['pagecount']) {
-    $rtl = !empty(Horde_Nls::$config['rtl'][$language]);
+    $rtl = !empty($registry->nlsconfig['rtl'][$language]);
     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');
@@ -767,7 +767,7 @@ while (list(,$ob) = each($mbox_info['overview'])) {
     }
 
     /* Format the From: Header. */
-    $getfrom = $imp_ui->getFrom($ob['envelope'], array('fullfrom' => true, 'specialchars' => Horde_Nls::getCharset()));
+    $getfrom = $imp_ui->getFrom($ob['envelope'], array('fullfrom' => true, 'specialchars' => $registry->getCharset()));
     $msg['from'] = $getfrom['from'];
     $msg['fullfrom'] = $getfrom['fullfrom'];
     switch ($fromlinkstyle) {
index 4c1e59a..a702ced 100644 (file)
  */
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-Horde_Registry::appInit('imp', array('impmode' => 'mimp'));
+Horde_Registry::appInit('imp', array(
+    'impmode' => 'mimp',
+    'timezone' => true
+));
 
-Horde_Nls::setTimeZone();
 $vars = Horde_Variables::getDefaultVariables();
 
 /* Make sure we have a valid index. */
-$imp_mailbox = $GLOBALS['injector']->getInstance('IMP_Mailbox')->getOb(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid));
+$imp_mailbox = $injector->getInstance('IMP_Mailbox')->getOb(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid));
 if (!$imp_mailbox->isValidIndex(false)) {
     header('Location: ' . IMP::generateIMPUrl('mailbox-mimp.php', IMP::$mailbox)->setRaw(true)->add('a', 'm'));
     exit;
@@ -256,7 +258,7 @@ if ($prefs->getValue('mimp_preview_msg') &&
     $t->set('fullmsg_link', $self_link->copy()->add('fullmsg', 1));
 }
 
-$t->set('msg', nl2br(Horde_Text_Filter::filter($msg_text, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true))));
+$t->set('msg', nl2br(Horde_Text_Filter::filter($msg_text, 'space2html', array('charset' => $registry->getCharset(), 'encode' => true))));
 
 $compose_params = array(
     'identity' => $identity,
index 2620360..c783f81 100644 (file)
@@ -24,7 +24,7 @@ function _returnToMailbox($startIndex = null, $actID = null)
 require_once dirname(__FILE__) . '/lib/Application.php';
 Horde_Registry::appInit('imp');
 
-Horde_Nls::setTimeZone();
+$registry->setTimeZone();
 
 /* We know we are going to be exclusively dealing with this mailbox, so
  * select it on the IMAP server (saves some STATUS calls). Open R/W to clear
@@ -34,7 +34,7 @@ if (!($search_mbox = $injector->getInstance('IMP_Search')->isSearchMbox(IMP::$ma
 }
 
 /* Make sure we have a valid index. */
-$imp_mailbox = $GLOBALS['injector']->getInstance('IMP_Mailbox')->getOb(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid));
+$imp_mailbox = $injector->getInstance('IMP_Mailbox')->getOb(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid));
 if (!$imp_mailbox->isValidIndex(false)) {
     _returnToMailbox(null, 'message_missing');
     require IMP_BASE . '/mailbox.php';
@@ -249,14 +249,14 @@ if ($origin_host) {
         $origin_host = array($origin_host);
     }
     foreach ($origin_host as $host) {
-        $from_img .= Horde_Nls::generateFlagImageByHost($host, $injector->getInstance('Net_DNS_Resolver')) . ' ';
+        $from_img .= Horde_Ui_FlagImage::generateFlagImageByHost($host) . ' ';
     }
     trim($from_img);
 }
 
 if (empty($from_img) && !empty($envelope['from'])) {
     $from_ob = reset($envelope['from']);
-    $from_img .= Horde_Nls::generateFlagImageByHost($from_ob['host'], $injector->getInstance('Net_DNS_Resolver')) . ' ';
+    $from_img .= Horde_Ui_FlagImage::generateFlagImageByHost($from_ob['host']) . ' ';
 }
 
 if (!empty($from_img)) {
@@ -443,7 +443,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(Horde_Nls::$config['rtl'][$language]);
+$rtl = !empty($registry->nlsconfig['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 ? '>' : '<'));
index eb1b228..1f2b68b 100644 (file)
@@ -84,7 +84,7 @@ $description = ($total_num == 0)
     : sprintf(_("%u of %u messages in %s unread."), $unseen_num, $total_num, IMP::getLabel($mailbox));
 
 $t = $injector->createInstance('Horde_Template');
-$t->set('charset', Horde_Nls::getCharset());
+$t->set('charset', $registry->getCharset());
 $t->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $t->set('pubDate', htmlspecialchars(date('r')));
 $t->set('desc', htmlspecialchars($description));
index 7b2fae8..768a3c6 100644 (file)
@@ -26,7 +26,7 @@ if ($_SESSION['imp']['protocol'] == 'pop') {
     exit;
 }
 
-$imp_search = $GLOBALS['injector']->getInstance('IMP_Search');
+$imp_search = $injector->getInstance('IMP_Search');
 
 /* If search_basic_mbox is set, we are processing the search query. */
 $search_mailbox = Horde_Util::getFormData('search_basic_mbox');
index aa69f8a..69e747c 100644 (file)
@@ -41,9 +41,9 @@ if (!$browser->hasFeature('javascript') ||
     exit;
 }
 
-$imp_search = $GLOBALS['injector']->getInstance('IMP_Search');
+$imp_search = $injector->getInstance('IMP_Search');
 
-$charset = Horde_Nls::getCharset();
+$charset = $registry->getCharset();
 $criteria = Horde_Util::getFormData('criteria_form');
 $dimp_view = ($_SESSION['imp']['view'] == 'dimp');
 $search_fields = $imp_search->searchFields();
index 72b9aa5..99112bd 100644 (file)
@@ -19,7 +19,7 @@ default:
 }
 
 if (isset($GLOBALS['language'])) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index b2c0c74..f3f6398 100644 (file)
@@ -211,5 +211,5 @@ if (in_array(basename($_SERVER['PHP_SELF']), array('compose-dimp.php', 'message-
 }
 
 Horde::addInlineScript(array(
-    'var DIMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, Horde_Nls::getCharset())
+    'var DIMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
 ), null, true);
index 6b26710..de5030c 100644 (file)
@@ -71,5 +71,5 @@ $code = array(
 );
 
 Horde::addInlineScript(array(
-    'var IMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, Horde_Nls::getCharset())
+    'var IMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
 ), null, true);
index b87ab44..2dc2736 100644 (file)
  */
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-Horde_Registry::appInit('imp');
-
-Horde_Nls::setTimeZone();
+Horde_Registry::appInit('imp', array(
+    'timezone' => true
+));
 
 /* What mode are we in?
  * DEFAULT/'thread' - Thread mode
  * 'msgview' - Multiple message view
  */
-$mode = Horde_Util::getFormData('mode', 'thread');
+$vars = Horde_Variables::getDefaultVariables();
+$mode = $vars->mode
+    ? $vars->mode
+    : 'thread';
 
 $imp_imap = $injector->getInstance('IMP_Imap')->getOb();
 $imp_mailbox = $injector->getInstance('IMP_Mailbox')->getOb(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid));
@@ -35,7 +38,7 @@ if ($mode == 'thread') {
     }
 } else {
     /* MSGVIEW MODE: Make sure we have a valid list of messages. */
-    $imp_indices = new IMP_Indices(Horde_Util::getFormData('msglist'));
+    $imp_indices = new IMP_Indices($vars->msglist);
     if (!$imp_indices->count()) {
         $error = true;
     }
@@ -50,11 +53,11 @@ if ($error) {
 }
 
 /* Run through action handlers. */
-$actionID = Horde_Util::getFormData('actionID');
+$actionID = $vars->actionID;
 switch ($actionID) {
 case 'add_address':
     try {
-        $contact_link = IMP::addAddress(Horde_Util::getFormData('address'), Horde_Util::getFormData('name'));
+        $contact_link = IMP::addAddress($vars->address, $vars->name);
         $notification->push(sprintf(_("Entry \"%s\" was successfully added to the address book"), $contact_link), 'horde.success', array('content.raw'));
     } catch (Horde_Exception $e) {
         $notification->push($e);
@@ -78,7 +81,7 @@ if ($mode == 'thread') {
     $imp_indices = new IMP_Indices(IMP::$mailbox, $thread);
 }
 
-$charset = Horde_Nls::getCharset();
+$charset = $registry->getCharset();
 $imp_ui = new IMP_Ui_Message();
 
 foreach ($imp_indices->indices() as $mbox => $idxlist) {
index bb5314a..bf5b7b4 100644 (file)
@@ -41,7 +41,7 @@
 
 function _sanitizeName($name)
 {
-    return Horde_String::convertCharset(trim(preg_replace('/[^\pL\pN-+_. ]/u', '_', Horde_String::convertCharset($name, Horde_Nls::getCharset(), 'UTF-8')), ' _'), 'UTF-8');
+    return Horde_String::convertCharset(trim(preg_replace('/[^\pL\pN-+_. ]/u', '_', Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), 'UTF-8')), ' _'), 'UTF-8');
 }
 
 require_once dirname(__FILE__) . '/lib/Application.php';
index 183a4e8..685dde6 100644 (file)
@@ -64,7 +64,7 @@ case 'rule_enable':
             try {
                 $message = Horde::callHook('perms_denied', array('ingo:allow_rules'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             break 2;
@@ -73,7 +73,7 @@ case 'rule_enable':
             try {
                 $message = Horde::callHook('perms_denied', array('ingo:max_rules'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             break 2;
@@ -215,7 +215,7 @@ if (count($filter_list) == 0) {
 
         /* Create description. */
         if (!$edit_allowed) {
-            $entry['descriplink'] = @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset());
+            $entry['descriplink'] = @htmlspecialchars($name, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         } elseif (!empty($filter['conditions'])) {
             $descrip = '';
             $condition_size = count($filter['conditions']) - 1;
@@ -244,9 +244,9 @@ if (count($filter_list) == 0) {
                 $descrip .= "\n[stop]";
             }
 
-            $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset()) . '</a>';
+            $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . @htmlspecialchars($name, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</a>';
         } else {
-            $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset()) . '</a>';
+            $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . @htmlspecialchars($name, ENT_COMPAT, $GLOBALS['registry']->getCharset()) . '</a>';
         }
 
         /* Create edit link. */
index 6fbab16..cf7258b 100644 (file)
@@ -139,7 +139,7 @@ class Ingo
                     $label = $mbox['abbrev'];
                     $text .= sprintf('<option%s value="%s"%s>%s</option>%s',
                                      $disabled, $val, $sel,
-                                     Horde_Text_Filter::filter($label, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)), "\n");
+                                     Horde_Text_Filter::filter($label, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)), "\n");
                 }
 
                 return $text . '</select>';
@@ -160,7 +160,7 @@ class Ingo
     static public function createFolder($folder)
     {
         return $GLOBALS['registry']->hasMethod('mail/createFolder')
-            ? $GLOBALS['registry']->call('mail/createFolder', array('folder' => Horde_String::convertCharset($folder, Horde_Nls::getCharset(), 'UTF7-IMAP')))
+            ? $GLOBALS['registry']->call('mail/createFolder', array('folder' => Horde_String::convertCharset($folder, $GLOBALS['registry']->getCharset(), 'UTF7-IMAP')))
             : false;
     }
 
@@ -508,7 +508,7 @@ class Ingo
         if ($GLOBALS['registry']->hasMethod('mail/createFolder')) {
             Horde::addScriptFile('new_folder.js', 'ingo');
             Horde::addInlineScript(array(
-                'IngoNewFolder.folderprompt = ' . Horde_Serialize::serialize(_("Please enter the name of the new folder:"), Horde_Serialize::JSON, Horde_Nls::getCharset())
+                'IngoNewFolder.folderprompt = ' . Horde_Serialize::serialize(_("Please enter the name of the new folder:"), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset())
             ));
         }
     }
index b64b2c1..ce10ada 100644 (file)
@@ -127,7 +127,7 @@ class Ingo_Script
             $params['spam_char'] = $GLOBALS['conf']['spam']['char'];
         }
         if (!isset($params['charset'])) {
-            $params['charset'] = Horde_Nls::getCharset();
+            $params['charset'] = $GLOBALS['registry']->getCharset();
         }
         if ($script == 'Sieve') {
             if (!isset($params['date_format'])) {
index 75ad337..0270a0a 100644 (file)
@@ -123,11 +123,11 @@ class Ingo_Storage_Filters_Sql extends Ingo_Storage_Filters {
      */
     protected function _ruleToBackend($rule)
     {
-        return array(Horde_String::convertCharset($rule['name'], Horde_Nls::getCharset(), $this->_params['charset']),
+        return array(Horde_String::convertCharset($rule['name'], $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                      (int)$rule['action'],
-                     isset($rule['action-value']) ? Horde_String::convertCharset($rule['action-value'], Horde_Nls::getCharset(), $this->_params['charset']) : null,
+                     isset($rule['action-value']) ? Horde_String::convertCharset($rule['action-value'], $GLOBALS['registry']->getCharset(), $this->_params['charset']) : null,
                      isset($rule['flags']) ? (int)$rule['flags'] : null,
-                     isset($rule['conditions']) ? serialize(Horde_String::convertCharset($rule['conditions'], Horde_Nls::getCharset(), $this->_params['charset'])) : null,
+                     isset($rule['conditions']) ? serialize(Horde_String::convertCharset($rule['conditions'], $GLOBALS['registry']->getCharset(), $this->_params['charset'])) : null,
                      isset($rule['combine']) ? (int)$rule['combine'] : null,
                      isset($rule['stop']) ? (int)$rule['stop'] : null,
                      isset($rule['disable']) ? (int)(!$rule['disable']) : 1);
index 6a03166..42fcbfc 100644 (file)
@@ -64,7 +64,7 @@ class Ingo_Storage_Prefs extends Ingo_Storage
                 /* Convert rules from the old format. */
                 $data = @unserialize($prefs->getValue('rules'));
             } else {
-                $data = Horde_String::convertCharset($data, $prefs->getCharset(), Horde_Nls::getCharset());
+                $data = Horde_String::convertCharset($data, $prefs->getCharset(), $GLOBALS['registry']->getCharset());
             }
             if ($data) {
                 $ob->setFilterlist($data);
@@ -87,7 +87,7 @@ class Ingo_Storage_Prefs extends Ingo_Storage
                 /* Convert vacation from the old format. */
                 $data = unserialize($prefs->getValue('vacation'));
             } elseif (is_array($data)) {
-                $data = $prefs->convertFromDriver($data, Horde_Nls::getCharset());
+                $data = $prefs->convertFromDriver($data, $GLOBALS['registry']->getCharset());
             }
             if ($data) {
                 $ob->setVacationAddresses($data['addresses'], false);
@@ -145,7 +145,7 @@ class Ingo_Storage_Prefs extends Ingo_Storage
             return $prefs->setValue('blacklist', serialize($data));
 
         case self::ACTION_FILTERS:
-            return $prefs->setValue('rules', serialize(Horde_String::convertCharset($ob->getFilterList(), Horde_Nls::getCharset(), $prefs->getCharset())), false);
+            return $prefs->setValue('rules', serialize(Horde_String::convertCharset($ob->getFilterList(), $GLOBALS['registry']->getCharset(), $prefs->getCharset())), false);
 
         case self::ACTION_FORWARD:
             $data = array(
@@ -165,7 +165,7 @@ class Ingo_Storage_Prefs extends Ingo_Storage
                 'start' => $ob->getVacationStart(),
                 'end' => $ob->getVacationEnd(),
             );
-            return $prefs->setValue('vacation', serialize($prefs->convertToDriver($data, Horde_Nls::getCharset())), false);
+            return $prefs->setValue('vacation', serialize($prefs->convertToDriver($data, $GLOBALS['registry']->getCharset())), false);
 
         case self::ACTION_WHITELIST:
             return $prefs->setValue('whitelist', serialize($ob->getWhitelist()));
index b3e69de..5284f7c 100644 (file)
@@ -334,10 +334,10 @@ class Ingo_Storage_Sql extends Ingo_Storage
             $values = array(
                 implode("\n", $ob->getVacationAddresses()),
                 Horde_String::convertCharset($ob->getVacationSubject(),
-                                       Horde_Nls::getCharset(),
+                                       $GLOBALS['registry']->getCharset(),
                                        $this->_params['charset']),
                 Horde_String::convertCharset($ob->getVacationReason(),
-                                       Horde_Nls::getCharset(),
+                                       $GLOBALS['registry']->getCharset(),
                                        $this->_params['charset']),
                 (int)$ob->getVacationDays(),
                 (int)$ob->getVacationStart(),
index 96f409a..a0f5366 100644 (file)
@@ -20,7 +20,7 @@ if (!$perms->hasAppPermission('allow_rules')) {
     try {
         $message = Horde::callHook('perms_denied', array('ingo:allow_rules'));
     } catch (Horde_Exception_HookNotSet $e) {
-        $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, Horde_Nls::getCharset());
+        $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, $GLOBALS['registry']->getCharset());
     }
     $notification->push($message, 'horde.error', array('content.raw'));
     header('Location: ' . Horde::applicationUrl('filters.php', true));
@@ -173,7 +173,7 @@ default:
             try {
                 $message = Horde::callHook('perms_denied', array('ingo:max_rules'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             header('Location: ' . Horde::applicationUrl('filters.php', true));
index 17e8f5f..31c804e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 $page_title = $GLOBALS['registry']->get('name');
index 88f11e3..2758f6c 100644 (file)
@@ -18,7 +18,7 @@
 <table width="100%" cellspacing="0">
   <tr class="control">
     <td>
-      <?php echo Horde::label('name', _("Rule Name:")) ?> <input class="input" id="name" name="name" size="50" value="<?php echo (isset($rule['name'])) ? @htmlspecialchars($rule['name'], ENT_COMPAT, Horde_Nls::getCharset()) : '' ?>" />
+      <?php echo Horde::label('name', _("Rule Name:")) ?> <input class="input" id="name" name="name" size="50" value="<?php echo (isset($rule['name'])) ? @htmlspecialchars($rule['name'], ENT_COMPAT, $GLOBALS['registry']->getCharset()) : '' ?>" />
     </td>
     <td width="40" class="rightAlign">
       <?php echo Horde_Help::link('ingo', 'rule-name') ?>&nbsp;
index a377c5c..4ce99b3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 7d0a619..68da83a 100644 (file)
@@ -62,22 +62,22 @@ if (is_a($stories, 'PEAR_Error')) {
 
 
 $template = new Horde_Template();
-$template->set('charset', Horde_Nls::getCharset());
+$template->set('charset', $GLOBALS['registry']->getCharset());
 $template->set('jonah', 'Jonah ' . $registry->getVersion() . ' (http://www.horde.org/jonah/)');
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 if (!empty($criteria['tag_id'])) {
-    $template->set('channel_name', sprintf(_("Stories tagged with %s in %s"), $tag_name, @htmlspecialchars($channel['channel_name'], ENT_COMPAT, Horde_Nls::getCharset())));
+    $template->set('channel_name', sprintf(_("Stories tagged with %s in %s"), $tag_name, @htmlspecialchars($channel['channel_name'], ENT_COMPAT, $GLOBALS['registry']->getCharset())));
 } else {
-    $template->set('channel_name', @htmlspecialchars($channel['channel_name'], ENT_COMPAT, Horde_Nls::getCharset()));
+    $template->set('channel_name', @htmlspecialchars($channel['channel_name'], ENT_COMPAT, $GLOBALS['registry']->getCharset()));
 }
-$template->set('channel_desc', @htmlspecialchars($channel['channel_desc'], ENT_COMPAT, Horde_Nls::getCharset()));
+$template->set('channel_desc', @htmlspecialchars($channel['channel_desc'], ENT_COMPAT, $GLOBALS['registry']->getCharset()));
 $template->set('channel_updated', htmlspecialchars(date('r', $channel['channel_updated'])));
 $template->set('channel_official', htmlspecialchars($channel['channel_official']));
 $template->set('channel_rss', htmlspecialchars(Horde_Util::addParameter(Horde::applicationUrl('delivery/rss.php', true, -1), array('type' => 'rss', 'channel_id' => $channel['channel_id']))));
 $template->set('channel_rss2', htmlspecialchars(Horde_Util::addParameter(Horde::applicationUrl('delivery/rss.php', true, -1), array('type' => 'rss2', 'channel_id' => $channel['channel_id']))));
 foreach ($stories as &$story) {
-    $story['story_title'] = @htmlspecialchars($story['story_title'], ENT_COMPAT, Horde_Nls::getCharset());
-    $story['story_desc'] = @htmlspecialchars($story['story_desc'], ENT_COMPAT, Horde_Nls::getCharset());
+    $story['story_title'] = @htmlspecialchars($story['story_title'], ENT_COMPAT, $GLOBALS['registry']->getCharset());
+    $story['story_desc'] = @htmlspecialchars($story['story_desc'], ENT_COMPAT, $GLOBALS['registry']->getCharset());
     $story['story_link'] = htmlspecialchars($story['story_link']);
     $story['story_permalink'] = (isset($story['story_permalink']) ? htmlspecialchars($story['story_permalink']) : '');
     $story['story_published'] = htmlspecialchars(date('r', $story['story_published']));
index 9b0a3a6..4781c5b 100644 (file)
@@ -57,11 +57,11 @@ class Horde_Block_Jonah_latest extends Horde_Block {
 
         $story = $this->_fetch();
         return is_a($story, 'PEAR_Error')
-            ? @htmlspecialchars($story->getMessage(), ENT_COMPAT, Horde_Nls::getCharset())
+            ? @htmlspecialchars($story->getMessage(), ENT_COMPAT, $GLOBALS['registry']->getCharset())
             : '<span class="storyDate">'
-                . @htmlspecialchars($story['story_updated_date'], ENT_COMPAT, Horde_Nls::getCharset())
+                . @htmlspecialchars($story['story_updated_date'], ENT_COMPAT, $GLOBALS['registry']->getCharset())
                 . '</span> '
-                . @htmlspecialchars($story['story_title'], ENT_COMPAT, Horde_Nls::getCharset());
+                . @htmlspecialchars($story['story_title'], ENT_COMPAT, $GLOBALS['registry']->getCharset());
     }
 
     /**
index 50e5690..4bd45c5 100644 (file)
@@ -60,15 +60,15 @@ class Horde_Block_Jonah_news extends Horde_Block {
         $news = Jonah_News::factory();
         $channel = $news->getChannel($this->_params['source']);
         if (is_a($channel, 'PEAR_Error')) {
-            return @htmlspecialchars($channel->getMessage(), ENT_COMPAT, Horde_Nls::getCharset());
+            return @htmlspecialchars($channel->getMessage(), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
 
         if (!empty($channel['channel_link'])) {
             $title = Horde::link(htmlspecialchars($channel['channel_link']), '', '', '_blank')
-                . @htmlspecialchars($channel['channel_name'], ENT_COMPAT, Horde_Nls::getCharset())
+                . @htmlspecialchars($channel['channel_name'], ENT_COMPAT, $GLOBALS['registry']->getCharset())
                 . '</a>';
         } else {
-            $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, Horde_Nls::getCharset());
+            $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
 
         return $title;
index af29ef8..0c34b80 100644 (file)
@@ -57,15 +57,15 @@ class Horde_Block_Jonah_news_popular extends Horde_Block {
         $news = Jonah_News::factory();
         $channel = $news->getChannel($this->_params['source']);
         if (is_a($channel, 'PEAR_Error')) {
-            return @htmlspecialchars($channel->getMessage(), ENT_COMPAT, Horde_Nls::getCharset());
+            return @htmlspecialchars($channel->getMessage(), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
 
         if (!empty($channel['channel_link'])) {
             $title = Horde::link(htmlspecialchars($channel['channel_link']), '', '', '_blank')
-                . @htmlspecialchars($channel['channel_name'], ENT_COMPAT, Horde_Nls::getCharset())
+                . @htmlspecialchars($channel['channel_name'], ENT_COMPAT, $GLOBALS['registry']->getCharset())
                 . _(" - Most read stories") . '</a>';
         } else {
-            $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, Horde_Nls::getCharset())
+            $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, $GLOBALS['registry']->getCharset())
                 . _(" - Most read stories");
         }
 
index ad2c1fb..a3ea14a 100644 (file)
@@ -57,11 +57,11 @@ class Horde_Block_Jonah_story extends Horde_Block {
 
         $story = $this->_fetch();
         return is_a($story, 'PEAR_Error')
-            ? @htmlspecialchars($story->getMessage(), ENT_COMPAT, Horde_Nls::getCharset())
+            ? @htmlspecialchars($story->getMessage(), ENT_COMPAT, $GLOBALS['registry']->getCharset())
             : '<span class="storyDate">'
-                . @htmlspecialchars($story['story_updated_date'], ENT_COMPAT, Horde_Nls::getCharset())
+                . @htmlspecialchars($story['story_updated_date'], ENT_COMPAT, $GLOBALS['registry']->getCharset())
                 . '</span> '
-                . @htmlspecialchars($story['story_title'], ENT_COMPAT, Horde_Nls::getCharset());
+                . @htmlspecialchars($story['story_title'], ENT_COMPAT, $GLOBALS['registry']->getCharset());
     }
 
     /**
index 3709572..4a5004c 100644 (file)
@@ -477,18 +477,18 @@ class Jonah_Driver
             $body_text = Horde_Text_Filter::filter($body_html, 'html2text');
 
             /* Add description. */
-            $body_html = '<p>' . Horde_Text_Filter::filter($story['story_desc'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => Horde_Nls::getCharset(), 'class' => null, 'callback' => null)) . "</p>\n" . $body_html;
+            $body_html = '<p>' . Horde_Text_Filter::filter($story['story_desc'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => $GLOBALS['registry']->getCharset(), 'class' => null, 'callback' => null)) . "</p>\n" . $body_html;
             $body_text = Horde_String::wrap('  ' . $story['story_desc'], 70) . "\n\n" . $body_text;
 
             /* Add the text version of the story to the base message. */
             $message_text = new MIME_Part('text/plain');
-            $message_text->setCharset(Horde_Nls::getCharset());
+            $message_text->setCharset($GLOBALS['registry']->getCharset());
             $message_text->setContents($message_text->replaceEOL($body_text));
             $message_text->setDescription(_("Plaintext Version of Story"));
 
             /* Add an HTML version of the story to the base message. */
             $message_html = new MIME_Part('text/html', Horde_String::wrap($body_html),
-                                          Horde_Nls::getCharset(), 'inline');
+                                          $GLOBALS['registry']->getCharset(), 'inline');
             $message_html->setDescription(_("HTML Version of Story"));
 
             /* Add the two parts as multipart/alternative. */
@@ -502,7 +502,7 @@ class Jonah_Driver
             /* This is just a plain text story. */
             $message_text = new MIME_Part('text/plain');
             $message_text->setContents($message_text->replaceEOL($story['story_desc'] . "\n\n" . $story['story_body']));
-            $message_text->setCharset(Horde_Nls::getCharset());
+            $message_text->setCharset($GLOBALS['registry']->getCharset());
 
             return $message_text;
         }
index 71338d5..504f146 100644 (file)
@@ -93,7 +93,7 @@ class Jonah_Driver_Sql extends Jonah_Driver
 
         array_unshift($values,
                       (int)$info['channel_id'],
-                      Horde_String::convertCharset($info['channel_name'], Horde_Nls::getCharset(), $this->_params['charset']),
+                      Horde_String::convertCharset($info['channel_name'], $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                       (int)$info['channel_type'],
                       isset($info['channel_desc']) ? $info['channel_desc'] : null,
                       isset($info['channel_interval']) ? (int)$info['channel_interval'] : null,
@@ -273,10 +273,10 @@ class Jonah_Driver_Sql extends Jonah_Driver
         array_unshift($values,
                       (int)$info['story_id'],
                       (int)$info['channel_id'],
-                      Horde_String::convertCharset($info['story_title'], Horde_Nls::getCharset(), $this->_params['charset']),
-                      Horde_String::convertCharset($info['story_desc'], Horde_Nls::getCharset(), $this->_params['charset']),
+                      Horde_String::convertCharset($info['story_title'], $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                      Horde_String::convertCharset($info['story_desc'], $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                       $info['story_body_type'],
-                      isset($info['story_body']) ? Horde_String::convertCharset($info['story_body'], Horde_Nls::getCharset(), $this->_params['charset']) : null,
+                      isset($info['story_body']) ? Horde_String::convertCharset($info['story_body'], $GLOBALS['registry']->getCharset(), $this->_params['charset']) : null,
                       isset($info['story_url']) ? $info['story_url'] : null,
                       isset($info['story_published']) ? (int)$info['story_published'] : null,
                       time(),
@@ -303,13 +303,13 @@ class Jonah_Driver_Sql extends Jonah_Driver
      */
     protected function _convertFromBackend($story)
     {
-        $story['story_title'] = Horde_String::convertCharset($story['story_title'], $this->_params['charset'], Horde_Nls::getCharset());
-        $story['story_desc'] = Horde_String::convertCharset($story['story_desc'], $this->_params['charset'], Horde_Nls::getCharset());
+        $story['story_title'] = Horde_String::convertCharset($story['story_title'], $this->_params['charset'], $GLOBALS['registry']->getCharset());
+        $story['story_desc'] = Horde_String::convertCharset($story['story_desc'], $this->_params['charset'], $GLOBALS['registry']->getCharset());
         if (isset($story['story_body'])) {
-            $story['story_body'] = Horde_String::convertCharset($story['story_body'], $this->_params['charset'], Horde_Nls::getCharset());
+            $story['story_body'] = Horde_String::convertCharset($story['story_body'], $this->_params['charset'], $GLOBALS['registry']->getCharset());
         }
         if (isset($story['story_tags'])) {
-            $story['story_tags'] = Horde_String::convertCharset($story['story_tags'], $this->_params['charset'], Horde_Nls::getCharset());
+            $story['story_tags'] = Horde_String::convertCharset($story['story_tags'], $this->_params['charset'], $GLOBALS['registry']->getCharset());
         }
         return $story;
     }
index e849727..12bf8fb 100644 (file)
@@ -400,10 +400,10 @@ class Jonah_News
         $cache = $GLOBALS['injector']->getInstance('Horde_Cache');
         $timestamp = time();
         if (is_a($cache, 'Horde_Cache') && ($stories = $cache->get($url, $interval))) {
-            $stories = Horde_Serialize::unserialize($stories, Horde_Serialize::UTF7_BASIC, Horde_Nls::getCharset());
+            $stories = Horde_Serialize::unserialize($stories, Horde_Serialize::UTF7_BASIC, $GLOBALS['registry']->getCharset());
         } else {
             $stories = Jonah_News::_fetchExternalStories($url, $timestamp);
-            $cache->set($url, Horde_Serialize::serialize($stories, Horde_Serialize::UTF7_BASIC, Horde_Nls::getCharset()));
+            $cache->set($url, Horde_Serialize::serialize($stories, Horde_Serialize::UTF7_BASIC, $GLOBALS['registry']->getCharset()));
         }
 
         /* If the stories from cache return the same timestamp as
@@ -630,18 +630,18 @@ class Jonah_News
             $body_text = Horde_Text_Filter::filter($body_html, 'html2text');
 
             /* Add description. */
-            $body_html = '<p>' . Horde_Text_Filter::filter($story['story_desc'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => Horde_Nls::getCharset(), 'class' => null, 'callback' => null)) . "</p>\n" . $body_html;
+            $body_html = '<p>' . Horde_Text_Filter::filter($story['story_desc'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => $GLOBALS['registry']->getCharset(), 'class' => null, 'callback' => null)) . "</p>\n" . $body_html;
             $body_text = Horde_String::wrap('  ' . $story['story_desc'], 70) . "\n\n" . $body_text;
 
             /* Add the text version of the story to the base message. */
             $message_text = new MIME_Part('text/plain');
-            $message_text->setCharset(Horde_Nls::getCharset());
+            $message_text->setCharset($GLOBALS['registry']->getCharset());
             $message_text->setContents($message_text->replaceEOL($body_text));
             $message_text->setDescription(_("Plaintext Version of Story"));
 
             /* Add an HTML version of the story to the base message. */
             $message_html = new MIME_Part('text/html', Horde_String::wrap($body_html),
-                                          Horde_Nls::getCharset(), 'inline');
+                                          $GLOBALS['registry']->getCharset(), 'inline');
             $message_html->setDescription(_("HTML Version of Story"));
 
             /* Add the two parts as multipart/alternative. */
@@ -655,7 +655,7 @@ class Jonah_News
             /* This is just a plain text story. */
             $message_text = new MIME_Part('text/plain');
             $message_text->setContents($message_text->replaceEOL($story['story_desc'] . "\n\n" . $story['story_body']));
-            $message_text->setCharset(Horde_Nls::getCharset());
+            $message_text->setCharset($GLOBALS['registry']->getCharset());
 
             return $message_text;
         }
index c7f258d..8937990 100644 (file)
@@ -91,7 +91,7 @@ class Jonah_News_sql extends Jonah_News {
 
         array_unshift($values,
                       (int)$info['channel_id'],
-                      Horde_String::convertCharset($info['channel_name'], Horde_Nls::getCharset(), $this->_params['charset']),
+                      Horde_String::convertCharset($info['channel_name'], $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                       isset($info['channel_slug']) ? $info['channel_slug'] : '',
                       (int)$info['channel_type'],
                       (int)$info['channel_full_feed'],
@@ -288,10 +288,10 @@ class Jonah_News_sql extends Jonah_News {
         array_unshift($values,
                       (int)$info['story_id'],
                       (int)$info['channel_id'],
-                      Horde_String::convertCharset($info['story_title'], Horde_Nls::getCharset(), $this->_params['charset']),
-                      Horde_String::convertCharset($info['story_desc'], Horde_Nls::getCharset(), $this->_params['charset']),
+                      Horde_String::convertCharset($info['story_title'], $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                      Horde_String::convertCharset($info['story_desc'], $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                       $info['story_body_type'],
-                      isset($info['story_body']) ? Horde_String::convertCharset($info['story_body'], Horde_Nls::getCharset(), $this->_params['charset']) : null,
+                      isset($info['story_body']) ? Horde_String::convertCharset($info['story_body'], $GLOBALS['registry']->getCharset(), $this->_params['charset']) : null,
                       isset($info['story_url']) ? $info['story_url'] : null,
                       isset($info['story_published']) ? (int)$info['story_published'] : null,
                       time(),
@@ -318,13 +318,13 @@ class Jonah_News_sql extends Jonah_News {
      */
     function _convertFromBackend($story)
     {
-        $story['story_title'] = Horde_String::convertCharset($story['story_title'], $this->_params['charset'], Horde_Nls::getCharset());
-        $story['story_desc'] = Horde_String::convertCharset($story['story_desc'], $this->_params['charset'], Horde_Nls::getCharset());
+        $story['story_title'] = Horde_String::convertCharset($story['story_title'], $this->_params['charset'], $GLOBALS['registry']->getCharset());
+        $story['story_desc'] = Horde_String::convertCharset($story['story_desc'], $this->_params['charset'], $GLOBALS['registry']->getCharset());
         if (isset($story['story_body'])) {
-            $story['story_body'] = Horde_String::convertCharset($story['story_body'], $this->_params['charset'], Horde_Nls::getCharset());
+            $story['story_body'] = Horde_String::convertCharset($story['story_body'], $this->_params['charset'], $GLOBALS['registry']->getCharset());
         }
         if (isset($story['story_tags'])) {
-            $story['story_tags'] = Horde_String::convertCharset($story['story_tags'], $this->_params['charset'], Horde_Nls::getCharset());
+            $story['story_tags'] = Horde_String::convertCharset($story['story_tags'], $this->_params['charset'], $GLOBALS['registry']->getCharset());
         }
         return $story;
     }
index 2005c82..5e53898 100644 (file)
@@ -16,12 +16,12 @@ function _mail($story_part, $from, $recipients, $subject, $note)
     $mail = new Horde_Mime_Mail(array('subject' => $subject,
                                       'to' => $recipients,
                                       'from' => $from,
-                                      'charset' => Horde_Nls::getCharset()));
+                                      'charset' => $GLOBALS['registry']->getCharset()));
     $mail->addHeader('User-Agent', 'Jonah ' . $GLOBALS['registry']->getVersion());
 
     /* If a note has been provided, add it to the message as a text part. */
     if (strlen($note) > 0) {
-        $message_note = new MIME_Part('text/plain', null, Horde_Nls::getCharset());
+        $message_note = new MIME_Part('text/plain', null, $GLOBALS['registry']->getCharset());
         $message_note->setContents($message_note->replaceEOL($note));
         $message_note->setDescription(_("Note"));
         $mail->addMIMEPart($message_note);
index dfbbe6f..669b955 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 63bc899..4f3571c 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 470ed65..a5f9cdf 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 4bda27d..78750e9 100644 (file)
@@ -40,7 +40,7 @@ if ($perms->hasAppPermission('max_events') !== true &&
     try {
         $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
     } catch (Horde_Exception_HookNotSet $e) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
     }
     $notification->push($message, 'horde.warning', array('content.raw'));
     $templates[Horde_Data::IMPORT_FILE] = array(KRONOLITH_TEMPLATES . '/data/export.inc');
@@ -168,7 +168,7 @@ case 'export':
             $calNames[] = $share->get('name');
         }
 
-        $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset(implode(', ', $calNames), Horde_Nls::getCharset(), 'utf-8'));
+        $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset(implode(', ', $calNames), $GLOBALS['registry']->getCharset(), 'utf-8'));
         $data = $iCal->exportvCalendar();
         $browser->downloadHeaders(_("events.ics"), 'text/calendar', false, strlen($data));
         echo $data;
@@ -250,7 +250,7 @@ if (is_array($next_step)) {
             try {
                 $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             break;
@@ -326,7 +326,7 @@ if (is_array($next_step)) {
 if (Horde_Util::getFormData('import_ajax')) {
     $stack = $notification->notify(array('listeners' => 'status', 'raw' => true));
     if ($stack) {
-        Horde::addInlineScript('window.parent.KronolithCore.showNotifications(window.parent.$A(' . Horde_Serialize::serialize($stack, Horde_Serialize::JSON, Horde_Nls::getCharset()) . '));');
+        Horde::addInlineScript('window.parent.KronolithCore.showNotifications(window.parent.$A(' . Horde_Serialize::serialize($stack, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . '));');
     }
     Horde::addInlineScript('window.parent.$(window.name).remove();');
     Horde::outputInlineScript();
index 00e710b..d68e194 100644 (file)
@@ -31,7 +31,7 @@ function _check_max()
         try {
             $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
         } catch (Horde_Exception_HookNotSet $e) {
-            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
         $GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
         return false;
index 666abd5..a6dee72 100644 (file)
@@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/lib/Application.php';
 Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'session_control' => 'none'));
 
 // We want to always generate UTF-8 iCalendar data.
-Horde_Nls::setCharset('UTF-8');
+$registry->setCharset('UTF-8');
 
 // Determine the username to show free/busy time for.
 $cal = Horde_Util::getFormData('c');
@@ -33,7 +33,7 @@ if (!$fb) {
     if ($user) {
         $prefs = Horde_Prefs::singleton($conf['prefs']['driver'], 'kronolith', $user, '', null, false);
         $prefs->retrieve();
-        Horde_Nls::setTimeZone();
+        $registry->setTimeZone();
         $cal = @unserialize($prefs->getValue('fb_cals'));
         if (is_array($cal)) {
             $cal = implode('|', $cal);
@@ -60,7 +60,7 @@ if (!$fb) {
 }
 
 $browser->downloadHeaders(($user ? $user : $cal) . '.vfb',
-                          'text/calendar; charset=' . Horde_Nls::getCharset(),
+                          'text/calendar; charset=' . $GLOBALS['registry']->getCharset(),
                           true,
                           strlen($fb));
 echo $fb;
index f384769..7fff2fc 100644 (file)
@@ -91,17 +91,17 @@ $history = $injector->getInstance('Horde_History');
 $now = new Horde_Date(time());
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', Horde_Nls::getCharset());
+$template->set('charset', $GLOBALS['registry']->getCharset());
 $template->set('updated', $now->format(DATE_ATOM));
 $template->set('kronolith_name', 'Kronolith');
 $template->set('kronolith_version', $registry->getVersion());
 $template->set('kronolith_uri', 'http://www.horde.org/kronolith/');
 $template->set('kronolith_icon', Horde::url(Horde_Themes::img('kronolith.png'), true, -1));
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
-$template->set('calendar_name', @htmlspecialchars($share->get('name'), ENT_COMPAT, Horde_Nls::getCharset()));
-$template->set('calendar_desc', @htmlspecialchars($share->get('desc'), ENT_COMPAT, Horde_Nls::getCharset()), true);
-$template->set('calendar_owner', @htmlspecialchars($identity->getValue('fullname'), ENT_COMPAT, Horde_Nls::getCharset()));
-$template->set('calendar_email', @htmlspecialchars($identity->getValue('from_addr'), ENT_COMPAT, Horde_Nls::getCharset()), true);
+$template->set('calendar_name', @htmlspecialchars($share->get('name'), ENT_COMPAT, $GLOBALS['registry']->getCharset()));
+$template->set('calendar_desc', @htmlspecialchars($share->get('desc'), ENT_COMPAT, $GLOBALS['registry']->getCharset()), true);
+$template->set('calendar_owner', @htmlspecialchars($identity->getValue('fullname'), ENT_COMPAT, $GLOBALS['registry']->getCharset()));
+$template->set('calendar_email', @htmlspecialchars($identity->getValue('from_addr'), ENT_COMPAT, $GLOBALS['registry']->getCharset()), true);
 $template->set('self_url', $self_url);
 
 $twentyFour = $prefs->getValue('twentyFor');
@@ -117,7 +117,7 @@ foreach ($events as $day_events) {
         }
         $modified = new Horde_Date($modified);
         /* Description. */
-        $desc = @htmlspecialchars($event->description, ENT_COMPAT, Horde_Nls::getCharset());
+        $desc = @htmlspecialchars($event->description, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         if (strlen($desc)) {
             $desc .= '<br /><br />';
         }
@@ -134,15 +134,15 @@ foreach ($events as $day_events) {
             $attendees[] = empty($status['name']) ? $attendee : Horde_Mime_Address::trimAddress($status['name'] . (strpos($attendee, '@') === false ? '' : ' <' . $attendee . '>'));
         }
         if (count($attendees)) {
-            $desc .= '<br />' . _("Who:") . ' ' . @htmlspecialchars(implode(', ', $attendees), ENT_COMPAT, Horde_Nls::getCharset());
+            $desc .= '<br />' . _("Who:") . ' ' . @htmlspecialchars(implode(', ', $attendees), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
         if (strlen($event->location)) {
-            $desc .= '<br />' . _("Where:") . ' ' . @htmlspecialchars($event->location, ENT_COMPAT, Horde_Nls::getCharset());
+            $desc .= '<br />' . _("Where:") . ' ' . @htmlspecialchars($event->location, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
         $desc .= '<br />' . _("Event Status:") . ' ' . Kronolith::statusToString($event->status);
 
-        $entries[$id]['title'] = @htmlspecialchars($event->getTitle(), ENT_COMPAT, Horde_Nls::getCharset());
-        $entries[$id]['desc'] = @htmlspecialchars($desc, ENT_COMPAT, Horde_Nls::getCharset());
+        $entries[$id]['title'] = @htmlspecialchars($event->getTitle(), ENT_COMPAT, $GLOBALS['registry']->getCharset());
+        $entries[$id]['desc'] = @htmlspecialchars($desc, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         $entries[$id]['url'] = htmlspecialchars(Horde::url($event->getViewUrl(), true, -1));
         $entries[$id]['modified'] = $modified->format(DATE_ATOM);
     }
index 54a8d36..a9356b6 100644 (file)
@@ -100,7 +100,7 @@ class Kronolith_Ajax_Application extends Horde_Ajax_Application_Base
                 try {
                     $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
                 } catch (Horde_Exception_HookNotSet $e) {
-                    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+                    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
                 }
                 $GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
                 return $result;
index acb5ea9..3c31ccf 100644 (file)
@@ -775,7 +775,7 @@ class Kronolith_Api extends Horde_Registry_Api
             $share = $kronolith_shares->getShare($event->calendar);
 
             $iCal = new Horde_iCalendar($version);
-            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), Horde_Nls::getCharset(), 'utf-8'));
+            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), $GLOBALS['registry']->getCharset(), 'utf-8'));
 
             // Create a new vEvent.
             $iCal->addComponent($event->toiCalendar($iCal));
@@ -825,9 +825,9 @@ class Kronolith_Api extends Horde_Registry_Api
             $share = $kronolith_shares->getShare($calendar);
 
             $iCal = new Horde_iCalendar($version);
-            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), Horde_Nls::getCharset(), 'UTF-8'));
+            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), $GLOBALS['registry']->getCharset(), 'UTF-8'));
             if (strlen($share->get('desc'))) {
-                $iCal->setAttribute('X-WR-CALDESC', Horde_String::convertCharset($share->get('desc'), Horde_Nls::getCharset(), 'UTF-8'));
+                $iCal->setAttribute('X-WR-CALDESC', Horde_String::convertCharset($share->get('desc'), $GLOBALS['registry']->getCharset(), 'UTF-8'));
             }
 
             foreach ($events as $dayevents) {
@@ -1215,7 +1215,7 @@ class Kronolith_Api extends Horde_Registry_Api
                     if (($reminder == 'owner' && $alarm_user == $owner) ||
                         ($reminder == 'show' && in_array($calendar, $shown_calendars)) ||
                         $reminder == 'read') {
-                            Horde_Nls::setLanguageEnvironment($prefs->getValue('language'));
+                            $GLOBALS['registry']->setLanguageEnvironment($prefs->getValue('language'));
                             $alarm = $event->toAlarm($time, $alarm_user, $prefs);
                             if ($alarm) {
                                 $alarm_list[] = $alarm;
index 5eb1e7c..fce6980 100644 (file)
@@ -65,7 +65,7 @@ class Kronolith_Application extends Horde_Registry_Application
         }
 
         /* Set the timezone variable, if available. */
-        Horde_Nls::setTimeZone();
+        $GLOBALS['registry']->setTimeZone();
 
         /* Create a share instance. */
         $GLOBALS['kronolith_shares'] = $GLOBALS['injector']->getInstance('Horde_Share')->getScope();
index 994f35e..f4c0dea 100644 (file)
@@ -30,7 +30,7 @@ class Horde_Block_kronolith_tree_alarms extends Horde_Block {
                 $alarmCount++;
                 $tree->addNode($parent . $calId . $event->id,
                                $parent,
-                               htmlspecialchars($event->getTitle(), ENT_COMPAT, Horde_Nls::getCharset()),
+                               htmlspecialchars($event->getTitle(), ENT_COMPAT, $GLOBALS['registry']->getCharset()),
                                $indent + 1,
                                false,
                                array('icon' => 'alarm.png',
index a0b32f4..5d0a078 100644 (file)
@@ -984,7 +984,7 @@ class Kronolith_Driver_Sql extends Kronolith_Driver
      */
     public function convertToDriver($value)
     {
-        return Horde_String::convertCharset($value, Horde_Nls::getCharset(), $this->_params['charset']);
+        return Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $this->_params['charset']);
     }
 
     /**
index 8d670c8..19cb5a1 100644 (file)
@@ -567,17 +567,17 @@ abstract class Kronolith_Event
             $vEvent->setAttribute('LAST-MODIFIED', $modified);
         }
 
-        $vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : Horde_String::convertCharset($this->getTitle(), Horde_Nls::getCharset(), 'utf-8'));
+        $vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : Horde_String::convertCharset($this->getTitle(), $GLOBALS['registry']->getCharset(), 'utf-8'));
         $name = Kronolith::getUserName($this->creator);
         if (!$v1) {
-            $name = Horde_String::convertCharset($name, Horde_Nls::getCharset(), 'utf-8');
+            $name = Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), 'utf-8');
         }
         $vEvent->setAttribute('ORGANIZER',
                               'mailto:' . Kronolith::getUserEmail($this->creator),
                               array('CN' => $name));
         if (!$this->private || $this->creator == $GLOBALS['registry']->getAuth()) {
             if (!empty($this->description)) {
-                $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, Horde_Nls::getCharset(), 'utf-8'));
+                $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, $GLOBALS['registry']->getCharset(), 'utf-8'));
             }
 
             // Tags
@@ -586,12 +586,12 @@ abstract class Kronolith_Event
                 $tags = implode(', ', $tags);
             }
             if (!empty($tags)) {
-                $vEvent->setAttribute('CATEGORIES', $v1 ? $tags : Horde_String::convertCharset($tags, Horde_Nls::getCharset(), 'utf-8'));
+                $vEvent->setAttribute('CATEGORIES', $v1 ? $tags : Horde_String::convertCharset($tags, $GLOBALS['registry']->getCharset(), 'utf-8'));
             }
 
             // Location
             if (!empty($this->location)) {
-                $vEvent->setAttribute('LOCATION', $v1 ? $this->location : Horde_String::convertCharset($this->location, Horde_Nls::getCharset(), 'utf-8'));
+                $vEvent->setAttribute('LOCATION', $v1 ? $this->location : Horde_String::convertCharset($this->location, $GLOBALS['registry']->getCharset(), 'utf-8'));
             }
             if ($this->geoLocation) {
                 $vEvent->setAttribute('GEO', array('latitude' => $this->geoLocation['lat'], 'longitude' => $this->geoLocation['lon']));
@@ -709,7 +709,7 @@ abstract class Kronolith_Event
                 }
             } else {
                 if (!empty($status['name'])) {
-                    $params['CN'] = Horde_String::convertCharset($status['name'], Horde_Nls::getCharset(), 'utf-8');
+                    $params['CN'] = Horde_String::convertCharset($status['name'], $GLOBALS['registry']->getCharset(), 'utf-8');
                 }
                 if (!empty($email)) {
                     $email = 'mailto:' . $email;
@@ -1085,7 +1085,7 @@ abstract class Kronolith_Event
      */
     public function fromASAppointment(Horde_ActiveSync_Message_Appointment $message)
     {
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
 
         /* New event? */
         if ($this->id === null) {
@@ -1212,7 +1212,7 @@ abstract class Kronolith_Event
      */
     public function toASAppointment()
     {
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
 
         $message = new Horde_ActiveSync_Message_Appointment(array('logger' => $GLOBALS['injector']->getInstance('Horde_Log_Logger')));
         $message->setSubject(Horde_String::convertCharset($this->getTitle(), $charset, 'utf-8'));
@@ -2001,7 +2001,7 @@ abstract class Kronolith_Event
                         // Convert IDN hosts to ASCII.
                         if (Horde_Util::extensionExists('idn')) {
                             $old_error = error_reporting(0);
-                            $url['host'] = idn_to_ascii(Horde_String::convertCharset($url['host'], Horde_Nls::getCharset(), 'UTF-8'));
+                            $url['host'] = idn_to_ascii(Horde_String::convertCharset($url['host'], $GLOBALS['registry']->getCharset(), 'UTF-8'));
                             error_reporting($old_error);
                         } elseif (Horde_Mime::is8bit($url['host'])) {
                             //throw new Kronolith_Exception(_("Invalid character in URL."));
@@ -2654,7 +2654,7 @@ abstract class Kronolith_Event
                                        '',
                                        array('style' => $this->getCSSColors(false)));
         }
-        $link .= @htmlspecialchars($event_title, ENT_QUOTES, Horde_Nls::getCharset());
+        $link .= @htmlspecialchars($event_title, ENT_QUOTES, $GLOBALS['registry']->getCharset());
         if ($read_permission && $view_url) {
             $link .= '</a>';
         }
index 628afd0..cbc7199 100644 (file)
@@ -79,7 +79,7 @@ class Kronolith
         Horde_Ui_JsCalendar::init(array('short_weekdays' => true));
 
         if (isset($GLOBALS['language'])) {
-            header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+            header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
             header('Vary: Accept-Language');
         }
 
@@ -396,7 +396,7 @@ class Kronolith
         // Maps
         $code['conf']['maps'] = $GLOBALS['conf']['maps'];
 
-        return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ';');
+        return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, $registry->getCharset()) . ';');
     }
 
     /**
@@ -1653,7 +1653,7 @@ class Kronolith
             $userName = $identity->getName();
             $mail = new Horde_Mime_Mail(
                 array('from' => $identity->getDefaultFromAddress(true),
-                      'charset' => Horde_Nls::getCharset())
+                      'charset' => $GLOBALS['registry']->getCharset())
                 );
             $mail->addHeader('User-Agent', 'Kronolith ' . $GLOBALS['registry']->getVersion());
         }
@@ -1684,7 +1684,7 @@ class Kronolith
                     }
                     $mail->addHeader('Subject', _("Ownership assignment"));
                     $mail->addHeader('To', $to);
-                    $mail->setBody($message, Horde_Nls::getCharset());
+                    $mail->setBody($message, $GLOBALS['registry']->getCharset());
                     $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
                 }
             }
@@ -1838,7 +1838,7 @@ class Kronolith
                                        $share->get('name'));
                 }
                 $mail->addHeader('To', $to);
-                $mail->setBody($message, Horde_Nls::getCharset());
+                $mail->setBody($message, $GLOBALS['registry']->getCharset());
                 $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
             }
         }
@@ -1894,7 +1894,7 @@ class Kronolith
                                            $share->get('name'));
                     }
                     $mail->addHeader('To', $groupOb->getName() . ' <' . $groupOb->data['email'] . '>');
-                    $mail->setBody($message, Horde_Nls::getCharset());
+                    $mail->setBody($message, $GLOBALS['registry']->getCharset());
                     $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
                 }
             }
@@ -2160,7 +2160,7 @@ class Kronolith
     public static function sendITipNotifications($event, $notification,
                                                  $action, $instance = null)
     {
-        global $conf;
+        global $conf, $registry;
 
         if (!$event->attendees) {
             return;
@@ -2239,7 +2239,7 @@ class Kronolith
             /* Build the iCalendar data */
             $iCal = new Horde_iCalendar();
             $iCal->setAttribute('METHOD', $method);
-            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), Horde_Nls::getCharset(), 'utf-8'));
+            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), $registry->getCharset(), 'utf-8'));
             $vevent = $event->toiCalendar($iCal);
             if ($action == self::ITIP_CANCEL && !empty($instance)) {
                 // Recurring event instance deletion, need to specify the
@@ -2256,18 +2256,18 @@ class Kronolith
             $ics->setContents($iCal->exportvCalendar());
             $ics->setName($filename);
             $ics->setContentTypeParameter('METHOD', $method);
-            $ics->setCharset(Horde_Nls::getCharset());
+            $ics->setCharset($registry->getCharset());
 
             $multipart = new Horde_Mime_Part();
             $multipart->setType('multipart/alternative');
             $bodyText = new Horde_Mime_Part();
             $bodyText->setType('text/plain');
-            $bodyText->setCharset(Horde_Nls::getCharset());
+            $bodyText->setCharset($registry->getCharset());
             $bodyText->setContents($view->render('notification.plain.php'));
             $multipart->addPart($bodyText);
             $bodyHtml = new Horde_Mime_Part();
             $bodyHtml->setType('text/html');
-            $bodyHtml->setCharset(Horde_Nls::getCharset());
+            $bodyHtml->setCharset($registry->getCharset());
             $bodyHtml->setContents($view->render('notification.html.php'));
             $multipart->addPart($bodyHtml);
             $multipart->addPart($ics);
@@ -2275,7 +2275,7 @@ class Kronolith
             $mail = new Horde_Mime_Mail(array('subject' => $view->subject,
                                               'to' => $recipient,
                                               'from' => $ident->getDefaultFromAddress(true),
-                                              'charset' => Horde_Nls::getCharset()));
+                                              'charset' => $registry->getCharset()));
             $mail->addHeader('User-Agent', 'Kronolith ' . $GLOBALS['registry']->getVersion());
             $mail->setBasePart($multipart);
 
@@ -2373,7 +2373,7 @@ class Kronolith
         }
 
         foreach ($addresses as $lang => $twentyFour) {
-            Horde_Nls::setLanguageEnvironment($lang);
+            $GLOBALS['registry']->setLanguageEnvironment($lang);
 
             switch ($action) {
             case 'add':
@@ -2405,9 +2405,9 @@ class Kronolith
                     $mime_mail = new Horde_Mime_Mail(array('subject' => $subject . ' ' . $event->title,
                                                            'to' => implode(',', $df_recipients),
                                                            'from' => $identity->getDefaultFromAddress(true),
-                                                           'charset' => Horde_Nls::getCharset()));
+                                                           'charset' => $GLOBALS['registry']->getCharset()));
                     $mime_mail->addHeader('User-Agent', 'Kronolith ' . $GLOBALS['registry']->getVersion());
-                    $mime_mail->setBody($message, Horde_Nls::getCharset(), true);
+                    $mime_mail->setBody($message, $GLOBALS['registry']->getCharset(), true);
                     Horde::logMessage(sprintf('Sending event notifications for %s to %s', $event->title, implode(', ', $df_recipients)), 'DEBUG');
                     $mime_mail->send($GLOBALS['injector']->getInstance('Horde_Mail'), false, false);
                 }
index ffe4edb..ac54434 100644 (file)
@@ -30,7 +30,7 @@ class Kronolith_View_ExportEvent {
                 $iCal->setAttribute(
                     'X-WR-CALNAME',
                     Horde_String::convertCharset($share->get('name'),
-                                                 Horde_Nls::getCharset(),
+                                                 $GLOBALS['registry']->getCharset(),
                                                  'utf-8'));
             } catch (Exception $e) {
             }
@@ -41,7 +41,7 @@ class Kronolith_View_ExportEvent {
 
         $GLOBALS['browser']->downloadHeaders(
             $event->getTitle() . '.ics',
-            'text/calendar; charset=' . Horde_Nls::getCharset(),
+            'text/calendar; charset=' . $GLOBALS['registry']->getCharset(),
             true, strlen($content));
         echo $content;
         exit;
index 200856d..157cc31 100644 (file)
@@ -22,7 +22,7 @@ if ($perms->hasAppPermission('max_events') !== true &&
     try {
         $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
     } catch (Horde_Exception_HookNotSet $e) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
+        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
     }
     $notification->push($message, 'horde.error', array('content.raw'));
     header('Location: ' . $url);
index d260db5..d8f79b4 100755 (executable)
@@ -130,11 +130,11 @@ function send_agendas()
         $lang = $prefs->getValue('language');
         $twentyFour = $prefs->getValue('twentyFour');
         $dateFormat = $prefs->getValue('date_format');
-        Horde_Nls::setLanguageEnvironment($lang);
+        $GLOBALS['registry']->setLanguageEnvironment($lang);
         $mime_mail = new Horde_Mime_Mail(array('subject' => sprintf(_("Your daily agenda for %s"), $runtime->strftime($dateFormat)),
                                                'to' => $email,
                                                'from' => $GLOBALS['conf']['reminder']['from_addr'],
-                                               'charset' => Horde_Nls::getCharset()));
+                                               'charset' => $GLOBALS['registry']->getCharset()));
         $mime_mail->addHeader('User-Agent', 'Kronolith ' . $GLOBALS['registry']->getVersion());
 
         $pad = max(Horde_String::length(_("All day")) + 2, $twentyFour ? 6 : 8);
@@ -151,7 +151,7 @@ function send_agendas()
             $message .= $event->title . "\n";
         }
 
-        $mime_mail->setBody($message, Horde_Nls::getCharset(), true);
+        $mime_mail->setBody($message, $GLOBALS['registry']->getCharset(), true);
         try {
             $mime_mail->addRecipients($email);
         } catch (Horde_Mime_Exception $e) {}
index 125a8b9..f78aa19 100644 (file)
@@ -5,7 +5,7 @@ Horde::addScriptFile('views.js', 'kronolith');
 Horde::addScriptFile('stripe.js', 'horde');
 
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 6391a8d..12fea80 100644 (file)
@@ -22,7 +22,7 @@
     <?php if (strlen($this->event->description)): ?>
     <tr>
       <td style="font-weight:bold;vertical-align:top"><?php echo _("Description:") ?></td>
-         <td><?php echo Horde_Text_Filter::filter($this->event->description, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'callback' => null, 'class' => null, 'charset' => Horde_Nls::getCharset())) ?></td>
+         <td><?php echo Horde_Text_Filter::filter($this->event->description, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'callback' => null, 'class' => null, 'charset' => $GLOBALS['registry']->getCharset())) ?></td>
     </tr>
     <?php endif; ?>
     <?php if ($this->attendees): ?>
index b5bd91c..3d9d4a5 100644 (file)
@@ -3,7 +3,7 @@
  * JavaScript variables for the traditional interface.
  */
 
-$charset = Horde_Nls::getCharset();
+$charset = $GLOBALS['registry']->getCharset();
 
 /* Variables used in core javascript files. */
 $var = array(
index 9d39410..0ed31b6 100644 (file)
@@ -26,7 +26,7 @@
 <!-- owner -->
 <tr>
  <td class="rightAlign"><strong><?php echo _("Owner") ?>&nbsp;&nbsp;</strong></td>
- <td><?php echo @htmlspecialchars($owner, ENT_COMPAT, Horde_Nls::getCharset()) ?> </td>
+ <td><?php echo @htmlspecialchars($owner, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?> </td>
 </tr>
 <?php endif; ?>
 
@@ -74,14 +74,14 @@ if ($this->event->initialized && $this->event->alarm > 0):
 <?php if (isset($created)): ?>
 <tr>
   <td class="nowrap rightAlign"><strong><?php echo _("Created") ?></strong>&nbsp;&nbsp;</td>
-  <td class="nowrap"><?php  echo $created->strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, Horde_Nls::getCharset()) ?></td>
+  <td class="nowrap"><?php  echo $created->strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></td>
 </tr>
 <?php endif; ?>
 
 <?php if (isset($modified)): ?>
 <tr>
   <td class="nowrap rightAlign"><strong><?php echo _("Last Modified") ?></strong>&nbsp;&nbsp;</td>
-  <td class="nowrap"><?php echo $modified->strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, Horde_Nls::getCharset()) ?></td>
+  <td class="nowrap"><?php echo $modified->strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></td>
 </tr>
 <?php endif; ?>
 
index acb8526..1aee6cf 100644 (file)
@@ -170,7 +170,7 @@ class Luxor_Lang_Generic extends Luxor_Lang
         global $index, $sourceid;
 
         // Make sure spacing is correct.
-        $code = Horde_Text_Filter::filter($code, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true));
+        $code = Horde_Text_Filter::filter($code, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
 
         // Split all the symbols.
         preg_match_all('/(^|[^\w\#&])([\w~][\w]*)\b/', $code, $match);
index 1c6e912..b8667b0 100644 (file)
@@ -360,7 +360,7 @@ class Luxor
         $res = '';
         foreach ($lines as $line) {
             $res .= !empty($res) ? "\n" : '';
-            $res .= $pre . Horde_Text_Filter::filter($line, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)) . $post;
+            $res .= $pre . Horde_Text_Filter::filter($line, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)) . $post;
         }
         return $res;
     }
index f6830d8..07a341f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index d41acc7..7fa7fcb 100644 (file)
@@ -34,7 +34,7 @@ $templates = array(
 );
 if ($GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') !== true &&
     $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') <= Mnemo::countMemos()) {
-    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, Horde_Nls::getCharset());
+    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
     if (!empty($conf['hooks']['permsdenied'])) {
         $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message);
     }
@@ -120,7 +120,7 @@ if (is_array($next_step)) {
     $num_memos = Mnemo::countMemos();
     foreach ($next_step as $row) {
         if ($max_memos !== true && $num_memos >= $max_memos) {
-            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, Horde_Nls::getCharset());
+            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             if (!empty($conf['hooks']['permsdenied'])) {
                 $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message);
             }
index a829963..f26629a 100644 (file)
@@ -233,10 +233,10 @@ class Mnemo_Driver_sql extends Mnemo_Driver {
                  ' VALUES (?, ?, ?, ?, ?, ?)';
         $values = array($this->_notepad,
                         $noteId,
-                        Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
-                        Horde_String::convertCharset($body, Horde_Nls::getCharset(), $this->_params['charset']),
-                        Horde_String::convertCharset($category, Horde_Nls::getCharset(), $this->_params['charset']),
-                        Horde_String::convertCharset($uid, Horde_Nls::getCharset(), $this->_params['charset']));
+                        Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($body, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($category, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($uid, $GLOBALS['registry']->getCharset(), $this->_params['charset']));
 
         /* Log the query at a DEBUG log level. */
         Horde::logMessage(sprintf('Mnemo_Driver_sql::add(): %s', $query), 'DEBUG');
@@ -278,13 +278,13 @@ class Mnemo_Driver_sql extends Mnemo_Driver {
 
         $query  = 'UPDATE ' . $this->_params['table'] .
                   ' SET memo_desc = ?, memo_body = ?';
-        $values = array(Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
-                        Horde_String::convertCharset($body, Horde_Nls::getCharset(), $this->_params['charset']));
+        $values = array(Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($body, $GLOBALS['registry']->getCharset(), $this->_params['charset']));
 
         // Don't change the category if it isn't provided.
         if (!is_null($category)) {
             $query .= ', memo_category = ?';
-            $values[] = Horde_String::convertCharset($category, Horde_Nls::getCharset(), $this->_params['charset']);
+            $values[] = Horde_String::convertCharset($category, $GLOBALS['registry']->getCharset(), $this->_params['charset']);
         }
         $query .= ' WHERE memo_owner = ? AND memo_id = ?';
         array_push($values, $this->_notepad, $noteId);
index bde5856..767f986 100644 (file)
@@ -73,7 +73,7 @@ case 'add_memo':
     /* Check permissions. */
     if ($GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') !== true &&
         $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') <= Mnemo::countMemos()) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), Mnemo::hasPermission('max_notes')), ENT_COMPAT, Horde_Nls::getCharset());
+        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), Mnemo::hasPermission('max_notes')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         if (!empty($conf['hooks']['permsdenied'])) {
             $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message);
         }
index 04b7057..6f73d6a 100644 (file)
@@ -63,8 +63,8 @@ if (!$note || !isset($note['memo_id'])) {
 /* Let's assume that the note content can be converted to ISO-8859-1 if this
  * is the current language's charset, as long as we don't have UTF-8 support
  * in File_PDF. */
-if (Horde_Nls::getCharset(true) == 'ISO-8859-1') {
-    $note = String::convertCharset($note, Horde_Nls::getCharset(), 'ISO-8859-1');
+if ($GLOBALS['registry']->getCharset(true) == 'ISO-8859-1') {
+    $note = String::convertCharset($note, $GLOBALS['registry']->getCharset(), 'ISO-8859-1');
 }
 
 /* Set up the PDF object. */
index 6aef95a..1bae2f8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 431d4aa..bac661f 100644 (file)
@@ -30,14 +30,14 @@ if (!$print_view) {
 <?php if (isset($created)): ?>
 <tr>
   <td align="right"><strong><?php echo _("Created") ?></strong>&nbsp;</td>
-  <td><?php echo strftime($prefs->getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, Horde_Nls::getCharset()) ?></td>
+  <td><?php echo strftime($prefs->getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></td>
 </tr>
 <?php endif; ?>
 
 <?php if (isset($modified)): ?>
 <tr>
   <td align="right"><strong><?php echo _("Last Modified") ?></strong>&nbsp;</td>
-  <td><?php echo strftime($prefs->getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, Horde_Nls::getCharset()) ?></td>
+  <td><?php echo strftime($prefs->getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></td>
 </tr>
 <?php endif; ?>
 
index 6ced13e..729e1f1 100644 (file)
@@ -41,7 +41,7 @@ if ($perms->hasAppPermission('max_tasks') !== true &&
     try {
         $message = Horde::callHook('perms_denied', array('nag:max_tasks'));
     } catch (Horde_Exception_HookNotSet $e) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, Horde_Nls::getCharset());
+        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
     }
     $notification->push($message, 'horde.warning', array('content.raw'));
     $templates[Horde_Data::IMPORT_FILE] = array(NAG_TEMPLATES . '/data/export.inc');
@@ -168,7 +168,7 @@ if (is_array($next_step)) {
             try {
                 $message = Horde::callHook('perms_denied', array('nag:max_tasks'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             break;
index e8aca63..72c3e19 100644 (file)
@@ -1060,7 +1060,7 @@ class Nag_Api extends Horde_Registry_Api
             $share = $GLOBALS['nag_shares']->getShare($tasklist);
 
             $iCal = new Horde_iCalendar($version);
-            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), Horde_Nls::getCharset(), 'utf-8'));
+            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), $GLOBALS['registry']->getCharset(), 'utf-8'));
 
             $tasks->reset();
             while ($task = $tasks->each()) {
@@ -1455,7 +1455,7 @@ class Nag_Api extends Horde_Registry_Api
             }
             foreach ($users as $alarm_user) {
                 $prefs = Horde_Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'nag', $alarm_user, null, null, false);
-                Horde_Nls::setLanguageEnvironment($prefs->getValue('language'));
+                $GLOBALS['registry']->setLanguageEnvironment($prefs->getValue('language'));
                 $alarm_list[] = $alarm->toAlarm($alarm_user, $prefs);
             }
         }
index 1475e35..38fb261 100644 (file)
@@ -48,7 +48,7 @@ class Nag_Application extends Horde_Registry_Application
     protected function _init()
     {
         // Set the timezone variable.
-        Horde_Nls::setTimeZone();
+        $GLOBALS['registry']->setTimeZone();
 
         // Create a share instance.
         $GLOBALS['nag_shares'] = $GLOBALS['injector']->getInstance('Horde_Share')->getScope();
index 7d6b1fd..6a1f230 100644 (file)
@@ -178,17 +178,17 @@ class Nag_Driver_Sql extends Nag_Driver {
                         $owner,
                         $assignee,
                         $taskId,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(), $this->_params['charset']),
-                        Horde_String::convertCharset($uid, Horde_Nls::getCharset(), $this->_params['charset']),
-                        Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($uid, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)$start,
                         (int)$due,
                         (int)$priority,
                         number_format($estimate, 2),
                         (int)$completed,
-                        Horde_String::convertCharset($category, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($category, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)$alarm,
-                        serialize(Horde_String::convertCharset($methods, Horde_Nls::getCharset(), $this->_params['charset'])),
+                        serialize(Horde_String::convertCharset($methods, $GLOBALS['registry']->getCharset(), $this->_params['charset'])),
                         (int)$private,
                         $parent);
 
@@ -254,17 +254,17 @@ class Nag_Driver_Sql extends Nag_Driver {
                          $this->_params['table']);
         $values = array($owner,
                         $assignee,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(), $this->_params['charset']),
-                        Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)$start,
                         (int)$due,
                         (int)$priority,
                         number_format($estimate, 2),
                         (int)$completed,
                         (int)$completed_date,
-                        Horde_String::convertCharset($category, Horde_Nls::getCharset(), $this->_params['charset']),
+                        Horde_String::convertCharset($category, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                         (int)$alarm,
-                        serialize(Horde_String::convertCharset($methods, Horde_Nls::getCharset(), $this->_params['charset'])),
+                        serialize(Horde_String::convertCharset($methods, $GLOBALS['registry']->getCharset(), $this->_params['charset'])),
                         $parent,
                         (int)$private,
                         $this->_tasklist,
index 4dc5a06..4d6b4e5 100644 (file)
@@ -46,7 +46,7 @@ class Nag_TaskForm extends Horde_Form {
             if ($vars->get('task_id') == $task->id) {
                 continue;
             }
-            $task_enums[htmlspecialchars($task->id)] = str_repeat('&nbsp;', $task->indent * 4) . htmlentities($task->name, ENT_COMPAT, Horde_Nls::getCharset());
+            $task_enums[htmlspecialchars($task->id)] = str_repeat('&nbsp;', $task->indent * 4) . htmlentities($task->name, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
         $users = array();
         $share = $GLOBALS['nag_shares']->getShare($tasklist);
index d2bf346..de89b72 100644 (file)
@@ -673,11 +673,11 @@ class Nag
                                    'mail/compose',
                                    array(array('to' => $email))))
                 . @htmlspecialchars($fullname . ' <' . $email . '>',
-                                    ENT_COMPAT, Horde_Nls::getCharset())
+                                    ENT_COMPAT, $GLOBALS['registry']->getCharset())
                 . '</a>';
-        } else {
-            return @htmlspecialchars($fullname, ENT_COMPAT, Horde_Nls::getCharset());
         }
+
+        return @htmlspecialchars($fullname, ENT_COMPAT, $GLOBALS['registry']->getCharset());
     }
 
     /**
@@ -909,7 +909,7 @@ class Nag
         $mail->addHeader('From', $from);
 
         foreach ($addresses as $lang => $twentyFour) {
-            Horde_Nls::setLanguageEnvironment($lang);
+            $GLOBALS['registry']->setLanguageEnvironment($lang);
 
             $view_link = Horde_Util::addParameter(Horde::applicationUrl('view.php', true),
                                             array('tasklist' => $task->tasklist,
@@ -1030,7 +1030,7 @@ class Nag
                 break;
             }
 
-            $mail->addHeader('Subject', $subject . ' ' . $task->name, Horde_Nls::getCharset());
+            $mail->addHeader('Subject', $subject . ' ' . $task->name, $GLOBALS['registry']->getCharset());
 
             foreach ($twentyFour as $tf => $dateFormat) {
                 foreach ($dateFormat as $df => $df_recipients) {
@@ -1042,7 +1042,7 @@ class Nag
                         $message .= "\n\n" . _("Task description:") . "\n\n" . $task->desc;
                     }
 
-                    $mail->setBody($message, Horde_Nls::getCharset());
+                    $mail->setBody($message, $GLOBALS['registry']->getCharset());
                     $mail->clearRecipients();
                     $mail->addRecipients($df_recipients);
 
index 33595e5..cc81591 100644 (file)
@@ -800,11 +800,11 @@ class Nag_Task {
         }
 
         if (!empty($this->name)) {
-            $vTodo->setAttribute('SUMMARY', $v1 ? $this->name : Horde_String::convertCharset($this->name, Horde_Nls::getCharset(), 'utf-8'));
+            $vTodo->setAttribute('SUMMARY', $v1 ? $this->name : Horde_String::convertCharset($this->name, $GLOBALS['registry']->getCharset(), 'utf-8'));
         }
 
         if (!empty($this->desc)) {
-            $vTodo->setAttribute('DESCRIPTION', $v1 ? $this->desc : Horde_String::convertCharset($this->desc, Horde_Nls::getCharset(), 'utf-8'));
+            $vTodo->setAttribute('DESCRIPTION', $v1 ? $this->desc : Horde_String::convertCharset($this->desc, $GLOBALS['registry']->getCharset(), 'utf-8'));
         }
 
         if (isset($this->priority)) {
@@ -850,7 +850,7 @@ class Nag_Task {
         }
 
         if (!empty($this->category)) {
-            $vTodo->setAttribute('CATEGORIES', $v1 ? $this->category : Horde_String::convertCharset($this->category, Horde_Nls::getCharset(), 'utf-8'));
+            $vTodo->setAttribute('CATEGORIES', $v1 ? $this->category : Horde_String::convertCharset($this->category, $GLOBALS['registry']->getCharset(), 'utf-8'));
         }
 
         /* Get the task's history. */
@@ -891,8 +891,8 @@ class Nag_Task {
         $message = new Horde_ActiveSync_Message_Task();
 
         /* Notes and Title */
-        $message->setBody(Horde_String::convertCharset($this->desc, Horde_Nls::getCharset(), 'utf-8'));
-        $message->setSubject(Horde_String::convertCharset($this->name, Horde_Nls::getCharset(), 'utf-8'));
+        $message->setBody(Horde_String::convertCharset($this->desc, $GLOBALS['registry']->getCharset(), 'utf-8'));
+        $message->setSubject(Horde_String::convertCharset($this->name, $GLOBALS['registry']->getCharset(), 'utf-8'));
 
         /* Completion */
         if ($this->completed) {
@@ -1043,8 +1043,8 @@ class Nag_Task {
     function fromASTask(Horde_ActiveSync_Message_Task $message)
     {
         /* Notes and Title */
-        $this->desc = Horde_String::convertCharset($message->getBody(), 'utf-8', Horde_Nls::getCharset());
-        $this->name = Horde_String::convertCharset($message->getSubject(), 'utf-8', Horde_Nls::getCharset());
+        $this->desc = Horde_String::convertCharset($message->getBody(), 'utf-8', $GLOBALS['registry']->getCharset());
+        $this->name = Horde_String::convertCharset($message->getSubject(), 'utf-8', $GLOBALS['registry']->getCharset());
 
         /* Completion */
         if ($this->completed = $message->getComplete()) {
index 51bf747..6566656 100644 (file)
@@ -73,7 +73,7 @@ case 'add_task':
         try {
             $message = Horde::callHook('perms_denied', array('nag:max_tasks'));
         } catch (Horde_Exception_HookNotSet $e) {
-            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, Horde_Nls::getCharset());
+            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
         $notification->push($message, 'horde.error', array('content.raw'));
         header('Location: ' . Horde::applicationUrl('list.php', true));
index 7b41c59..af76d1b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 8a4a8e6..ce449dc 100644 (file)
 <?php if (isset($created)): ?>
  <tr>
   <td class="rightAlign"><strong><?php echo _("Created") ?></strong></td>
-  <td><?php echo strftime($prefs->getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, Horde_Nls::getCharset()) ?></td>
+  <td><?php echo strftime($prefs->getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></td>
  </tr>
 <?php endif; ?>
 
 <?php if (isset($modified)): ?>
  <tr>
   <td class="rightAlign"><strong><?php echo _("Last Modified") ?></strong></td>
-  <td><?php echo strftime($prefs->getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, Horde_Nls::getCharset()) ?></td>
+  <td><?php echo strftime($prefs->getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></td>
  </tr>
 <?php endif; ?>
 
index 5925fb2..b16c8f2 100755 (executable)
@@ -48,7 +48,7 @@ class Horde_Block_News_category extends Horde_Block {
                  'ORDER BY n.publish DESC ' .
                  'LIMIT 0, ' . $this->_params['limit'];
 
-        $params = array(News::CONFIRMED, $this->_params['category'], $this->_params['category'], Horde_Nls::select());
+        $params = array(News::CONFIRMED, $this->_params['category'], $this->_params['category'], $GLOBALS['registry']->preferredLang());
         $rows = $GLOBALS['news']->db->getAll($query, $params, DB_FETCHMODE_ASSOC);
         if ($rows instanceof PEAR_Error) {
             return $rows->getDebugInfo();
index e731e5f..32cec81 100755 (executable)
@@ -33,7 +33,7 @@ class Horde_Block_News_last extends Horde_Block {
     {
         require_once dirname(__FILE__) . '/../base.php';
 
-        $params = array(News::CONFIRMED, Horde_Nls::select());
+        $params = array(News::CONFIRMED, $GLOBALS['registry']->preferredLang());
         $query = 'SELECT n.id, n.publish, n.comments, n.picture, n.category1, nl.title, nl.abbreviation ' .
                  'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS nl WHERE ' .
                  'n.status = ? AND n.publish <= NOW() ' .
@@ -58,4 +58,4 @@ class Horde_Block_News_last extends Horde_Block {
 
         return $view->render('/block/news.php');
     }
-}
\ No newline at end of file
+}
index 8f4f648..4521f71 100755 (executable)
@@ -33,7 +33,7 @@ class Horde_Block_News_last_blogs extends Horde_Block {
                  'ORDER BY n.publish DESC ' .
                  'LIMIT 0, ' . $this->_params['limit'];
 
-        $params = array(News::CONFIRMED, 0, Horde_Nls::select());
+        $params = array(News::CONFIRMED, 0, $GLOBALS['registry']->preferredLang());
         $rows = $GLOBALS['news']->db->getAll($query, $params, DB_FETCHMODE_ASSOC);
         if ($rows instanceof PEAR_Error) {
             return $rows->getDebugInfo();
index cc5fca9..89779bc 100755 (executable)
@@ -39,7 +39,7 @@ class Horde_Block_News_most_commented extends Horde_Block {
                  'LIMIT 0, ' . $this->_params['limit'];
 
         $younger = $_SERVER['REQUEST_TIME'] - $this->_params['days'] * 86400;
-        $params = array(News::CONFIRMED, date('Y-m-d', $younger), Horde_Nls::select());
+        $params = array(News::CONFIRMED, date('Y-m-d', $younger), $GLOBALS['registry']->preferredLang());
         $rows = $GLOBALS['news']->db->getAll($query, $params, DB_FETCHMODE_ASSOC);
         if ($rows instanceof PEAR_Error) {
             return $rows->getDebugInfo();
@@ -50,4 +50,4 @@ class Horde_Block_News_most_commented extends Horde_Block {
 
         return $view->render('/block/titles.php');
     }
-}
\ No newline at end of file
+}
index 2f2201c..163d9df 100755 (executable)
@@ -39,7 +39,7 @@ class Horde_Block_News_most_read extends Horde_Block {
                  'LIMIT 0, ' . $this->_params['limit'];
 
         $younger = $_SERVER['REQUEST_TIME'] - $this->_params['days'] * 86400;
-        $params = array(News::CONFIRMED, date('Y-m-d', $younger), Horde_Nls::select());
+        $params = array(News::CONFIRMED, date('Y-m-d', $younger), $GLOBALS['registry']->preferredLang());
         $rows = $GLOBALS['news']->db->getAll($query, $params, DB_FETCHMODE_ASSOC);
         if ($rows instanceof PEAR_Error) {
             return $rows->getDebugInfo();
@@ -50,4 +50,4 @@ class Horde_Block_News_most_read extends Horde_Block {
 
         return $view->render('/block/titles.php');
     }
-}
\ No newline at end of file
+}
index 4cefb37..c694df5 100644 (file)
@@ -449,7 +449,7 @@ class News_Driver_sql extends News_Driver {
 
         $sql = 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS l '
             . ' WHERE n.id = l.id AND l.lang = ?';
-        $params = array('_lang' => Horde_Nls::select());
+        $params = array('_lang' => $GLOBALS['registry']->preferredLang());
 
         if ($perms == Horde_Perms::READ) {
             $sql .= ' AND n.publish <= ? ';
@@ -588,7 +588,7 @@ class News_Driver_sql extends News_Driver {
                . $this->prefix . ' AS n WHERE l.lang = ? AND n.id = l.id AND n.status = ? ORDER BY n.publish DESC LIMIT 0, '
                . ($minimize ? '100' : '500');
 
-        $result = $this->db->query($sql, array(Horde_Nls::select(), News::CONFIRMED));
+        $result = $this->db->query($sql, array($GLOBALS['registry']->preferredLang(), News::CONFIRMED));
         if ($result instanceof PEAR_Error) {
             return $result;
         }
index a4a88fc..10e702a 100644 (file)
@@ -32,7 +32,7 @@ class News {
         static $lang;
 
         if ($lang === null) {
-            $lang = Horde_Nls::Select();
+            $lang = $GLOBALS['registry']->preferredLang();
             if (!empty($conf['attributes']['languages']) &&
                 !in_array($lang, $conf['attributes']['languages'])) {
                 $lang = $conf['attributes']['languages'][0];
index ce1f220..20ba0f5 100644 (file)
@@ -21,7 +21,7 @@ class News_View extends Horde_View {
     {
         /* Set parents defualt data */
         parent::__construct(array('templatePath' => NEWS_TEMPLATES,
-                                  'encoding' => Horde_Nls::select()));
+                                  'encoding' => $GLOBALS['registry']->preferredLang()));
     }
 
     /**
index 1d93e91..7202734 100644 (file)
@@ -53,7 +53,7 @@ $body = sprintf(_("%s would you like to invite you to read the news\n Title: %s\
                 $row['publish'],
                 News::getUrlFor('news', $id, true, -1));
 
-$mail = new Horde_Mime_Mail(array('subject' => $row['title'], 'body' => $body, 'to' => $to, 'from' => $from, 'charset' => Horde_Nls::getCharset()));
+$mail = new Horde_Mime_Mail(array('subject' => $row['title'], 'body' => $body, 'to' => $to, 'from' => $from, 'charset' => $GLOBALS['registry']->getCharset()));
 try {
     $mail->send($injector->getInstance('Horde_Mail'));
     $notification->push(sprintf(_("News succesfully send to %s"), $to), 'horde.success');
index 6a20075..bc4a252 100644 (file)
@@ -55,7 +55,7 @@ $pdf->newLine(4);
 
 $pdf->write(12, _("On") . ': ' . News::dateFormat($row['publish']) . "\n");
 $pdf->write(12, _("Link") . ': ' . News::getUrlFor('news', $id, true) . "\n\n", News::getUrlFor('news', $id, true));
-$pdf->multiCell(0, 12, Horde_String::convertCharset(strip_tags($row['content']), Horde_Nls::getCharset(), 'UTF-8'));
+$pdf->multiCell(0, 12, Horde_String::convertCharset(strip_tags($row['content']), $GLOBALS['registry']->getCharset(), 'UTF-8'));
 
 $browser->downloadHeaders($id . '.pdf', 'application/pdf');
 echo $pdf->getOutput();
index 21a96cb..9f7af6e 100644 (file)
@@ -16,15 +16,14 @@ require_once dirname(__FILE__) . '/../lib/base.php';
 $cache_key = 'news_rss_comments';
 $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
 if (!$rss) {
-
     $list = News::getLastComments(50);
     $title = _("Last comments");
 
-    $rss = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
+    $rss = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
 <rss version="2.0">
 <channel>
     <title>' . htmlspecialchars($title) . '</title>
-    <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
+    <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
     <lastBuildDate>' . date('r') . '</lastBuildDate>
     <description>' . htmlspecialchars($title) . '</description>
     <link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
@@ -48,5 +47,5 @@ if (!$rss) {
     $cache->set($cache_key, $rss);
 }
 
-header('Content-type: text/xml; charset=' . Horde_Nls::getCharset());
+header('Content-type: text/xml; charset=' . $GLOBALS['registry']->getCharset());
 echo $rss;
index a083e58..2ae262d 100644 (file)
@@ -22,11 +22,11 @@ if (!$rss) {
     $title = $registry->get('name', 'horde');
 
     $read_url = Horde::applicationUrl('read.php', true, -1);
-    $rss = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
+    $rss = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($title) . '</title>
-        <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
+        <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
         <lastBuildDate>' . date('r') . '</lastBuildDate>
         <description>' . htmlspecialchars($title) . '</description>
         <link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
index 803c7d7..3dba990 100755 (executable)
@@ -24,7 +24,7 @@ if (empty($rss)) {
              'nl.title, nl.abbreviation ' .
              'FROM ' . $news->prefix . ' AS n, ' . $news->prefix . '_body AS nl ' .
              'WHERE n.status="' . News::CONFIRMED . '" AND n.publish<=NOW() ' .
-             'AND nl.lang="' . Horde_Nls::select() . '" AND n.id=nl.id  ORDER BY publish DESC';
+             'AND nl.lang="' . $registry->preferredLang() . '" AND n.id=nl.id  ORDER BY publish DESC';
     $rssbody = '';
     $query = $news->db->modifyLimitQuery($query, 0, 10);
     $list = $news->db->getAssoc($query, true, array(), DB_FETCHMODE_ASSOC);
@@ -53,14 +53,14 @@ if (empty($rss)) {
     }
 
     // Wee need the last published news time
-    $rssheader = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
+    $rssheader = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
 <rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     xmlns:dc="http://purl.org/dc/elements/1.1/" >
 <channel>
     <title>' . htmlspecialchars($title) . '</title>
-    <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
+    <language>' . str_replace('_', '-', strtolower($registry->preferredLang())) . '</language>
     <lastBuildDate>' . date('r', $lastnewstime) . '</lastBuildDate>
     <description>' . htmlspecialchars($title) . '</description>
     <link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
index 193c0ac..079b515 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 72d71cf..4a75c19 100644 (file)
@@ -18,8 +18,8 @@ $cache = &$GLOBALS['cache'];
 //error_reporting(E_NONE);
 //ini_set("display_errors", 0);
 
-#setlocale(LC_ALL, Horde_Nls::select());
-#setlocale(LC_ALL, 'en_US');
+//setlocale(LC_ALL, $registry->preferredLang());
+//setlocale(LC_ALL, 'en_US');
 
 $graphtype = Horde_Util::getFormData('graph');
 $graphinfo = Operator::getGraphInfo($graphtype);
index a15e4f3..a914719 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index e6b62df..563c6c4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index fda1826..dcd0d51 100644 (file)
@@ -1,6 +1,6 @@
 <?php
      if (isset($language)) {
-         header('Content-type: text/html; charset=' . Horde_NLS::getCharset());
+         header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
          header('Vary: Accept-Language');
      }
 ?>
index 12fff22..d5ef834 100644 (file)
 var ajax_url = '<?php echo Horde::getServiceLink('ajax', 'shout') ?>';
 var curmenu = null;
 var menuInfo = $H();
-var menuActions = $H(<?php echo Horde_Serialize::serialize(Shout::getMenuActions(), Horde_Serialize::JSON, Horde_Nls::getCharset()); ?>);
-var destinations = $H(<?php echo Horde_Serialize::serialize($destinations, Horde_Serialize::JSON, Horde_Nls::getCharset()); ?>);
-var conferences = $H(<?php echo Horde_Serialize::serialize($conferences, Horde_Serialize::JSON, Horde_Nls::getCharset()); ?>);
-var recordings = $H(<?php echo Horde_Serialize::serialize($recordings, Horde_Serialize::JSON, Horde_Nls::getCharset()); ?>);
+var menuActions = $H(<?php echo Horde_Serialize::serialize(Shout::getMenuActions(), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()); ?>);
+var destinations = $H(<?php echo Horde_Serialize::serialize($destinations, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()); ?>);
+var conferences = $H(<?php echo Horde_Serialize::serialize($conferences, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()); ?>);
+var recordings = $H(<?php echo Horde_Serialize::serialize($recordings, Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()); ?>);
 
 function empty(p)
 {
index e6b62df..563c6c4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 3103145..62794cd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 9958b12..39fddd7 100644 (file)
@@ -20,7 +20,7 @@ case 'add_bookmark':
     /* Check permissions. */
     if (Trean::hasPermission('max_bookmarks') !== true &&
         Trean::hasPermission('max_bookmarks') <= $trean_shares->countBookmarks()) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, Horde_Nls::getCharset());
+        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         if (!empty($conf['hooks']['permsdenied'])) {
             $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message);
         }
@@ -83,7 +83,7 @@ case 'add_folder':
     /* Check permissions. */
     if (Trean::hasPermission('max_folders') !== true &&
         Trean::hasPermission('max_folders') <= Trean::countFolders()) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, Horde_Nls::getCharset());
+        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         if (!empty($conf['hooks']['permsdenied'])) {
             $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message);
         }
index f6f46c1..e544b0b 100644 (file)
@@ -53,7 +53,7 @@ Horde_Registry::appInit('trean');
 $folders_exceeded = Trean::hasPermission('max_folders') !== true &&
 Trean::hasPermission('max_folders') <= Trean::countFolders();
 if ($folders_exceeded) {
-    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, Horde_Nls::getCharset());
+    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
     if (!empty($conf['hooks']['permsdenied'])) {
         $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message);
     }
@@ -62,7 +62,7 @@ if ($folders_exceeded) {
 $bookmarks_exceeded = Trean::hasPermission('max_bookmarks') !== true &&
 Trean::hasPermission('max_bookmarks') <= $trean_shares->countBookmarks();
 if ($bookmarks_exceeded) {
-    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, Horde_Nls::getCharset());
+    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
     if (!empty($conf['hooks']['permsdenied'])) {
         $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message);
     }
@@ -104,7 +104,7 @@ case 'import':
                 continue;
             }
             if ($max_folders !== true && $num_folders >= $max_folders) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
                 if (!empty($conf['hooks']['permsdenied'])) {
                     $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message);
                 }
@@ -129,7 +129,7 @@ case 'import':
                              $line, $temp)) {
             /* A bookmark. */
             if ($max_bookmarks !== true && $num_bookmarks >= $max_bookmarks) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, $GLOBALS['registry']->getCharset());
                 if (!empty($conf['hooks']['permsdenied'])) {
                     $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message);
                 }
index fccf5de..53b52ad 100644 (file)
@@ -48,7 +48,7 @@ class Trean_Application extends Horde_Registry_Application
     protected function _init()
     {
         // Set the timezone variable.
-        Horde_Nls::setTimeZone();
+        $GLOBALS['registry']->setTimeZone();
 
         // Create db and share instances.
         $GLOBALS['trean_db'] = Trean::getDb();
index 0dfb84e..f7b178f 100644 (file)
@@ -1015,9 +1015,9 @@ class Trean_Bookmark {
                 return $update;
             }
             $result = $update->execute(array($this->folder,
-                                             Horde_String::convertCharset($this->url, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
-                                             Horde_String::convertCharset($this->title, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
-                                             Horde_String::convertCharset($this->description, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                             Horde_String::convertCharset($this->url, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                             Horde_String::convertCharset($this->title, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                             Horde_String::convertCharset($this->description, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
                                              $this->clicks,
                                              $this->rating,
                                              $this->id));
@@ -1051,9 +1051,9 @@ class Trean_Bookmark {
 
         $result = $insert->execute(array($bookmark_id,
                                          $this->folder,
-                                         Horde_String::convertCharset($this->url, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
-                                         Horde_String::convertCharset($this->title, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
-                                         Horde_String::convertCharset($this->description, Horde_Nls::getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                         Horde_String::convertCharset($this->url, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                         Horde_String::convertCharset($this->title, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
+                                         Horde_String::convertCharset($this->description, $GLOBALS['registry']->getCharset(), $GLOBALS['conf']['sql']['charset']),
                                          $this->clicks,
                                          $this->rating,
         ));
index d84cbcb..f710968 100644 (file)
@@ -59,12 +59,12 @@ $cache = $GLOBALS['injector']->getInstance('Horde_Cache');
 $cache_key = 'trean_rss_' . Horde_Auth::getAuth() . '_' . ($folderId === null ? 'all' : $folderId);
 $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
 if (!$rss) {
-    $rss = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
+    $rss = '<?xml version="1.0" encoding="' . $GLOBALS['registry']->getCharset() . '" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($folderId == null ? $registry->get('name') : $folder->get('name')) . '</title>
-        <language>' . Horde_Nls::select() . '</language>
-        <charset>' . Horde_Nls::getCharset() . '</charset>
+        <language>' . $registry->preferredLang() . '</language>
+        <charset>' . $GLOBALS['registry']->getCharset() . '</charset>
         <lastBuildDate>' . date('Y-m-d H:i:s') . '</lastBuildDate>
         <image>
             <url>http://' . $_SERVER['SERVER_NAME'] . $registry->get('webroot') . '/themes/graphics/favicon.ico</url>
index c8b82d6..435aaf9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 3e11963..4cbbc5d 100644 (file)
@@ -45,7 +45,7 @@ if ($source) {
             try {
                 $message = Horde::callHook('perms_denied', array('turba:max_contacts'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']), ENT_COMPAT, Horde_Nls::getCharset());
+                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']), ENT_COMPAT, $GLOBALS['registry']->getCharset());
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             $url = $url
index bad2156..cf384a4 100644 (file)
@@ -591,7 +591,7 @@ $cfgSources['localsql'] = array(
 //     'type' => 'prefs',
 //     'params' => array(
 //         'name' => 'prefs',
-//         'charset' => Horde_Nls::getCharset()
+//         'charset' => $GLOBALS['registry']->getCharset()
 //     ),
 //     'map' => array(
 //         '__key' => 'id',
index 12f9b86..b4bed95 100644 (file)
@@ -281,7 +281,7 @@ case 'export':
                         } elseif ($attributes[$field]['type'] == 'datetime') {
                             $row[$field] = strftime('%Y-%m-%d %R', $attribute);
                         } else {
-                        $row[$field] = Horde_String::convertCharset($attribute, Horde_Nls::getCharset(), $params['charset']);
+                        $row[$field] = Horde_String::convertCharset($attribute, $GLOBALS['registry']->getCharset(), $params['charset']);
                         }
                     }
                 }
@@ -351,7 +351,7 @@ case Horde_Data::IMPORT_FILE:
         try {
             $message = Horde::callHook('perms_denied', array('turba:max_contacts'));
         } catch (Horde_Exception_HookNotSet $e) {
-            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $driver->title), ENT_COMPAT, Horde_Nls::getCharset());
+            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $driver->title), ENT_COMPAT, $GLOBALS['registry']->getCharset());
         }
         $notification->push($message, 'horde.error', array('content.raw'));
         $error = true;
@@ -540,7 +540,7 @@ if ($next_step == Horde_Data::IMPORT_FILE) {
             $charsets[$charset] = $charset;
         }
     }
-    $my_charset = Horde_Nls::getCharset(true);
+    $my_charset = $GLOBALS['registry']->getCharset(true);
 }
 
 foreach ($templates[$next_step] as $template) {
index f737d1c..d0823d3 100644 (file)
@@ -988,7 +988,7 @@ class Turba_Driver
         $hash = $object->getAttributes();
         $vcard = new Horde_iCalendar_vcard($version);
         $formattedname = false;
-        $charset = $version == '2.1' ? array('CHARSET' => Horde_Nls::getCharset()) : array();
+        $charset = $version == '2.1' ? array('CHARSET' => $GLOBALS['registry']->getCharset()) : array();
 
         foreach ($hash as $key => $val) {
             if ($skipEmpty && !strlen($val)) {
@@ -996,7 +996,7 @@ class Turba_Driver
             }
 
             if ($version != '2.1') {
-                $val = Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'utf-8');
+                $val = Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), 'utf-8');
             }
 
             switch ($key) {
@@ -1656,8 +1656,8 @@ class Turba_Driver
         );
         $val = implode(';', $a);
         if ($version != '2.1') {
-            $val = Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'utf-8');
-            $a = Horde_String::convertCharset($a, Horde_Nls::getCharset(), 'utf-8');
+            $val = Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), 'utf-8');
+            $a = Horde_String::convertCharset($a, $GLOBALS['registry']->getCharset(), 'utf-8');
         }
         if (!$fields || isset($fields['N'])) {
             $vcard->setAttribute('N', $val, Horde_Mime::is8bit($val) ? $charset : array(), false, $a);
@@ -1687,8 +1687,8 @@ class Turba_Driver
         if (count($org) && (!$fields || isset($fields['ORG']))) {
             $val = implode(';', $org);
             if ($version != '2.1') {
-                $val = Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'utf-8');
-                $org = Horde_String::convertCharset($org, Horde_Nls::getCharset(), 'utf-8');
+                $val = Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), 'utf-8');
+                $org = Horde_String::convertCharset($org, $GLOBALS['registry']->getCharset(), 'utf-8');
             }
             $vcard->setAttribute('ORG', $val, Horde_Mime::is8bit($val) ? $charset : array(), false, $org);
         }
@@ -1740,12 +1740,12 @@ class Turba_Driver
             if ($version == '2.1') {
                 $params = array();
                 if (Horde_Mime::is8bit($val)) {
-                    $params['CHARSET'] = Horde_Nls::getCharset();
+                    $params['CHARSET'] = $GLOBALS['registry']->getCharset();
                 }
             } else {
                 $params = array('TYPE' => '');
-                $val = Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'utf-8');
-                $a = Horde_String::convertCharset($a, Horde_Nls::getCharset(), 'utf-8');
+                $val = Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), 'utf-8');
+                $a = Horde_String::convertCharset($a, $GLOBALS['registry']->getCharset(), 'utf-8');
             }
             $vcard->setAttribute('ADR', $val, $params, true, $a);
         }
@@ -1795,12 +1795,12 @@ class Turba_Driver
             if ($version == '2.1') {
                 $params = array('HOME' => null);
                 if (Horde_Mime::is8bit($val)) {
-                    $params['CHARSET'] = Horde_Nls::getCharset();
+                    $params['CHARSET'] = $GLOBALS['registry']->getCharset();
                 }
             } else {
                 $params = array('TYPE' => 'HOME');
-                $val = Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'utf-8');
-                $a = Horde_String::convertCharset($a, Horde_Nls::getCharset(), 'utf-8');
+                $val = Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), 'utf-8');
+                $a = Horde_String::convertCharset($a, $GLOBALS['registry']->getCharset(), 'utf-8');
             }
             $vcard->setAttribute('ADR', $val, $params, true, $a);
         }
@@ -1850,12 +1850,12 @@ class Turba_Driver
             if ($version == '2.1') {
                 $params = array('WORK' => null);
                 if (Horde_Mime::is8bit($val)) {
-                    $params['CHARSET'] = Horde_Nls::getCharset();
+                    $params['CHARSET'] = $GLOBALS['registry']->getCharset();
                 }
             } else {
                 $params = array('TYPE' => 'WORK');
-                $val = Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'utf-8');
-                $a = Horde_String::convertCharset($a, Horde_Nls::getCharset(), 'utf-8');
+                $val = Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), 'utf-8');
+                $a = Horde_String::convertCharset($a, $GLOBALS['registry']->getCharset(), 'utf-8');
             }
             $vcard->setAttribute('ADR', $val, $params, true, $a);
         }
@@ -2318,7 +2318,7 @@ class Turba_Driver
     public function toASContact(Turba_Object $object)
     {
         $message = new Horde_ActiveSync_Message_Contact(array('logger' => $GLOBALS['injector']->getInstance('Horde_Log_Logger')));
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
         $hash = $object->getAttributes();
         foreach ($hash as $field => $value) {
            switch ($field) {
@@ -2456,7 +2456,7 @@ class Turba_Driver
     public function fromASContact($message)
     {
         $hash = array();
-        $charset = Horde_Nls::getCharset();
+        $charset = $GLOBALS['registry']->getCharset();
         $formattedname = false;
 
         $textMap = array(
index 43493d1..02c790c 100644 (file)
@@ -233,7 +233,7 @@ class Turba_Driver_Ldap extends Turba_Driver
         if (is_array($ids)) {
             $results = array();
             foreach ($ids as $d) {
-                $res = @ldap_read($this->_ds, Horde_String::convertCharset($d, Horde_Nls::getCharset(), $this->_params['charset']), $filter, $attr);
+                $res = @ldap_read($this->_ds, Horde_String::convertCharset($d, $GLOBALS['registry']->getCharset(), $this->_params['charset']), $filter, $attr);
                 if ($res) {
                     if (!is_a($result = $this->_getResults($fields, $res), 'PEAR_Error')) {
                         $results = array_merge($results, $result);
@@ -247,7 +247,7 @@ class Turba_Driver_Ldap extends Turba_Driver
             return $results;
         }
 
-        $res = @ldap_read($this->_ds, Horde_String::convertCharset($ids, Horde_Nls::getCharset(), $this->_params['charset']), $filter, $attr);
+        $res = @ldap_read($this->_ds, Horde_String::convertCharset($ids, $GLOBALS['registry']->getCharset(), $this->_params['charset']), $filter, $attr);
         if (!$res) {
             return PEAR::raiseError(sprintf(_("Read failed: (%s) %s"), ldap_errno($this->_ds), ldap_error($this->_ds)));
         }
@@ -303,8 +303,8 @@ class Turba_Driver_Ldap extends Turba_Driver
 
         $this->_encodeAttributes($attributes);
 
-        if (!@ldap_add($this->_ds, Horde_String::convertCharset($dn, Horde_Nls::getCharset(), $this->_params['charset']), $attributes)) {
-            return PEAR::raiseError('Failed to add an object: [' . ldap_errno($this->_ds) . '] "' . ldap_error($this->_ds) . '" DN: ' . $dn . ' (attributes: [' . serialize($attributes) . ']).' . "Charset:" . Horde_Nls::getCharset());
+        if (!@ldap_add($this->_ds, Horde_String::convertCharset($dn, $GLOBALS['registry']->getCharset(), $this->_params['charset']), $attributes)) {
+            return PEAR::raiseError('Failed to add an object: [' . ldap_errno($this->_ds) . '] "' . ldap_error($this->_ds) . '" DN: ' . $dn . ' (attributes: [' . serialize($attributes) . ']).' . "Charset:" . $GLOBALS['registry']->getCharset());
         } else {
             return true;
         }
@@ -324,7 +324,7 @@ class Turba_Driver_Ldap extends Turba_Driver
             return PEAR::raiseError(_("Invalid key specified."));
         }
 
-        if (!@ldap_delete($this->_ds, Horde_String::convertCharset($object_id, Horde_Nls::getCharset(), $this->_params['charset']))) {
+        if (!@ldap_delete($this->_ds, Horde_String::convertCharset($object_id, $GLOBALS['registry']->getCharset(), $this->_params['charset']))) {
             return PEAR::raiseError(sprintf(_("Delete failed: (%s) %s"), ldap_errno($this->_ds), ldap_error($this->_ds)));
         } else {
             return true;
@@ -345,7 +345,7 @@ class Turba_Driver_Ldap extends Turba_Driver
          * values. These are needed so that we can delete any
          * attributes that have been removed by using ldap_mod_del. */
         $filter = $this->_buildObjectclassFilter();
-        $oldres = @ldap_read($this->_ds, Horde_String::convertCharset($object_id, Horde_Nls::getCharset(), $this->_params['charset']), $filter, array_merge(array_keys($attributes), array('objectclass')));
+        $oldres = @ldap_read($this->_ds, Horde_String::convertCharset($object_id, $GLOBALS['registry']->getCharset(), $this->_params['charset']), $filter, array_merge(array_keys($attributes), array('objectclass')));
         $info = ldap_get_attributes($this->_ds, ldap_first_entry($this->_ds, $oldres));
 
         if ($this->_params['version'] == 3 &&
@@ -357,8 +357,8 @@ class Turba_Driver_Ldap extends Turba_Driver
                 return PEAR::raiseError(_("Missing DN in LDAP source configuration."));
             }
 
-            if (ldap_rename($this->_ds, Horde_String::convertCharset($object_id, Horde_Nls::getCharset(), $this->_params['charset']),
-                            Horde_String::convertCharset($newrdn, Horde_Nls::getCharset(), $this->_params['charset']), $this->_params['root'], true)) {
+            if (ldap_rename($this->_ds, Horde_String::convertCharset($object_id, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
+                            Horde_String::convertCharset($newrdn, $GLOBALS['registry']->getCharset(), $this->_params['charset']), $this->_params['root'], true)) {
                 $object_id = $newrdn . ',' . $this->_params['root'];
             } else {
                 return PEAR::raiseError(sprintf(_("Failed to change name: (%s) %s; Old DN = %s, New DN = %s, Root = %s"),
@@ -382,7 +382,7 @@ class Turba_Driver_Ldap extends Turba_Driver
                 $attributes[$key] == '') {
 
                 $oldval[$key] = $var[0];
-                if (!@ldap_mod_del($this->_ds, Horde_String::convertCharset($object_id, Horde_Nls::getCharset(), $this->_params['charset']), $oldval)) {
+                if (!@ldap_mod_del($this->_ds, Horde_String::convertCharset($object_id, $GLOBALS['registry']->getCharset(), $this->_params['charset']), $oldval)) {
                     return PEAR::raiseError(sprintf(_("Modify failed: (%s) %s"), ldap_errno($this->_ds), ldap_error($this->_ds)));
                 }
                 unset($attributes[$key]);
@@ -398,7 +398,7 @@ class Turba_Driver_Ldap extends Turba_Driver
         unset($attributes['objectclass']['count']);
         $attributes['objectclass'] = array_values($attributes['objectclass']);
 
-        if (!@ldap_modify($this->_ds, Horde_String::convertCharset($object_id, Horde_Nls::getCharset(), $this->_params['charset']), $attributes)) {
+        if (!@ldap_modify($this->_ds, Horde_String::convertCharset($object_id, $GLOBALS['registry']->getCharset(), $this->_params['charset']), $attributes)) {
             return PEAR::raiseError(sprintf(_("Modify failed: (%s) %s"), ldap_errno($this->_ds), ldap_error($this->_ds)));
         } else {
             return $object_id;
@@ -460,7 +460,7 @@ class Turba_Driver_Ldap extends Turba_Driver
                 $clause .= '(&' . $this->_buildSearchQuery($vals) . ')';
             } else {
                 if (isset($vals['field'])) {
-                    $rhs = Horde_String::convertCharset($vals['test'], Horde_Nls::getCharset(), $this->_params['charset']);
+                    $rhs = Horde_String::convertCharset($vals['test'], $GLOBALS['registry']->getCharset(), $this->_params['charset']);
                     $clause .= Horde_Ldap::buildClause($vals['field'], $vals['op'], $rhs, array('begin' => !empty($vals['begin'])));
                 } else {
                     foreach ($vals as $test) {
@@ -469,7 +469,7 @@ class Turba_Driver_Ldap extends Turba_Driver
                         } elseif (!empty($test['AND'])) {
                             $clause .= '(&' . $this->_buildSearchQuery($test) . ')';
                         } else {
-                            $rhs = Horde_String::convertCharset($test['test'], Horde_Nls::getCharset(), $this->_params['charset']);
+                            $rhs = Horde_String::convertCharset($test['test'], $GLOBALS['registry']->getCharset(), $this->_params['charset']);
                             $clause .= Horde_Ldap::buildClause($test['field'], $test['op'], $rhs, array('begin' => !empty($vals['begin'])));
                         }
                     }
@@ -586,7 +586,7 @@ class Turba_Driver_Ldap extends Turba_Driver
             }
 
             if (!is_array($val)) {
-                $attributes[$key] = Horde_String::convertCharset($val, Horde_Nls::getCharset(), $this->_params['charset']);
+                $attributes[$key] = Horde_String::convertCharset($val, $GLOBALS['registry']->getCharset(), $this->_params['charset']);
             }
         }
     }
index 94e5c51..321797d 100644 (file)
@@ -680,7 +680,7 @@ class Turba_Driver_Sql extends Turba_Driver
      */
     function _convertToDriver($value)
     {
-        return Horde_String::convertCharset($value, Horde_Nls::getCharset(), $this->_params['charset']);
+        return Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $this->_params['charset']);
     }
 
     /**
index 268eb10..8851f10 100644 (file)
@@ -267,7 +267,7 @@ class Turba_Object {
                         . ' '
                         . date($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:i a', $entry['ts'])
                         . ' '
-                        . @htmlspecialchars($by, ENT_COMPAT, Horde_Nls::getCharset());
+                        . @htmlspecialchars($by, ENT_COMPAT, $GLOBALS['registry']->getCharset());
                 }
             }
         } catch (Exception $e) {
index 50f4140..a82af2c 100644 (file)
@@ -148,7 +148,7 @@ class Turba_View_Browse {
                     try {
                         $message = Horde::callHook('perms_denied', array('turba:max_contacts'));
                     } catch (Horde_Exception_HookNotSet $e) {
-                        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$targetSource]['title']), ENT_COMPAT, Horde_Nls::getCharset());
+                        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$targetSource]['title']), ENT_COMPAT, $GLOBALS['registry']->getCharset());
                     }
                     $notification->push($message, 'horde.error', array('content.raw'));
                     break;
@@ -288,7 +288,7 @@ class Turba_View_Browse {
                         try {
                             $message = Horde::callHook('perms_denied', array('turba:max_contacts'));
                         } catch (Horde_Exception $e) {
-                            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']), ENT_COMPAT, Horde_Nls::getCharset());
+                            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']), ENT_COMPAT, $GLOBALS['registry']->getCharset());
                         }
                         $notification->push($message, 'horde.error', array('content.raw'));
                         break;
index b331ce0..269649b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 global $language;
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 285592e..0a5a469 100644 (file)
@@ -43,4 +43,4 @@ if (!$filename) {
     $filename = _("contact");
 }
 
-$injector->getInstance('Horde_Data')->getData('Vcard')->exportFile($filename . '.vcf', array($driver->tovCard($object, '2.1', null, true)), Horde_Nls::getCharset());
+$injector->getInstance('Horde_Data')->getData('Vcard')->exportFile($filename . '.vcf', array($driver->tovCard($object, '2.1', null, true)), $GLOBALS['registry']->getCharset());
index afbc18f..af209be 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index e21b581..f144e6b 100644 (file)
@@ -391,14 +391,14 @@ class Whups_Driver {
         } elseif (!empty($conf['mail']['from_addr'])) {
             $mail->addHeader('From', $conf['mail']['from_addr']);
         } else {
-            $mail->addHeader('From', Whups::formatUser($from), Horde_Nls::getCharset());
+            $mail->addHeader('From', Whups::formatUser($from), $GLOBALS['registry']->getCharset());
         }
 
         $subject = (is_null($ticket_id)
                     ? ''
                     : '[' . $registry->get('name') . ' #' . $ticket_id . '] ')
             . $subject;
-        $mail->addHeader('Subject', $subject, Horde_Nls::getCharset());
+        $mail->addHeader('Subject', $subject, $GLOBALS['registry']->getCharset());
 
         /* Get our array of comments, sorted in the appropriate order. */
         if (!is_null($ticket_id)) {
@@ -474,7 +474,7 @@ class Whups_Driver {
                 array('@@comment@@', '@@full_name@@'),
                 array("\n\n" . $formattedComment, $full_name),
                 $message);
-            $mail->setBody($body, Horde_Nls::getCharset());
+            $mail->setBody($body, $GLOBALS['registry']->getCharset());
 
             $mail->addHeader('Message-ID', Horde_Mime::generateMessageId());
             if ($ticket_id) {
@@ -488,7 +488,7 @@ class Whups_Driver {
             }
 
             $mail->clearRecipients();
-            $mail->addHeader('To', $to, Horde_Nls::getCharset());
+            $mail->addHeader('To', $to, $GLOBALS['registry']->getCharset());
 
             try {
                 $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'), true);
index 148cee0..e36acac 100644 (file)
@@ -83,9 +83,9 @@ class Whups_Driver_sql extends Whups_Driver {
             . 'VALUES (?, ?, ?, ?, ?)';
         $values = array(
             $new_id,
-            Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+            Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                    $this->_params['charset']),
-            Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+            Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                    $this->_params['charset']),
             $slug,
             $email);
@@ -113,9 +113,9 @@ class Whups_Driver_sql extends Whups_Driver {
         $query = 'INSERT INTO whups_types' .
                  ' (type_id, type_name, type_description) VALUES (?, ?, ?)';
         $values = array($new_id,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']));
         Horde::logMessage(
             sprintf('Whups_Driver_sql::addType(): query="%s"; values="%s"',
@@ -142,11 +142,11 @@ class Whups_Driver_sql extends Whups_Driver {
             . 'state_description, state_category) VALUES (?, ?, ?, ?, ?)';
         $values = array($new_id,
                         $typeId,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($category, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($category, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']));
         Horde::logMessage(
             sprintf('Whups_Driver_sql::addState(): query="%s"; values="%s"',
@@ -173,9 +173,9 @@ class Whups_Driver_sql extends Whups_Driver {
             . 'priority_name, priority_description) VALUES (?, ?, ?, ?)';
         $values = array($new_id,
                         $typeId,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']));
         Horde::logMessage(
             sprintf('Whups_Driver_sql::addPriority(): query="%s"; values="%s"',
@@ -212,9 +212,9 @@ class Whups_Driver_sql extends Whups_Driver {
             . 'version_name, version_description, version_active) VALUES (?, ?, ?, ?, ?)';
         $values = array((int)$new_id,
                         (int)$queueId,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                      $this->_params['charset']),
-                        Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                                      $this->_params['charset']),
                         (int)$active);
         Horde::logMessage(
@@ -251,9 +251,9 @@ class Whups_Driver_sql extends Whups_Driver {
             . 'reply_name, reply_text) VALUES (?, ?, ?, ?)';
         $values = array($type,
                         $new_id,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($text, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($text, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']));
         Horde::logMessage(
             sprintf('Whups_Driver_sql::addReply(): query="%s"; values="%s"',
@@ -296,7 +296,7 @@ class Whups_Driver_sql extends Whups_Driver {
             . 'ticket_timestamp, ticket_due, version_id)'
             . ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
         $values = array($ticketId,
-                        Horde_String::convertCharset($summary, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($summary, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
                         $requester,
                         $type,
@@ -407,7 +407,7 @@ class Whups_Driver_sql extends Whups_Driver {
                                     array((int)$id,
                                           (int)$ticket_id,
                                           $creator,
-                                          Horde_String::convertCharset($comment, Horde_Nls::getCharset(), $this->_params['charset']),
+                                          Horde_String::convertCharset($comment, $GLOBALS['registry']->getCharset(), $this->_params['charset']),
                                           time()));
         if (is_a($result, 'PEAR_Error')) {
             Horde::logMessage($result, 'ERR');
@@ -458,7 +458,7 @@ class Whups_Driver_sql extends Whups_Driver {
             }
 
             $query .= $this->_map[$field] . ' = ?, ';
-            $values[] = Horde_String::convertCharset($value, Horde_Nls::getCharset(), $this->_params['charset']);
+            $values[] = Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $this->_params['charset']);
         }
 
         /* Don't try to execute an empty query (if we didn't find any updates
@@ -1389,10 +1389,10 @@ class Whups_Driver_sql extends Whups_Driver {
                      . 'queue_description = ?, queue_versioned = ?, '
                      . 'queue_slug = ?, queue_email = ? WHERE queue_id = ?';
             $values = array(Horde_String::convertCharset($name,
-                                                   Horde_Nls::getCharset(),
+                                                   $GLOBALS['registry']->getCharset(),
                                                    $this->_params['charset']),
                             Horde_String::convertCharset($description,
-                                                   Horde_Nls::getCharset(),
+                                                   $GLOBALS['registry']->getCharset(),
                                                    $this->_params['charset']),
                             (empty($versioned) ? 0 : 1),
                             $slug,
@@ -1679,9 +1679,9 @@ class Whups_Driver_sql extends Whups_Driver {
     {
         $query = 'UPDATE whups_types' .
                  ' SET type_name = ?, type_description = ? WHERE type_id = ?';
-        $values = array(Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+        $values = array(Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
                         $typeId);
         Horde::logMessage(
@@ -1827,11 +1827,11 @@ class Whups_Driver_sql extends Whups_Driver {
     {
         $query = 'UPDATE whups_states SET state_name = ?, '
             . 'state_description = ?, state_category = ? WHERE state_id = ?';
-        $values = array(Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+        $values = array(Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($category, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($category, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
                         $stateId);
         Horde::logMessage(
@@ -1934,7 +1934,7 @@ class Whups_Driver_sql extends Whups_Driver {
             $values = array($query->id, serialize($query->parameters),
                             serialize($query->query));
         }
-        $values = Horde_String::convertCharset($values, Horde_Nls::getCharset(),
+        $values = Horde_String::convertCharset($values, $GLOBALS['registry']->getCharset(),
                                          $this->_params['charset']);
         Horde::logMessage(
             sprintf('Whups_Driver_sql::saveQuery(): query="%s"; values="%s"',
@@ -2052,9 +2052,9 @@ class Whups_Driver_sql extends Whups_Driver {
         $query = 'UPDATE whups_priorities' .
                  ' SET priority_name = ?, priority_description = ?' .
                  ' WHERE priority_id = ?';
-        $values = array(Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+        $values = array(Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
                         $priorityId);
         Horde::logMessage(
@@ -2156,9 +2156,9 @@ class Whups_Driver_sql extends Whups_Driver {
         $query = 'UPDATE whups_versions SET version_name = ?, '
             . 'version_description = ?, version_active = ? '
             . 'WHERE version_id = ?';
-        $values = array(Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+        $values = array(Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($description, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($description, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
                         (int)$active,
                         (int)$versionId);
@@ -2238,9 +2238,9 @@ class Whups_Driver_sql extends Whups_Driver {
     {
         $query = 'UPDATE whups_replies SET reply_name = ?, '
             . 'reply_text = ? WHERE reply_id = ?';
-        $values = array(Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+        $values = array(Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($text, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($text, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
                         $reply);
         Horde::logMessage(
@@ -2381,13 +2381,13 @@ class Whups_Driver_sql extends Whups_Driver {
             . ' VALUES (?, ?, ?, ?, ?, ?, ?)';
         $values = array($new_id,
                         $type_id,
-                        Horde_String::convertCharset($name, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($name, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($desc, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($desc, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
                         $type,
                         serialize(
-                            Horde_String::convertCharset($params, Horde_Nls::getCharset(),
+                            Horde_String::convertCharset($params, $GLOBALS['registry']->getCharset(),
                                                    $this->_params['charset'])),
                         (int)($required == 'on'));
 
@@ -2410,14 +2410,14 @@ class Whups_Driver_sql extends Whups_Driver {
             . 'SET attribute_name = ?, attribute_description = ?, '
             . 'attribute_type = ?, attribute_params = ?, '
             . 'attribute_required = ? WHERE attribute_id = ?';
-        $values = array(Horde_String::convertCharset($newname, Horde_Nls::getCharset(),
+        $values = array(Horde_String::convertCharset($newname, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
-                        Horde_String::convertCharset($newdesc, Horde_Nls::getCharset(),
+                        Horde_String::convertCharset($newdesc, $GLOBALS['registry']->getCharset(),
                                                $this->_params['charset']),
                         $newtype,
                         serialize(
                             Horde_String::convertCharset($newparams,
-                                                   Horde_Nls::getCharset(),
+                                                   $GLOBALS['registry']->getCharset(),
                                                    $this->_params['charset'])),
                         (int)($newrequired == 'on'),
                         $attribute_id);
@@ -2612,7 +2612,7 @@ class Whups_Driver_sql extends Whups_Driver {
     function _setAttributeValue($ticket_id, $attribute_id, $attribute_value)
     {
         $db_attribute_value = Horde_String::convertCharset((string)$attribute_value,
-                                                     Horde_Nls::getCharset(),
+                                                     $GLOBALS['registry']->getCharset(),
                                                      $this->_params['charset']);
 
         $this->_write_db->autoCommit(false);
@@ -2813,7 +2813,7 @@ class Whups_Driver_sql extends Whups_Driver {
                 time(),
                 (string)$user,
                 $type,
-                Horde_String::convertCharset((string)$value, Horde_Nls::getCharset(),
+                Horde_String::convertCharset((string)$value, $GLOBALS['registry']->getCharset(),
                                        $this->_params['charset']),
                 (int)$value);
             Horde::logMessage(
index f538875..dc4eff9 100644 (file)
@@ -20,7 +20,7 @@ $name = $registry->get('name', 'whups') . ' (' . $url . ')';
 $icon = base64_encode(file_get_contents($registry->get('themesfs', 'whups') . '/graphics/whups.png'));
 
 // Charset.
-$charset = Horde_Nls::getCharset();
+$charset = $GLOBALS['registry']->getCharset();
 
 header('Content-Type: text/xml; charset=' . $charset);
 echo <<<PAYLOAD
index b7116bf..47282d9 100644 (file)
@@ -55,7 +55,7 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', Horde_Nls::getCharset());
+$template->set('charset', $GLOBALS['registry']->getCharset());
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', htmlspecialchars($whups_query->name ? $whups_query->name : _("Query Results")));
index bbc8256..16666cf 100644 (file)
@@ -86,7 +86,7 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', Horde_Nls::getCharset());
+$template->set('charset', $GLOBALS['registry']->getCharset());
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $template->set('pubDate', htmlspecialchars(date('r')));
 if (isset($type) && isset($queue['name'])) {
index 34284bd..e212dc2 100755 (executable)
@@ -156,7 +156,7 @@ if (empty($info['ticket'])) {
 
 // Set charset to UTF-8 for most flexible conversion between email charset and
 // backend charset.
-Horde_Nls::setCharsetEnvironment('UTF-8');
+$registry->setCharsetEnvironment('UTF-8');
 
 // Read and parse the message.
 if (empty($mail['user'])) {
index fe949c5..8cd3d30 100644 (file)
@@ -47,7 +47,7 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', Horde_Nls::getCharset());
+$template->set('charset', $GLOBALS['registry']->getCharset());
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', _("Search Results"));
index 6ab785e..b323d68 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index e1d69f4..a07a11b 100644 (file)
@@ -42,7 +42,7 @@ foreach (array_keys($history) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', Horde_Nls::getCharset());
+$template->set('charset', $GLOBALS['registry']->getCharset());
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', htmlspecialchars($details['summary']));
index b4ba0c1..b1bf5a4 100644 (file)
@@ -462,7 +462,7 @@ class Wicked_Driver {
      */
     function getCharset()
     {
-        return Horde_Nls::getCharset();
+        return $GLOBALS['registry']->getCharset();
     }
 
     /**
index 1f83df1..f3373fa 100644 (file)
@@ -947,7 +947,7 @@ class Wicked_Driver_sql extends Wicked_Driver {
      */
     function _convertToDriver($value)
     {
-        return Horde_String::convertCharset($value, Horde_Nls::getCharset(), $this->getCharset());
+        return Horde_String::convertCharset($value, $GLOBALS['registry']->getCharset(), $this->getCharset());
     }
 
     /**
index 785cba9..87616fd 100644 (file)
@@ -458,7 +458,7 @@ class Page {
                 $this->_proc->deleteRule('Embed');
             }
 
-            $this->_proc->setFormatConf('Xhtml', 'charset', Horde_Nls::getCharset());
+            $this->_proc->setFormatConf('Xhtml', 'charset', $GLOBALS['registry']->getCharset());
             $this->_proc->setFormatConf('Xhtml', 'translate', HTML_SPECIALCHARS);
             $create = $this->allows(WICKED_MODE_CREATE) ? 1 : 0;
             $linkConf = array('pages' => $wicked->getPages(),
index 62fa95f..f92d6f5 100644 (file)
@@ -107,8 +107,8 @@ class MergeOrRename extends Page {
         }
 
         foreach ($references as $key => $page) {
-            $references[$key]['page_url'] = @htmlspecialchars(Wicked::url($page['page_name']), ENT_QUOTES, Horde_Nls::getCharset());
-            $references[$key]['page_name'] = @htmlspecialchars($page['page_name'], ENT_QUOTES, Horde_Nls::getCharset());
+            $references[$key]['page_url'] = @htmlspecialchars(Wicked::url($page['page_name']), ENT_QUOTES, $GLOBALS['registry']->getCharset());
+            $references[$key]['page_name'] = @htmlspecialchars($page['page_name'], ENT_QUOTES, $GLOBALS['registry']->getCharset());
 
             // Since the page name can have [ and ] and other special
             // characters in it, and we don't want the browser or PHP decoding
index d792c17..d344e66 100644 (file)
@@ -179,7 +179,7 @@ class Wicked {
                                           $conf['wicked']['notify_address'],
                                           'from' => $from . '<' . $from_addr
                                           . '>',
-                                          'charset' => Horde_Nls::getCharset()));
+                                          'charset' => $GLOBALS['registry']->getCharset()));
         $mail->addHeader('User-Agent', 'Wicked ' . $GLOBALS['registry']->getVersion());
         $mail->addHeader('Precedence', 'bulk');
         $mail->addHeader('Auto-Submitted', 'auto-replied');
index 2cf3243..64f97d9 100644 (file)
@@ -24,7 +24,7 @@ $name = $registry->get('name', 'wicked') . ' (' . $url . ')';
 $icon = base64_encode(file_get_contents($registry->get('themesfs', 'wicked') . '/graphics/wicked.png'));
 
 // Charset.
-$charset = Horde_Nls::getCharset();
+$charset = $GLOBALS['registry']->getCharset();
 
 header('Content-Type: text/xml; charset=' . $charset);
 echo <<<PAYLOAD
index a90f90f..542407b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
+    header('Content-type: text/html; charset=' . $GLOBALS['registry']->getCharset());
     header('Vary: Accept-Language');
 }
 ?>
index 0b1ea11..d36c172 100644 (file)
@@ -26,7 +26,7 @@ function preview()
 </div>
 
 <div style="padding:8px">
- <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo @htmlspecialchars($page_text, ENT_COMPAT, Horde_Nls::getCharset()) ?></textarea>
+ <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo @htmlspecialchars($page_text, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></textarea>
 </div>
 
 </form>
index 12c0210..2b69b83 100644 (file)
@@ -45,7 +45,7 @@ if (!empty($GLOBALS['conf']['wicked']['captcha']) && !$GLOBALS['registry']->getA
 <?php endif; endif; ?>
 
 <div style="padding:8px">
- <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo @htmlspecialchars($page_text, ENT_COMPAT, Horde_Nls::getCharset()) ?></textarea>
+ <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo @htmlspecialchars($page_text, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></textarea>
 </div>
 
 </form>
index 6ede924..4278964 100644 (file)
@@ -40,5 +40,5 @@ if ($show_restore) {
  <td style="text-align:center"><input type="submit" class="button" value="<?php echo htmlspecialchars($page->version()) ?>" onclick="if (document.diff.v1[<?php echo $i ?>].checked) return false; document.diff.v2.value = '<?php echo htmlspecialchars($pversion) ?>';" /></td>
 <?php endif; ?>
 
- <td><?php echo @htmlspecialchars($page->changeLog(), ENT_COMPAT, Horde_Nls::getcharset()) ?></td>
+ <td><?php echo @htmlspecialchars($page->changeLog(), ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></td>
 </tr>