* use the right toknes...
* use LFLR
* fix comment token function
return WCC->CurrentFloor == MyFloor;
}
return WCC->CurrentFloor == MyFloor;
}
+int ConditionalFloorHaveNRooms(StrBuf *Target, WCTemplputParams *TP)
+{
+ Floor *MyFloor = (Floor *)CTX;
+ int HaveN;
+
+ HaveN = GetTemplateTokenNumber(Target, TP, 0, 0);
+
+ return HaveN == MyFloor->NRooms;
+}
+
int ConditionalFloorIsVirtual(StrBuf *Target, WCTemplputParams *TP)
{
Floor *MyFloor = (Floor *)CTX;
int ConditionalFloorIsVirtual(StrBuf *Target, WCTemplputParams *TP)
{
Floor *MyFloor = (Floor *)CTX;
RegisterNamespace("FLOOR:NROOMS", 0, 0, tmplput_FLOOR_NROOMS, NULL, CTX_FLOORS);
RegisterConditional(HKEY("COND:FLOOR:ISSUBROOM"), 0, ConditionalFloorIsSUBROOM, CTX_FLOORS);
RegisterConditional(HKEY("COND:FLOOR:ISVIRTUAL"), 0, ConditionalFloorIsVirtual, 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:FLOOR:ISVIRTUAL"), 0, ConditionalFloorIsVirtual, CTX_FLOORS);
+ RegisterConditional(HKEY("COND:FLOOR:NROOMS"), 1, ConditionalFloorHaveNRooms, CTX_FLOORS);
RegisterConditional(HKEY("COND:ROOM:REST:ISSUBFLOOR"), 0, ConditionalFloorIsRESTSubFloor, CTX_FLOORS);
RegisterIterator("ITERATE:THISROOM:GNET", 1, NULL, GetNetConfigHash, NULL, NULL, CTX_STRBUFARR, CTX_NONE, IT_NOFLAG);
RegisterConditional(HKEY("COND:ROOM:REST:ISSUBFLOOR"), 0, ConditionalFloorIsRESTSubFloor, CTX_FLOORS);
RegisterIterator("ITERATE:THISROOM:GNET", 1, NULL, GetNetConfigHash, NULL, NULL, CTX_STRBUFARR, CTX_NONE, IT_NOFLAG);
+<?=("head")><?=("important_msg")><?%("COND:LOGGEDIN", 1, 1, 1, "", ="paging")>
<div id="banner">
<h1><?_("Add/change/delete floors")></h1>
</div>
<div id="banner">
<h1><?_("Add/change/delete floors")></h1>
</div>
-<div class="fix_scrollbar_bug">
- <table border="1" width="100%" bgcolor="#fff">
+<div id="content" class="service fix_scrollbar_bug">
+ <table border="1" width="100%" bgcolor="#ffffff">
<tr>
<th><?_("Floor number")></th>
<th><?_("Floor name")></th>
<tr>
<th><?_("Floor number")></th>
<th><?_("Floor name")></th>
<th><?_("Floor CSS")></th>
</tr>
<th><?_("Floor CSS")></th>
</tr>
- <?ITERATE("LKRA", ="floors_edit_one")>
+ <?ITERATE("LFLR", ="floors_edit_one")>
-<!--("Subtemplate to edit a single floor, called as ITERATION by floors.html")-->
+<?--("Subtemplate to edit a single floor, called as ITERATION by floors.html")>
+<??("COND:FLOOR:ISVIRTUAL", 1)>
<tr>
<td>
<table border="0">
<tr>
<tr>
<td>
<table border="0">
<tr>
- <td><?FLOORNUM>
- <?!("COND:FLOOR:RECFOUNT",20,0)>
+ <td><?FLOOR:ID>
+ <?!("COND:FLOOR:NROOMS",20,0)>
- <a href="delete_floor?floornum=<?FLOORNUM>" style="font-size: -1"><?_("(delete floor)")></a><br>
+ <a href="delete_floor?floornum=<?FLOOR:ID>" style="font-size: -1"><?_("(delete floor)")></a><br>
- <a href="display_editfloorpic?which_floor=<?FLOORNUM>" style="font-size: -1"><?_("(edit graphic)")></a>
+ <a href="display_editfloorpic?which_floor=<?FLOOR:ID>" style="font-size: -1"><?_("(edit graphic)")></a>
</td>
</tr>
</table>
</td>
<td>
<form method="post" action="rename_floor">
</td>
</tr>
</table>
</td>
<td>
<form method="post" action="rename_floor">
- <input type="hidden" name="floornum" value="<?FLOORNUM>">
- <input type="text" name="floorname" value="<?FLOORNAME>" maxlength="250">
+ <input type="hidden" name="floornum" value="<?FLOOR:ID>">
+ <input type="text" name="floorname" value="<?FLOOR:NAME>" maxlength="250">
<input type="hidden" name="nonce" value="<?NONCE>">
<input type="submit" name="sc" value="<?_("Change name")>">
</form>
</td>
<input type="hidden" name="nonce" value="<?NONCE>">
<input type="submit" name="sc" value="<?_("Change name")>">
</form>
</td>
+ <td><?FLOOR:NROOMS></td>
<td>
<form method="post" action="set_floor_css">
<td>
<form method="post" action="set_floor_css">
- <input type="hidden" name="floornum" value="<?FLOORNUM>">
- <input type="text" name="floorcss" value="<?FLOORNAME>" maxlength="250">
+ <input type="hidden" name="floornum" value="<?FLOOR:ID>">
+ <input type="text" name="floorcss" value="<?FLOOR:NAME>" maxlength="250">
<input type="hidden" name="nonce" value="<?NONCE>">
<input type="submit" name="sc" value="<?_("Change CSS")>">
</form>
</td>
</tr>
<input type="hidden" name="nonce" value="<?NONCE>">
<input type="submit" name="sc" value="<?_("Change CSS")>">
</form>
</td>
</tr>
const char *pch;
long len;
const char *pch;
long len;
- GetTemplateTokenString(Target, TP, 2, &pch, &len);
+ GetTemplateTokenString(Target, TP, 0, &pch, &len);
Comment = NewStrBufPlain(pch, len);
Comment = NewStrBufPlain(pch, len);
+ StrBufAppendBufPlain(Target, HKEY("<!--"), 0);
StrBufAppendTemplate(Target, TP, Comment, 1);
StrBufAppendTemplate(Target, TP, Comment, 1);
+ StrBufAppendBufPlain(Target, HKEY("-->"), 0);
FreeStrBuf(&Comment);
}
}
FreeStrBuf(&Comment);
}
}