From 674537e1e68e694d1e8995e3bf29a20041c137d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 28 Feb 2010 10:32:19 +0000 Subject: [PATCH] * add COND:FLOOR:ISSUBROOM to detect whether the current room is on thet floor we're iterating --- webcit/roomlist.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- 2.39.2