* migrate search-o-matic to template only.
authorWilfried Göesgens <willi@citadel.org>
Thu, 5 Aug 2010 21:07:51 +0000 (21:07 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 5 Aug 2010 21:07:51 +0000 (21:07 +0000)
webcit/roomops.c
webcit/serv_func.c
webcit/static/t/roombanner.html
webcit/static/t/roombanner.m.html
webcit/static/t/searchomatic.html [new file with mode: 0644]

index aa771800fda40ef06fd8741c77985f020099c401..e49816b75e7607c848b13a4dc11ab64c53e39284 100644 (file)
@@ -318,22 +318,6 @@ void embed_view_o_matic(StrBuf *Target, WCTemplputParams *TP)
 }
 
 
-/*
- * Display a search box
- */
-void embed_search_o_matic(StrBuf *Target, WCTemplputParams *TP)
-{
-       wc_printf("<form name=\"searchomatic\" action=\"do_search\">\n");
-       wc_printf("<div style=\"display: inline;\"><input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
-       wc_printf("<label for=\"srchquery\">");
-       wc_printf(_("Search: "));
-       wc_printf("</label><input ");
-       wc_printf("%s", WC->serv_info->serv_fulltext_enabled ? "" : "disabled ");
-       wc_printf("type=\"text\" name=\"query\" id=\"srchquery\" size=\"15\" maxlength=\"128\" class=\"inputbox\">\n"
-               );
-       wc_printf("</div></form>\n");
-}
-
 
 /*
  * Embed the room banner
@@ -409,7 +393,6 @@ void embed_room_banner(char *got, int navbar_style) {
                );
        svcallback("ROOMINFO", readinfo);
        svcallback("VIEWOMATIC", embed_view_o_matic); 
-       svcallback("SEARCHOMATIC", embed_search_o_matic);
        svcallback("START", offer_start_page); 
  
        do_template("roombanner", NULL);
index 50bf1f771d993d5f306d67fd9ece24090d53562e..755469ccdadb3b91b045d35f0e85c665d5239771 100644 (file)
@@ -758,7 +758,7 @@ InitModule_SERVFUNC
 
        RegisterConditional(HKEY("COND:SERV:OPENID"), 2, conditional_serv_supports_openid, CTX_NONE);
        RegisterConditional(HKEY("COND:SERV:NEWU"), 2, conditional_serv_newuser_disabled, CTX_NONE);
-       RegisterConditional(HKEY("COND:SERV:HAVEFULLTEXT"), 2, conditional_serv_fulltext_enabled, CTX_NONE);
+       RegisterConditional(HKEY("COND:SERV:FULLTEXT_ENABLED"), 2, conditional_serv_fulltext_enabled, CTX_NONE);
        RegisterNamespace("SERV:PID", 0, 0, tmplput_serv_ip, NULL, CTX_NONE);
        RegisterNamespace("SERV:NODENAME", 0, 1, tmplput_serv_nodename, NULL, CTX_NONE);
        RegisterNamespace("SERV:HUMANNODE", 0, 1, tmplput_serv_humannode, NULL, CTX_NONE);
index 73ffa829d8e4f251142e1d410e7b71662468fda8..b4cef3cd21b397e585b54d2aae06119085a0fecc 100644 (file)
@@ -19,7 +19,7 @@
 <td id="actiondiv">
 <ul class="room_actions">
 <li class="start_page"><?START></li>
-<li class="search" id="searchomatic"><?SEARCHOMATIC></li>
+<li class="search" id="searchomatic"><?=("searchomatic")></li>
 <li class="view"><?VIEWOMATIC></li>
 <??("COND:SUBST", 1, "WCVIEW", "1")><li class="hidden" id="selectpage"><?_("Select page: ")> <select id="summpage"><option> </option></select></li><??("X",1)>
 </ul>
index 05a4f200736217354ac7ef2ce40d14ce40638db9..7ae78410fcc1ea1d7573a692b2aae81356561e84 100644 (file)
@@ -2,6 +2,6 @@
 <div class="banner" >
 <h1 class="roomname"><?=("room_view_picture")> <?ROOMNAME></h1>
 <p><?ROOMINFO> <?NUMMSGS></p>
-<p><?START> <?SEARCHOMATIC></p>
+<p><?START> <?=("searchomatic"></p>
 </div>
 <!-- end roombanner.html -->
diff --git a/webcit/static/t/searchomatic.html b/webcit/static/t/searchomatic.html
new file mode 100644 (file)
index 0000000..f348dc1
--- /dev/null
@@ -0,0 +1,7 @@
+<form name="searchomatic" action="do_search">
+       <div style="display: inline;">
+               <input type="hidden" name="nonce" value="<?NONCE>">
+               <label for="srchquery"><?_("Search: ")></label>
+               <input <??("COND:SERV:FULLTEXT_ENABLED", 1, "something needed here", 1,  "", "disabled='disabled'")> type="text" name="query" id="srchquery" size="15" maxlength="128" class="inputbox">
+       </div>
+</form>