From: Wilfried Göesgens Date: Sun, 28 Feb 2010 10:32:19 +0000 (+0000) Subject: * add COND:FLOOR:ISSUBROOM to detect whether the current room is on thet floor we... X-Git-Tag: v7.86~363 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=674537e1e68e694d1e8995e3bf29a20041c137d5 * add COND:FLOOR:ISSUBROOM to detect whether the current room is on thet floor we're iterating --- diff --git a/webcit/roomlist.c b/webcit/roomlist.c index 9b00be970..72335f525 100644 --- a/webcit/roomlist.c +++ b/webcit/roomlist.c @@ -716,6 +716,15 @@ int ConditionalFloorIsRESTSubFloor(StrBuf *Target, WCTemplputParams *TP) } +int ConditionalFloorIsSUBROOM(StrBuf *Target, WCTemplputParams *TP) +{ + wcsession *WCC = WC; + Floor *MyFloor = (Floor *)CTX; + + return WCC->CurRoom.floorid == MyFloor->ID; +} + + int ConditionalRoomIsRESTSubRoom(StrBuf *Target, WCTemplputParams *TP) { wcsession *WCC = WC; @@ -831,6 +840,7 @@ InitModule_ROOMLIST RegisterNamespace("FLOOR:ID", 0, 0, tmplput_FLOOR_ID, NULL, CTX_FLOORS); RegisterNamespace("FLOOR:NAME", 0, 1, tmplput_FLOOR_NAME, NULL, CTX_FLOORS); RegisterNamespace("FLOOR:NROOMS", 0, 0, tmplput_FLOOR_NROOMS, NULL, CTX_FLOORS); + RegisterConditional(HKEY("COND:FLOOR:ISSUBROOM"), 0, ConditionalFloorIsSUBROOM, CTX_FLOORS); RegisterConditional(HKEY("COND:ROOM:REST:ISSUBFLOOR"), 0, ConditionalFloorIsRESTSubFloor, CTX_FLOORS); RegisterIterator("ITERATE:THISROOM:GNET", 1, NULL, GetNetConfigHash, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG);