]> code.citadel.org Git - citadel.git/blobdiff - webcit/wiki.c
* Created IsEmptyStr define to be used rather then using some weird strlen constructs
[citadel.git] / webcit / wiki.c
index 9d6a6b59b6da5979c89a50299f287bca4cdc7227..40fe296fbbe0548c1d7aadb34f904e2d5fd6b295 100644 (file)
@@ -1,14 +1,15 @@
 /*
- * $Id:  $
+ * $Id$
  */
 /**
  *
  * \defgroup Wiki Wiki; Functions pertaining to rooms with a wiki view
- *
+ * \ingroup WebcitDisplayItems
  */
 
 /*@{*/
 #include "webcit.h"
+#include "groupdav.h"
 
 
 
@@ -50,18 +51,22 @@ void display_wiki_page(void)
        safestrncpy(pagename, bstr("page"), sizeof pagename);
        str_wiki_index(pagename);
 
-       /* If we're not in the correct room, try going there. */
-       if (strcasecmp(roomname, WC->wc_roomname)) {
-               gotoroom(roomname);
-       }
+       if (!IsEmptyStr(roomname)) {
+
+               /* If we're not in the correct room, try going there. */
+               if (strcasecmp(roomname, WC->wc_roomname)) {
+                       gotoroom(roomname);
+               }
+       
+               /* If we're still not in the correct room, it doesn't exist. */
+               if (strcasecmp(roomname, WC->wc_roomname)) {
+                       snprintf(errmsg, sizeof errmsg,
+                               _("There is no room called '%s'."),
+                               roomname);
+                       convenience_page("FF0000", _("Error"), errmsg);
+                       return;
+               }
 
-       /* If we're still not in the correct room, it doesn't exist. */
-       if (strcasecmp(roomname, WC->wc_roomname)) {
-               snprintf(errmsg, sizeof errmsg,
-                       _("There is no room called '%s'."),
-                       roomname);
-               convenience_page("FF0000", _("Error"), errmsg);
-               return;
        }
 
        if (WC->wc_view != VIEW_WIKI) {
@@ -72,7 +77,7 @@ void display_wiki_page(void)
                return;
        }
 
-       if (strlen(pagename) == 0) {
+       if (IsEmptyStr(pagename)) {
                strcpy(pagename, "home");
        }
 
@@ -94,9 +99,8 @@ void display_wiki_page(void)
        wprintf("<br><b>");
        wprintf(_("There is no page called '%s' here."), pagename);
        wprintf("</b><br><br>");
-       wprintf("<a href=\"display_enter?wikipage=%s\">", pagename);
-       wprintf(_("Click here if you would like to create this page."));
-       wprintf("</a>");
+       wprintf(_("Select the 'Edit this page' link in the room banner "
+               "if you would like to create this page."));
        wprintf("<br><br>");
        wprintf("</td></tr></table></div>\n");
        wDumpContent(1);