* add gettext tokens to the tabbed api
authorWilfried Göesgens <willi@citadel.org>
Thu, 1 Jan 2009 21:09:12 +0000 (21:09 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 1 Jan 2009 21:09:12 +0000 (21:09 +0000)
* remove all templates that just contain translated strings needed before...
* exit configure if openssl features were requested, but the library wasn't detected.

35 files changed:
webcit/configure.ac
webcit/static/t/aide_inetconf.html
webcit/static/t/display_aide_menu.html
webcit/static/t/display_main_menu.html
webcit/static/t/display_serverrestart.html
webcit/static/t/display_serverrestartpage.html
webcit/static/t/display_sitewide_config.html
webcit/static/t/edituser_select.html
webcit/static/t/subj_advanced_roomcommands.html [deleted file]
webcit/static/t/subj_basic_commands.html [deleted file]
webcit/static/t/subj_your_info.html [deleted file]
webcit/static/t/subject_access.html [deleted file]
webcit/static/t/subject_aiderestart.html [deleted file]
webcit/static/t/subject_autopurger.html [deleted file]
webcit/static/t/subject_box_edituser_select.html [deleted file]
webcit/static/t/subject_directory.html [deleted file]
webcit/static/t/subject_edituser_add.html [deleted file]
webcit/static/t/subject_floorconfig.html [deleted file]
webcit/static/t/subject_general.html [deleted file]
webcit/static/t/subject_global_config.html [deleted file]
webcit/static/t/subject_indexing.html [deleted file]
webcit/static/t/subject_inet_aliases.html [deleted file]
webcit/static/t/subject_inet_clamav.html [deleted file]
webcit/static/t/subject_inet_dirnames.html [deleted file]
webcit/static/t/subject_inet_masqdomains.html [deleted file]
webcit/static/t/subject_inet_rbldns.html [deleted file]
webcit/static/t/subject_inet_smarthosts.html [deleted file]
webcit/static/t/subject_inet_spamass.html [deleted file]
webcit/static/t/subject_network.html [deleted file]
webcit/static/t/subject_pop3.html [deleted file]
webcit/static/t/subject_pushmail.html [deleted file]
webcit/static/t/subject_serverrestartpage.html [deleted file]
webcit/static/t/subject_tuning.html [deleted file]
webcit/static/t/subject_usermanagement.html [deleted file]
webcit/subst.c

index e2ac5e7f1a0243a8c88c9f69c3a6b7902095ab1b..786e43a2deec4a500e69b5c2f41aecb0b1bcfffb 100644 (file)
@@ -196,7 +196,7 @@ AC_CHECK_HEADER(libcitadel.h,
 
 
 
-
+found_ssl=no
 # The big search for OpenSSL
 if test "$with_ssl" != "no"; then
        saved_LIBS="$LIBS"
@@ -279,6 +279,7 @@ if test "$with_ssl" != "no"; then
        
        if test "x$ac_cv_openssldir" != "xno" ; then
                AC_DEFINE(HAVE_OPENSSL,[],[whethe we have openssl])
+               found_ssl=yes
                LIBS="-lssl -lcrypto $LIBS"
                dnl Need to recover ssldir - test above runs in subshell
                ssldir=$ac_cv_openssldir
@@ -314,6 +315,10 @@ AC_ARG_WITH(ssldir,
                        [ if test "x$withval" != "xno" ; then
                                              
                                                  ssl_dir="$withval"
+                                                 if test "$found_ssl" = "no"; then
+                                                    echo "Your setup was incomplete; ssldir doesn't make sense without openssl"
+                                                    exit
+                                                 fi
                          fi
                        AC_SUBST(MAKE_SSL_DIR)
                        ]
index 649f65c19e56dec291edc4fe662ba4edbee17637..4aae57667bd8aafcd03442dab15853b9867be942 100644 (file)
 <table border=0 width=100% cellspacing="10" cellpadding="10"> <tr><td valign=top width=50%>
 
 
-<?DOBOXED("aide_inet_aliases", "subject_inet_aliases")><br />
-<?DOBOXED("aide_inet_dirnames", "subject_inet_dirnames")><br />
-<?DOBOXED("aide_inet_smarthosts", "subject_inet_smarthosts")>
+<?DOBOXED("aide_inet_aliases", _("Local host aliases"))><br />
+<?DOBOXED("aide_inet_dirnames", _("Directory domains"))><br />
+<?DOBOXED("aide_inet_smarthosts", _("Smart hosts"))>
 
 </td><td valign=top>
 
 
-<?DOBOXED("aide_inet_rbldns", "subject_inet_rbldns")><br />
-<?DOBOXED("aide_inet_spamass", "subject_inet_spamass")><br />
-<?DOBOXED("aide_inet_clamav", "subject_inet_clamav")><br />
-<?DOBOXED("aide_inet_masqdomains", "subject_inet_masqdomains")>
+<?DOBOXED("aide_inet_rbldns", _("RBL hosts"))><br />
+<?DOBOXED("aide_inet_spamass", _("SpamAssassin hosts"))><br />
+<?DOBOXED("aide_inet_clamav", _("ClamAV clamd hosts"))><br />
+<?DOBOXED("aide_inet_masqdomains", _("Masqueradable domains"))>
 
 
 </td></tr></table>
index 5b1b0120988fcd9affb570213933f6f1135cf415..4c686c36be02cb418898e7ead139d58359ae854c 100644 (file)
 <div class="fix_scrollbar_bug">
 <table>
 <tr valign=top><td width=50% valign="top">
-<??("COND:AIDE", 3)><?DOBOXED("aide_global_config", "subject_global_config")><??("X", 3)>
+<??("COND:AIDE", 3)><?DOBOXED("aide_global_config", _("Global Configuration"))><??("X", 3)>
 </td><td width=50% valign="top">
-<??("COND:AIDE", 4)><?DOBOXED("aide_usermanagement", "subject_usermanagement")><??("X", 3)>
+<??("COND:AIDE", 4)><?DOBOXED("aide_usermanagement", _("User account management"))><??("X", 3)>
 </td></tr><tr><td width=50% valign="top">
-<??("COND:AIDE", 4)><?DOBOXED("aide_restart", "subject_aiderestart")><??("X", 3)>
+<??("COND:AIDE", 4)><?DOBOXED("aide_restart", _("Shutdown Citadel"))><??("X", 3)>
 </td><td width=50% valign="top">
-<?DOBOXED("aide_floorconfig", "subject_floorconfig")>
+<?DOBOXED("aide_floorconfig", _("Rooms and Floors"))>
 </td></tr></table></div>
 <?=("trailing")>
index 608a5656a4c1eea306d41281a3715d267c54f978..1487fb01d7fe2876b744cf2016845a81169c588f 100644 (file)
@@ -6,12 +6,12 @@
 <div class="fix_scrollbar_bug">
 <table width="100%" cellspacing="10" cellpadding="0">
 <tr><td colspan="2" class="advanced">
-  <?DOBOXED("menu_basic_commands", "subj_basic_commands")>
+  <?DOBOXED("menu_basic_commands", _("Basic commands"))>
 </td></tr>
 <tr valign=top><td width=50%>
-  <?DOBOXED("menu_your_info", "subj_your_info")>
+  <?DOBOXED("menu_your_info", _("Your info"))>
 </td><td width=50%>
-  <?DOBOXED("menu_advanced_roomcommands", "subj_advanced_roomcommands")>
+  <?DOBOXED("menu_advanced_roomcommands", _("Advanced room commands"))>
 </td></tr>
 </table>
 </div>
index c96e2c5d067b191607d82009b31b73865f41fefe..af48f5da330c416f041be39b4244b2d03dd40499 100644 (file)
@@ -27,6 +27,6 @@
 <div class="fix_scrollbar_bug">
 <table>
 <td width=50% valign="top">
-<?DOBOXED("box_serverrestart", "subject_floorconfig")>
+<?DOBOXED("box_serverrestart", _("Rooms and Floors"))>
 </td></tr></table></div>
 <?=("trailing")>
index c83a4cd6b1e24106b38ed9861ad338bcf51b39f0..62a564da0e510f8d5ed25ae840223971c3a882c0 100644 (file)
@@ -1,6 +1,6 @@
 <?=("head")>
 <?=("important_msg")>
 <div id="resatrt_page">
-<?DOBOXED("box_serverrestartpage", "subject_serverrestartpage")>
+<?DOBOXED("box_serverrestartpage", _("Message to your Users:"))>
 </div>
 <?=("trailing")>
index 97e23d76fe941e6eadc3bda5b1d0c998c1478cc0..1d1809c66b51999c82415a9e4c1dba4d09e3fdec 100644 (file)
@@ -8,15 +8,15 @@
 <table border="0" cellspacing="0" cellpadding="0" ><tr><td>
 <form method="post" action="siteconfig">
 <input type="hidden" name="nonce" value= '<?NONCE>'>
-<?DOTABBED("subject_general", "tab_siteconfig_general",
-       "subject_access", "tab_siteconfig_access",
-       "subject_network", "tab_siteconfig_network",
-       "subject_tuning", "tab_siteconfig_tuning",
-       "subject_directory", "tab_siteconfig_directory",
-       "subject_autopurger", "tab_siteconfig_autopurger",
-       "subject_indexing", "tab_siteconfig_indexing",
-       "subject_pushmail", "tab_siteconfig_pushmail",
-       "subject_pop3", "tab_siteconfig_pop3", 
+<?DOTABBED(_("General"), "tab_siteconfig_general",
+       _("Access"), "tab_siteconfig_access",
+       _("Network"), "tab_siteconfig_network",
+       _("Tuning"), "tab_siteconfig_tuning",
+       _("Directory"), "tab_siteconfig_directory",
+       _("Auto-purger"), "tab_siteconfig_autopurger",
+       _("Indexing/Journaling"), "tab_siteconfig_indexing",
+       _("Push Email"), "tab_siteconfig_pushmail",
+       _("Pop3"), "tab_siteconfig_pop3", 
         "", "submit_siteconfig")>
 </form>
 </td></tr></table>
index 2282d490a742da95d59e3cc57f7131645999dc6a..fde9e292afa3b25a5d70fd6752a4bd8041fe81c7 100644 (file)
@@ -15,9 +15,9 @@
 
 <table border=0 cellspacing=10>
 <tr valign=top><td>
-  <?DOBOXED("edituser_add", "subject_edituser_add")>
+  <?DOBOXED("edituser_add", _("Add users"))>
 </td><td>
- <?DOBOXED("box_edituser_select", "subject_box_edituser_select")>
+ <?DOBOXED("box_edituser_select", _("Edit or Delete users"))>
 </td></tr>
 </table>
 <??("X", 2)>
diff --git a/webcit/static/t/subj_advanced_roomcommands.html b/webcit/static/t/subj_advanced_roomcommands.html
deleted file mode 100644 (file)
index 7f5388e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Advanced room commands")>
diff --git a/webcit/static/t/subj_basic_commands.html b/webcit/static/t/subj_basic_commands.html
deleted file mode 100644 (file)
index ce6ae2b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Basic commands")>
diff --git a/webcit/static/t/subj_your_info.html b/webcit/static/t/subj_your_info.html
deleted file mode 100644 (file)
index 9da9ca8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Your info")>
diff --git a/webcit/static/t/subject_access.html b/webcit/static/t/subject_access.html
deleted file mode 100644 (file)
index a998662..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Access")>
diff --git a/webcit/static/t/subject_aiderestart.html b/webcit/static/t/subject_aiderestart.html
deleted file mode 100644 (file)
index 8b11af6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Shutdown Citadel")>
diff --git a/webcit/static/t/subject_autopurger.html b/webcit/static/t/subject_autopurger.html
deleted file mode 100644 (file)
index 781c5cc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Auto-purger")>
diff --git a/webcit/static/t/subject_box_edituser_select.html b/webcit/static/t/subject_box_edituser_select.html
deleted file mode 100644 (file)
index 722bc93..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Edit or Delete users")>
diff --git a/webcit/static/t/subject_directory.html b/webcit/static/t/subject_directory.html
deleted file mode 100644 (file)
index def1107..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Directory")>
diff --git a/webcit/static/t/subject_edituser_add.html b/webcit/static/t/subject_edituser_add.html
deleted file mode 100644 (file)
index 7035214..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Add users")>
diff --git a/webcit/static/t/subject_floorconfig.html b/webcit/static/t/subject_floorconfig.html
deleted file mode 100644 (file)
index 6ab741a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Rooms and Floors")>
diff --git a/webcit/static/t/subject_general.html b/webcit/static/t/subject_general.html
deleted file mode 100644 (file)
index e59c2e8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("General")>
diff --git a/webcit/static/t/subject_global_config.html b/webcit/static/t/subject_global_config.html
deleted file mode 100644 (file)
index adc8489..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Global Configuration")>
diff --git a/webcit/static/t/subject_indexing.html b/webcit/static/t/subject_indexing.html
deleted file mode 100644 (file)
index 1319d4e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Indexing/Journaling")>
diff --git a/webcit/static/t/subject_inet_aliases.html b/webcit/static/t/subject_inet_aliases.html
deleted file mode 100644 (file)
index a68b519..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Local host aliases")>
diff --git a/webcit/static/t/subject_inet_clamav.html b/webcit/static/t/subject_inet_clamav.html
deleted file mode 100644 (file)
index 521452b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("ClamAV clamd hosts")>
diff --git a/webcit/static/t/subject_inet_dirnames.html b/webcit/static/t/subject_inet_dirnames.html
deleted file mode 100644 (file)
index 9a43094..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Directory domains")>
diff --git a/webcit/static/t/subject_inet_masqdomains.html b/webcit/static/t/subject_inet_masqdomains.html
deleted file mode 100644 (file)
index 151ab4d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Masqueradable domains")>
diff --git a/webcit/static/t/subject_inet_rbldns.html b/webcit/static/t/subject_inet_rbldns.html
deleted file mode 100644 (file)
index bc52ca2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("RBL hosts")>
diff --git a/webcit/static/t/subject_inet_smarthosts.html b/webcit/static/t/subject_inet_smarthosts.html
deleted file mode 100644 (file)
index 4f99280..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Smart hosts")>
diff --git a/webcit/static/t/subject_inet_spamass.html b/webcit/static/t/subject_inet_spamass.html
deleted file mode 100644 (file)
index 972a52b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("SpamAssassin hosts")>
diff --git a/webcit/static/t/subject_network.html b/webcit/static/t/subject_network.html
deleted file mode 100644 (file)
index e79a3f9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Network")>
diff --git a/webcit/static/t/subject_pop3.html b/webcit/static/t/subject_pop3.html
deleted file mode 100644 (file)
index 499ae00..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Pop3")>
diff --git a/webcit/static/t/subject_pushmail.html b/webcit/static/t/subject_pushmail.html
deleted file mode 100644 (file)
index 394b5c4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Push Email")>
diff --git a/webcit/static/t/subject_serverrestartpage.html b/webcit/static/t/subject_serverrestartpage.html
deleted file mode 100644 (file)
index a12b331..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Message to your Users:")>
diff --git a/webcit/static/t/subject_tuning.html b/webcit/static/t/subject_tuning.html
deleted file mode 100644 (file)
index 5bb01ae..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("Tuning")>
diff --git a/webcit/static/t/subject_usermanagement.html b/webcit/static/t/subject_usermanagement.html
deleted file mode 100644 (file)
index 88950ce..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?_("User account management")>
index f932e10ba8e43a06d03b8298abf9bf7725a26004..a43cdcffdd96bd70a00c9ae5af07ee8c36264048 100644 (file)
@@ -1795,10 +1795,20 @@ void tmpl_do_tabbed(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Co
        TabNames = (StrBuf **) malloc(ntabs * sizeof(StrBuf*));
 
        for (i = 0; i < ntabs; i++) {
-               TabNames[i] = NewStrBuf();
-               if (Tokens->Params[i * 2]->len > 0) {
+               if ((Tokens->Params[i * 2]->Type == TYPE_STR) &&
+                   (Tokens->Params[i * 2]->len > 0)) {
+                       TabNames[i] = NewStrBuf();
                        DoTemplate(TKEY(i * 2), TabNames[i], Context, ContextType);
                }
+               else if (Tokens->Params[i * 2]->Type == TYPE_GETTEXT) {
+                       const char *Ch;
+                       long len;
+                       GetTemplateTokenString(Tokens, 
+                                              i * 2,
+                                              &Ch,
+                                              &len);
+                       TabNames[i] = NewStrBufPlain(Ch, -1);
+               }
                else { 
                        /** A Tab without subject? we can't count that, add it as silent */
                        nTabs --;
@@ -1808,7 +1818,6 @@ void tmpl_do_tabbed(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Co
        StrTabbedDialog(Target, nTabs, TabNames);
        for (i = 0; i < ntabs; i++) {
                StrBeginTab(Target, i, nTabs);
-
                DoTemplate(TKEY(i * 2 + 1), Target, Context, ContextType);
                StrEndTab(Target, i, nTabs);
        }