From e415465c25cc3c085f413be4d5bf7ddab70e6965 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 31 Aug 2008 23:47:20 +0000 Subject: [PATCH] * switch menubar to template --- webcit/iconbar.c | 2 +- webcit/roomops.c | 41 +++++++++++++++++++ webcit/static/t/display_main_menu.html | 19 +++++++++ .../static/t/menu_advanced_roomcommands.html | 9 ++++ webcit/static/t/menu_basic_commands.html | 20 +++++++++ webcit/static/t/menu_your_info.html | 10 +++++ .../static/t/subj_advanced_roomcommands.html | 1 + webcit/static/t/subj_basic_commands.html | 1 + webcit/static/t/subj_your_info.html | 1 + 9 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 webcit/static/t/display_main_menu.html create mode 100644 webcit/static/t/menu_advanced_roomcommands.html create mode 100644 webcit/static/t/menu_basic_commands.html create mode 100644 webcit/static/t/menu_your_info.html create mode 100644 webcit/static/t/subj_advanced_roomcommands.html create mode 100644 webcit/static/t/subj_basic_commands.html create mode 100644 webcit/static/t/subj_your_info.html diff --git a/webcit/iconbar.c b/webcit/iconbar.c index 6276030e2..3469bc08b 100644 --- a/webcit/iconbar.c +++ b/webcit/iconbar.c @@ -304,7 +304,7 @@ void do_iconbar(void) { /** Advanced Options icon */ if (IconbarIsEnabled("ib_advanced", 1)) { wprintf("
  • " - "", _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat") diff --git a/webcit/roomops.c b/webcit/roomops.c index ec43959a8..e88f2db1a 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -3668,6 +3668,43 @@ void tmplput_roombanner(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void } +void tmplput_ungoto(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context) +{ + struct wcsession *WCC = WC; + + if ((WCC!=NULL) && + (!IsEmptyStr(WCC->ugname))) + StrBufAppendBufPlain(Target, WCC->ugname, -1, 0); +} + + +int ConditionalHaveUngoto(WCTemplateToken *Tokens, void *Context) +{ + struct wcsession *WCC = WC; + + return ((WCC!=NULL) && + (!IsEmptyStr(WCC->ugname)) && + (strcasecmp(WCC->ugname, WCC->wc_roomname) == 0)); +} + +int ConditinalRoomHasQRVisidir(WCTemplateToken *Tokens, void *Context) +{ + struct wcsession *WCC = WC; + + return ((WCC!=NULL) && + ((WCC->room_flags & QR_VISDIR) != 0)); +} + +int ConditionalHaveRoomeditRights(WCTemplateToken *Tokens, void *Context) +{ + struct wcsession *WCC = WC; + + return ( (WCC!= NULL) && + ((WCC->axlevel >= 6) || + (WCC->is_room_aide) || + (WCC->is_mailbox) )); +} + void InitModule_ROOMOPS (void) @@ -3697,7 +3734,11 @@ InitModule_ROOMOPS WebcitAddUrlHandler(HKEY("set_floordiv_expanded"), set_floordiv_expanded, NEED_URL|AJAX); WebcitAddUrlHandler(HKEY("changeview"), change_view, 0); RegisterNamespace("ROOMBANNER", 0, 0, tmplput_roombanner); + RegisterConditional(HKEY("COND:ROOM:FLAGS:QR_VISIDIR"), 0, ConditinalRoomHasQRVisidir); + RegisterConditional(HKEY("COND:UNGOTO"), 0, ConditionalHaveUngoto); + RegisterConditional(HKEY("COND:ROOM:EDITACCESS"), 0, ConditionalHaveRoomeditRights); + RegisterNamespace("ROOM:UNGOTO", 0, 0, tmplput_ungoto); } /*@}*/ diff --git a/webcit/static/t/display_main_menu.html b/webcit/static/t/display_main_menu.html new file mode 100644 index 000000000..4cac1cd90 --- /dev/null +++ b/webcit/static/t/display_main_menu.html @@ -0,0 +1,19 @@ + + + + +
    +
    + + + +
    + +
    + + + +
    +
    +
    + diff --git a/webcit/static/t/menu_advanced_roomcommands.html b/webcit/static/t/menu_advanced_roomcommands.html new file mode 100644 index 000000000..bc8bb7807 --- /dev/null +++ b/webcit/static/t/menu_advanced_roomcommands.html @@ -0,0 +1,9 @@ +
    diff --git a/webcit/static/t/menu_basic_commands.html b/webcit/static/t/menu_basic_commands.html new file mode 100644 index 000000000..79efe1372 --- /dev/null +++ b/webcit/static/t/menu_basic_commands.html @@ -0,0 +1,20 @@ + + + + + +  diff --git a/webcit/static/t/menu_your_info.html b/webcit/static/t/menu_your_info.html new file mode 100644 index 000000000..95b011e47 --- /dev/null +++ b/webcit/static/t/menu_your_info.html @@ -0,0 +1,10 @@ + diff --git a/webcit/static/t/subj_advanced_roomcommands.html b/webcit/static/t/subj_advanced_roomcommands.html new file mode 100644 index 000000000..7f5388e29 --- /dev/null +++ b/webcit/static/t/subj_advanced_roomcommands.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subj_basic_commands.html b/webcit/static/t/subj_basic_commands.html new file mode 100644 index 000000000..ce6ae2bff --- /dev/null +++ b/webcit/static/t/subj_basic_commands.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/subj_your_info.html b/webcit/static/t/subj_your_info.html new file mode 100644 index 000000000..9da9ca848 --- /dev/null +++ b/webcit/static/t/subj_your_info.html @@ -0,0 +1 @@ + -- 2.30.2