* the navbar style isn't used, remove it.
authorWilfried Göesgens <willi@citadel.org>
Tue, 10 Aug 2010 18:39:54 +0000 (18:39 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 10 Aug 2010 18:39:54 +0000 (18:39 +0000)
webcit/roomops.c
webcit/webcit.c
webcit/webcit.h

index ad90f2d3ad9d580deb9e78fc740b65ba41de92f2..1b7925641687d237af1800472de2a4442dabd250 100644 (file)
@@ -258,13 +258,11 @@ void zapped_list(void)
  *
  */
 
-void embed_room_banner(char *got, int navbar_style) {
+void embed_room_banner(char *got) 
+{
        wcsession *WCC = WC;
        char buf[256];
-       char buf2[1024];
-       char with_files[256];
-       int file_count=0;
-       
+                               
        /*
         * We need to have the information returned by a GOTO server command.
         * If it isn't supplied, we fake it by issuing our own GOTO.
@@ -282,7 +280,7 @@ void embed_room_banner(char *got, int navbar_style) {
                  "     room_is_trash = %d;             \n"
                  "</script>\n",
                  ((WC->CurRoom.RAFlags & UA_ISTRASH) != 0)
-       );
+               );
 
        /*
         * If the user happens to select the "make this my start page" link,
@@ -295,7 +293,7 @@ void embed_room_banner(char *got, int navbar_style) {
        StrBufPrintf(WCC->Hdr->this_page, 
                     "dotskip?room=%s",
                     ChrPtr(WC->CurRoom.name)
-       );
+               );
 
        /* Check for new mail. */
        WC->new_mail = extract_int(&got[4], 9);
@@ -303,11 +301,11 @@ void embed_room_banner(char *got, int navbar_style) {
 
        do_template("roombanner", NULL);
        /* roombanner contains this for mobile */
-       if (navbar_style != navbar_none && (WC->is_mobile < 1)) { 
+       if (WC->is_mobile < 1) { 
 
                wc_printf("<div id=\"navbar\"><ul>");
 
-               if (navbar_style == navbar_default) wc_printf(
+               wc_printf(
                        "<li class=\"ungoto\">"
                        "<a href=\"ungoto\">"
                        "<img src=\"static/ungoto2_24x.gif\" alt=\"\" width=\"24\" height=\"24\">"
@@ -315,7 +313,7 @@ void embed_room_banner(char *got, int navbar_style) {
                        "</li>\n", _("Ungoto")
                        );
 
-               if ( (navbar_style == navbar_default) && (WC->CurRoom.view == VIEW_BBS) ) {
+               if (WC->CurRoom.view == VIEW_BBS) {
                        wc_printf(
                                "<li class=\"newmess\">"
                                "<a href=\"readnew\">"
@@ -325,232 +323,228 @@ void embed_room_banner(char *got, int navbar_style) {
                                );
                }
 
-               if (navbar_style == navbar_default) {
-                       switch(WC->CurRoom.view) {
-                       case VIEW_ADDRESSBOOK:
-                               wc_printf(
-                                       "<li class=\"viewcontacts\">"
-                                       "<a href=\"readfwd\">"
-                                       "<img src=\"static/viewcontacts_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("View contacts")
-                                       );
-                               break;
-                       case VIEW_CALENDAR:
-                               wc_printf(
-                                       "<li class=\"staskday\">"
-                                       "<a href=\"readfwd?calview=day\">"
-                                       "<img src=\"static/taskday2_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Day view")
-                                       );
-                               wc_printf(
-                                       "<li class=\"monthview\">"
-                                       "<a href=\"readfwd?calview=month\">"
-                                       "<img src=\"static/monthview2_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Month view")
-                                       );
-                               break;
-                       case VIEW_CALBRIEF:
-                               wc_printf(
-                                       "<li class=\"monthview\">"
-                                       "<a href=\"readfwd?calview=month\">"
-                                       "<img src=\"static/monthview2_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Calendar list")
-                                       );
-                               break;
-                       case VIEW_TASKS:
-                               wc_printf(
-                                       "<li class=\"taskmanag\">"
-                                       "<a href=\"readfwd\">"
-                                       "<img src=\"static/taskmanag_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("View tasks")
-                                       );
-                               break;
-                       case VIEW_NOTES:
-                               wc_printf(
-                                       "<li class=\"viewnotes\">"
-                                       "<a href=\"readfwd\">"
-                                       "<img src=\"static/viewnotes_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("View notes")
-                                       );
-                               break;
-                       case VIEW_MAILBOX:
-                               wc_printf(
-                                       "<li class=\"readallmess\">"
-                                       "<a id=\"m_refresh\" href=\"readfwd\">"
-                                       "<img src=\"static/readallmess3_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Refresh message list")
-                                       );
-                               break;
-                       case VIEW_WIKI:
-                               wc_printf(
-                                       "<li class=\"readallmess\">"
-                                       "<a href=\"wiki?page=home\">"
-                                       "<img src=\"static/readallmess3_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Wiki home")
-                                       );
-                               break;
-                       default:
-                               wc_printf(
-                                       "<li class=\"readallmess\">"
-                                       "<a href=\"readfwd\">"
-                                       "<img src=\"static/readallmess3_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Read all messages")
-                                       );
-                               break;
-                       }
+               switch(WC->CurRoom.view) {
+               case VIEW_ADDRESSBOOK:
+                       wc_printf(
+                               "<li class=\"viewcontacts\">"
+                               "<a href=\"readfwd\">"
+                               "<img src=\"static/viewcontacts_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("View contacts")
+                               );
+                       break;
+               case VIEW_CALENDAR:
+                       wc_printf(
+                               "<li class=\"staskday\">"
+                               "<a href=\"readfwd?calview=day\">"
+                               "<img src=\"static/taskday2_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Day view")
+                               );
+                       wc_printf(
+                               "<li class=\"monthview\">"
+                               "<a href=\"readfwd?calview=month\">"
+                               "<img src=\"static/monthview2_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Month view")
+                               );
+                       break;
+               case VIEW_CALBRIEF:
+                       wc_printf(
+                               "<li class=\"monthview\">"
+                               "<a href=\"readfwd?calview=month\">"
+                               "<img src=\"static/monthview2_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Calendar list")
+                               );
+                       break;
+               case VIEW_TASKS:
+                       wc_printf(
+                               "<li class=\"taskmanag\">"
+                               "<a href=\"readfwd\">"
+                               "<img src=\"static/taskmanag_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("View tasks")
+                               );
+                       break;
+               case VIEW_NOTES:
+                       wc_printf(
+                               "<li class=\"viewnotes\">"
+                               "<a href=\"readfwd\">"
+                               "<img src=\"static/viewnotes_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("View notes")
+                               );
+                       break;
+               case VIEW_MAILBOX:
+                       wc_printf(
+                               "<li class=\"readallmess\">"
+                               "<a id=\"m_refresh\" href=\"readfwd\">"
+                               "<img src=\"static/readallmess3_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Refresh message list")
+                               );
+                       break;
+               case VIEW_WIKI:
+                       wc_printf(
+                               "<li class=\"readallmess\">"
+                               "<a href=\"wiki?page=home\">"
+                               "<img src=\"static/readallmess3_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Wiki home")
+                               );
+                       break;
+               default:
+                       wc_printf(
+                               "<li class=\"readallmess\">"
+                               "<a href=\"readfwd\">"
+                               "<img src=\"static/readallmess3_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Read all messages")
+                               );
+                       break;
                }
 
-               if (navbar_style == navbar_default) {
-                       switch(WC->CurRoom.view) {
-                       case VIEW_ADDRESSBOOK:
-                               wc_printf(
-                                       "<li class=\"addnewcontact\">"
-                                       "<a href=\"display_enter\">"
-                                       "<img src=\"static/addnewcontact_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Add new contact")
-                                       );
-                               break;
-                       case VIEW_CALENDAR:
-                       case VIEW_CALBRIEF:
-                               wc_printf("<li class=\"addevent\"><a href=\"display_enter");
-                               if (havebstr("year" )) wc_printf("?year=%s", bstr("year"));
-                               if (havebstr("month")) wc_printf("?month=%s", bstr("month"));
-                               if (havebstr("day"  )) wc_printf("?day=%s", bstr("day"));
-                               wc_printf("\">"
-                                       "<img  src=\"static/addevent_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Add new event")
-                                       );
-                               break;
-                       case VIEW_TASKS:
-                               wc_printf(
-                                       "<li class=\"newmess\">"
-                                       "<a href=\"display_enter\">"
-                                       "<img  src=\"static/newmess3_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Add new task")
-                                       );
-                               break;
-                       case VIEW_NOTES:
-                               wc_printf(
-                                       "<li class=\"enternewnote\">"
-                                       "<a href=\"add_new_note\">"
-                                       "<img  src=\"static/enternewnote_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Add new note")
-                                       );
-                               break;
-                       case VIEW_WIKI:
-                               safestrncpy(buf, bstr("page"), sizeof buf);
-                               if (IsEmptyStr(buf)) {
-                                       safestrncpy(buf, "home", sizeof buf);
-                               }
-                               str_wiki_index(buf);
-                               wc_printf(
-                                       "<li class=\"newmess\">"
-                                       "<a href=\"display_enter?page=%s\">"
-                                       "<img  src=\"static/newmess3_24x.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\">"
-                                       "<span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", buf, _("Edit this page")
-                                       );
+               switch(WC->CurRoom.view) {
+               case VIEW_ADDRESSBOOK:
+                       wc_printf(
+                               "<li class=\"addnewcontact\">"
+                               "<a href=\"display_enter\">"
+                               "<img src=\"static/addnewcontact_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Add new contact")
+                               );
+                       break;
+               case VIEW_CALENDAR:
+               case VIEW_CALBRIEF:
+                       wc_printf("<li class=\"addevent\"><a href=\"display_enter");
+                       if (havebstr("year" )) wc_printf("?year=%s", bstr("year"));
+                       if (havebstr("month")) wc_printf("?month=%s", bstr("month"));
+                       if (havebstr("day"  )) wc_printf("?day=%s", bstr("day"));
+                       wc_printf("\">"
+                                 "<img  src=\"static/addevent_24x.gif\" "
+                                 "alt=\"\" width=\"24\" height=\"24\">"
+                                 "<span class=\"navbar_link\">"
+                                 "%s"
+                                 "</span></a></li>\n", _("Add new event")
+                               );
+                       break;
+               case VIEW_TASKS:
+                       wc_printf(
+                               "<li class=\"newmess\">"
+                               "<a href=\"display_enter\">"
+                               "<img  src=\"static/newmess3_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Add new task")
+                               );
+                       break;
+               case VIEW_NOTES:
+                       wc_printf(
+                               "<li class=\"enternewnote\">"
+                               "<a href=\"add_new_note\">"
+                               "<img  src=\"static/enternewnote_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Add new note")
+                               );
+                       break;
+               case VIEW_WIKI:
+                       safestrncpy(buf, bstr("page"), sizeof buf);
+                       if (IsEmptyStr(buf)) {
+                               safestrncpy(buf, "home", sizeof buf);
+                       }
+                       str_wiki_index(buf);
+                       wc_printf(
+                               "<li class=\"newmess\">"
+                               "<a href=\"display_enter?page=%s\">"
+                               "<img  src=\"static/newmess3_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", buf, _("Edit this page")
+                               );
 
-                               if (bmstrcasestr((char *)ChrPtr(WCC->Hdr->HR.ReqLine), "wiki_history")) {
-                                       /* already viewing history; display a link to the current page */
-                                       wc_printf(
-                                               "<li class=\"newmess\">"
-                                               "<a href=\"wiki?page=%s\">"
-                                               "<img  src=\"static/newmess3_24x.gif\" "
-                                               "alt=\"\" width=\"24\" height=\"24\">"
-                                               "<span class=\"navbar_link\">"
-                                               "%s"
-                                               "</span></a></li>\n", buf, _("Current version")
-                                               );
-                               }
-                               else {
-                                       /* display a link to the history */
-                                       wc_printf(
-                                               "<li class=\"newmess\">"
-                                               "<a href=\"wiki_history?page=%s\">"
-                                               "<img  src=\"static/newmess3_24x.gif\" "
-                                               "alt=\"\" width=\"24\" height=\"24\">"
-                                               "<span class=\"navbar_link\">"
-                                               "%s"
-                                               "</span></a></li>\n", buf, _("History")
-                                               );
-                               }
-                               break;
-                       case VIEW_MAILBOX:
+                       if (bmstrcasestr((char *)ChrPtr(WCC->Hdr->HR.ReqLine), "wiki_history")) {
+                               /* already viewing history; display a link to the current page */
                                wc_printf(
                                        "<li class=\"newmess\">"
-                                       "<a href=\"display_enter\">"
+                                       "<a href=\"wiki?page=%s\">"
                                        "<img  src=\"static/newmess3_24x.gif\" "
                                        "alt=\"\" width=\"24\" height=\"24\">"
                                        "<span class=\"navbar_link\">"
                                        "%s"
-                                       "</span></a></li>\n", _("Write mail")
-                                       );
-                               wc_printf(
-                                       "<li class=\"newmess\">"
-                                       "<a href=\"javascript:deleteAllSelectedMessages();\">"
-                                       "<img  src=\"static/delete.gif\" "
-                                       "alt=\"\" width=\"24\" height=\"24\"><span class=\"navbar_link\">"
-                                       "%s"
-                                       "</span></a></li>\n", _("Delete")
+                                       "</span></a></li>\n", buf, _("Current version")
                                        );
-                               break;
-                       default:
+                       }
+                       else {
+                               /* display a link to the history */
                                wc_printf(
                                        "<li class=\"newmess\">"
-                                       "<a href=\"display_enter\">"
+                                       "<a href=\"wiki_history?page=%s\">"
                                        "<img  src=\"static/newmess3_24x.gif\" "
                                        "alt=\"\" width=\"24\" height=\"24\">"
                                        "<span class=\"navbar_link\">"
                                        "%s"
-                                       "</span></a></li>\n", _("Enter a message")
+                                       "</span></a></li>\n", buf, _("History")
                                        );
-                               break;
                        }
+                       break;
+               case VIEW_MAILBOX:
+                       wc_printf(
+                               "<li class=\"newmess\">"
+                               "<a href=\"display_enter\">"
+                               "<img  src=\"static/newmess3_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Write mail")
+                               );
+                       wc_printf(
+                               "<li class=\"newmess\">"
+                               "<a href=\"javascript:deleteAllSelectedMessages();\">"
+                               "<img  src=\"static/delete.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\"><span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Delete")
+                               );
+                       break;
+               default:
+                       wc_printf(
+                               "<li class=\"newmess\">"
+                               "<a href=\"display_enter\">"
+                               "<img  src=\"static/newmess3_24x.gif\" "
+                               "alt=\"\" width=\"24\" height=\"24\">"
+                               "<span class=\"navbar_link\">"
+                               "%s"
+                               "</span></a></li>\n", _("Enter a message")
+                               );
+                       break;
                }
 
-               if (navbar_style == navbar_default) wc_printf(
+               wc_printf(
                        "<li class=\"skipthisroom\">"
                        "<a href=\"skip\" "
                        "title=\"%s\">"
@@ -561,8 +555,8 @@ void embed_room_banner(char *got, int navbar_style) {
                        _("Leave all messages marked as unread, go to next room with unread messages"),
                        _("Skip this room")
                        );
-
-               if (navbar_style == navbar_default) wc_printf(
+               
+               wc_printf(
                        "<li class=\"markngo\">"
                        "<a href=\"gotonext\" "
                        "title=\"%s\">"
@@ -573,10 +567,9 @@ void embed_room_banner(char *got, int navbar_style) {
                        _("Mark all messages as read, go to next room with unread messages"),
                        _("Goto next room")
                        );
-
+       
                wc_printf("</ul></div>\n");
        }
-
 }
 
 
@@ -3295,7 +3288,7 @@ void tmplput_current_room(StrBuf *Target, WCTemplputParams *TP)
 void tmplput_roombanner(StrBuf *Target, WCTemplputParams *TP)
 {
        wc_printf("<div id=\"banner\">\n");
-       embed_room_banner(NULL, navbar_default);
+       embed_room_banner(NULL);
        wc_printf("</div>\n");
 }
 
index 71fdef9594ff84437aec76265992cb2b3fa3d0af..f7f7931699831e20ec9f5bb65c07cc19413cb873 100644 (file)
@@ -213,7 +213,7 @@ void output_headers(        int do_httpheaders,     /* 1 = output HTTP headers
 
                if (do_room_banner == 1) {
                        wc_printf("<div id=\"banner\">\n");
-                       embed_room_banner(NULL, navbar_default);
+                       embed_room_banner(NULL);
                        wc_printf("</div>\n");
                }
        }
index de793952caa5da8c6428a44ec4dd2c542c020146..a6cdf323504b01f15b09756c525be9e2e410689c 100644 (file)
@@ -844,15 +844,10 @@ void summary(void);
 
 int is_mobile_ua(char *user_agent);
 
-void embed_room_banner(char *, int);
+void embed_room_banner(char *);
 HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
 HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP);
 int SortRoomsByListOrder(const void *room1, const void *room2);
-/* navbar types that can be passed to embed_room_banner */
-enum {
-       navbar_none,
-       navbar_default
-};
 
 /* actual supported locales */
 void TmplGettext(StrBuf *Target, WCTemplputParams *TP);