Room info popup is now onMouseOver instead of onClick
[citadel.git] / webcit / roomtokens.c
1 /*
2  * Lots of different room-related operations.
3  */
4
5 #include "webcit.h"
6 #include "webserver.h"
7
8
9 /*
10  * Embed the room banner
11  *
12  * got                  The information returned from a GOTO server command
13  * navbar_style         Determines which navigation buttons to display
14  *
15  */
16 void tmplput_roombanner(StrBuf *Target, WCTemplputParams *TP)
17 {
18         wcsession *WCC = WC;
19         
20         /* refresh current room states... */
21         /* dosen't work??? gotoroom(NULL); */
22         wc_printf("<div id=\"banner\">\n");
23
24         /* The browser needs some information for its own use */
25         wc_printf("<script type=\"text/javascript\">    \n"
26                   "     room_is_trash = %d;             \n"
27                   "</script>\n",
28                   ((WC->CurRoom.RAFlags & UA_ISTRASH) != 0)
29                 );
30
31         /*
32          * If the user happens to select the "make this my start page" link,
33          * we want it to remember the URL as a "/dotskip" one instead of
34          * a "skip" or "gotonext" or something like that.
35          */
36         if (WCC->Hdr->this_page == NULL) {
37                 WCC->Hdr->this_page = NewStrBuf();
38         }
39         StrBufPrintf(WCC->Hdr->this_page, 
40                      "dotskip?room=%s",
41                      ChrPtr(WC->CurRoom.name)
42                 );
43
44         do_template("roombanner", NULL);
45         /* roombanner contains this for mobile */
46         if (WC->is_mobile)
47                 return;
48
49         do_template("navbar", NULL);
50         wc_printf("</div>\n");
51 }
52
53
54 /*******************************************************************************
55  ********************** FLOOR Tokens *******************************************
56  ******************************************************************************/
57 void tmplput_FLOOR_ID(StrBuf *Target, WCTemplputParams *TP) 
58 {
59         Floor *myFloor = (Floor *)CTX;
60
61         StrBufAppendPrintf(Target, "%d", myFloor->ID);
62 }
63 void tmplput_ROOM_FLOORID(StrBuf *Target, WCTemplputParams *TP) 
64 {
65         folder *Folder = (folder *)CTX;
66         StrBufAppendPrintf(Target, "%d", Folder->floorid);
67 }
68 void tmplput_ROOM_FLOOR_ID(StrBuf *Target, WCTemplputParams *TP) 
69 {
70         folder *Folder = (folder *)CTX;
71         const Floor *pFloor = Folder->Floor;
72
73         if (pFloor == NULL)
74                 return;
75
76         StrBufAppendPrintf(Target, "%d", pFloor->ID);
77 }
78
79 void tmplput_ROOM_FLOOR_NAME(StrBuf *Target, WCTemplputParams *TP) 
80 {
81         folder *Folder = (folder *)CTX;
82         const Floor *pFloor = Folder->Floor;
83
84         if (pFloor == NULL)
85                 return;
86
87         StrBufAppendTemplate(Target, TP, pFloor->Name, 0);
88 }
89 void tmplput_ThisRoomFloorName(StrBuf *Target, WCTemplputParams *TP) 
90 {
91         wcsession *WCC = WC;
92         folder *Folder = &WCC->CurRoom;
93         const Floor *pFloor;
94
95         if (Folder == NULL)
96                 return;
97
98         pFloor = Folder->Floor;
99         if (pFloor == NULL)
100                 return;
101
102         StrBufAppendTemplate(Target, TP, pFloor->Name, 0);
103 }
104 void tmplput_FLOOR_NAME(StrBuf *Target, WCTemplputParams *TP) 
105 {
106         Floor *myFloor = (Floor *)CTX;
107
108         StrBufAppendTemplate(Target, TP, myFloor->Name, 0);
109 }
110
111 void tmplput_FLOOR_NROOMS(StrBuf *Target, WCTemplputParams *TP) 
112 {
113         Floor *myFloor = (Floor *)CTX;
114
115         StrBufAppendPrintf(Target, "%d", myFloor->NRooms);
116 }
117 void tmplput_ROOM_FLOOR_NROOMS(StrBuf *Target, WCTemplputParams *TP) 
118 {
119         folder *Folder = (folder *)CTX;
120         const Floor *pFloor = Folder->Floor;
121
122         if (pFloor == NULL)
123                 return;
124         StrBufAppendPrintf(Target, "%d", pFloor->NRooms);
125 }
126 int ConditionalFloorHaveNRooms(StrBuf *Target, WCTemplputParams *TP)
127 {
128         Floor *MyFloor = (Floor *)CTX;
129         int HaveN;
130
131         HaveN = GetTemplateTokenNumber(Target, TP, 0, 0);
132
133         return HaveN == MyFloor->NRooms;
134 }
135
136 int ConditionalFloorIsRESTSubFloor(StrBuf *Target, WCTemplputParams *TP)
137 {
138         wcsession  *WCC = WC;
139         Floor *MyFloor = (Floor *)CTX;
140         /** if we have dav_depth the client just wants the subfloors */
141         if ((WCC->Hdr->HR.dav_depth == 1) && 
142             (GetCount(WCC->Directory) == 0))
143                 return 1;
144         return WCC->CurrentFloor == MyFloor;
145 }
146 int ConditionalFloorIsSUBROOM(StrBuf *Target, WCTemplputParams *TP)
147 {
148         wcsession  *WCC = WC;
149         Floor *MyFloor = (Floor *)CTX;
150
151         return WCC->CurRoom.floorid == MyFloor->ID;
152 }
153
154
155 int ConditionalFloorIsVirtual(StrBuf *Target, WCTemplputParams *TP)
156 {
157         Floor *MyFloor = (Floor *)CTX;
158
159         return MyFloor->ID == VIRTUAL_MY_FLOOR;
160 }
161
162
163
164 /*******************************************************************************
165  ********************** ROOM Tokens ********************************************
166  ******************************************************************************/
167 /**** Name ******/
168 void tmplput_RoomName(StrBuf *Target, WCTemplputParams *TP)
169 {
170         StrBufAppendTemplate(Target, TP, WC->CurRoom.name, 0);
171 }
172 void tmplput_current_room(StrBuf *Target, WCTemplputParams *TP)
173 {
174         wcsession *WCC = WC;
175
176         if (WCC != NULL)
177                 StrBufAppendTemplate(Target, TP, 
178                                      WCC->CurRoom.name, 
179                                      0); 
180 }
181 void tmplput_ROOM_NAME(StrBuf *Target, WCTemplputParams *TP) 
182 {
183         folder *Folder = (folder *)CTX;
184
185         if (Folder == NULL)
186         {
187                 wcsession *WCC = WC;
188
189                 if (WCC == NULL)
190                         return;
191                 Folder = &WCC->CurRoom;
192         }
193         StrBufAppendTemplate(Target, TP, Folder->name, 0);
194 }
195 void tmplput_ROOM_BASENAME(StrBuf *Target, WCTemplputParams *TP) 
196 {
197         folder *room = (folder *)CTX;
198
199         if (room->nRoomNameParts > 1)
200                 StrBufAppendTemplate(Target, TP, 
201                                       room->RoomNameParts[room->nRoomNameParts - 1], 0);
202         else 
203                 StrBufAppendTemplate(Target, TP, room->name, 0);
204 }
205 void tmplput_ROOM_LEVEL_N_TIMES(StrBuf *Target, WCTemplputParams *TP) 
206 {
207         folder *room = (folder *)CTX;
208         int i;
209         const char *AppendMe;
210         long AppendMeLen;
211
212
213         if (room->nRoomNameParts > 1)
214         {
215                 GetTemplateTokenString(Target, TP, 0, &AppendMe, &AppendMeLen);
216                 for (i = 0; i < room->nRoomNameParts; i++)
217                         StrBufAppendBufPlain(Target, AppendMe, AppendMeLen, 0);
218         }
219 }
220 int ConditionalRoomIsInbox(StrBuf *Target, WCTemplputParams *TP)
221 {
222         folder *Folder = (folder *)CTX;
223         return Folder->is_inbox;
224 }
225
226 /****** Properties ******/
227 int ConditionalThisRoomHas_QRFlag(StrBuf *Target, WCTemplputParams *TP)
228 {
229         long QR_CheckFlag;
230         wcsession *WCC = WC;
231         
232         QR_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
233         if (QR_CheckFlag == 0)
234                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
235                                  "requires one of the #\"QR*\"- defines or an integer flag 0 is invalid!");
236         
237         if (WCC == NULL)
238                 return 0;
239
240         if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
241             (TP->Tokens->Params[2]->MaskBy == eNO))
242                 return (WCC->CurRoom.QRFlags & QR_CheckFlag) != 0;
243         else
244                 return (WCC->CurRoom.QRFlags & QR_CheckFlag) == QR_CheckFlag;
245 }
246 int ConditionalRoomHas_QRFlag(StrBuf *Target, WCTemplputParams *TP)
247 {
248         long QR_CheckFlag;
249         folder *Folder = (folder *)(TP->Context);
250
251         QR_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
252         if (QR_CheckFlag == 0)
253                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
254                                  "requires one of the #\"QR*\"- defines or an integer flag 0 is invalid!");
255
256         if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
257             (TP->Tokens->Params[2]->MaskBy == eNO))
258                 return (Folder->QRFlags & QR_CheckFlag) != 0;
259         else
260                 return (Folder->QRFlags & QR_CheckFlag) == QR_CheckFlag;
261 }
262 void tmplput_ROOM_QRFLAGS(StrBuf *Target, WCTemplputParams *TP) 
263 {
264         folder *Folder = (folder *)CTX;
265         StrBufAppendPrintf(Target, "%d", Folder->QRFlags);
266 }
267
268
269 int ConditionalThisRoomHas_QRFlag2(StrBuf *Target, WCTemplputParams *TP)
270 {
271         long QR2_CheckFlag;
272         wcsession *WCC = WC;
273         
274         QR2_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
275         if (QR2_CheckFlag == 0)
276                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
277                                  "requires one of the #\"QR2*\"- defines or an integer flag 0 is invalid!");
278
279         
280         if (WCC == NULL)
281                 return 0;
282
283         if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
284             (TP->Tokens->Params[2]->MaskBy == eNO))
285                 return (WCC->CurRoom.QRFlags2 & QR2_CheckFlag) != 0;
286         else
287                 return (WCC->CurRoom.QRFlags2 & QR2_CheckFlag) == QR2_CheckFlag;
288 }
289 int ConditionalRoomHas_QRFlag2(StrBuf *Target, WCTemplputParams *TP)
290 {
291         long QR2_CheckFlag;
292         folder *Folder = (folder *)(TP->Context);
293
294         QR2_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
295         if (QR2_CheckFlag == 0)
296                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
297                                  "requires one of the #\"QR2*\"- defines or an integer flag 0 is invalid!");
298         return ((Folder->QRFlags2 & QR2_CheckFlag) != 0);
299 }
300
301 int ConditionalRoomHas_UAFlag(StrBuf *Target, WCTemplputParams *TP)
302 {
303         folder *Folder = (folder *)(TP->Context);
304         long UA_CheckFlag;
305                 
306         UA_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
307         if (UA_CheckFlag == 0)
308                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
309                                  "requires one of the #\"UA_*\"- defines or an integer flag 0 is invalid!");
310
311         return ((Folder->RAFlags & UA_CheckFlag) != 0);
312 }
313
314
315
316
317
318 void tmplput_ROOM_ACL(StrBuf *Target, WCTemplputParams *TP) 
319 {
320         folder *Folder = (folder *)CTX;
321
322         StrBufAppendPrintf(Target, "%ld", Folder->RAFlags, 0);
323 }
324
325
326
327 void tmplput_ROOM_RAFLAGS(StrBuf *Target, WCTemplputParams *TP) 
328 {
329         folder *Folder = (folder *)(TP->Context);
330         StrBufAppendPrintf(Target, "%d", Folder->RAFlags);
331 }
332
333
334 void tmplput_ThisRoomAide(StrBuf *Target, WCTemplputParams *TP) 
335 {
336         wcsession *WCC = WC;
337
338         LoadRoomAide();
339
340         StrBufAppendTemplate(Target, TP, WCC->CurRoom.RoomAide, 0);
341 }
342 int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
343 {
344         wcsession *WCC = WC;
345         return (WCC != NULL)? 
346                 ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) : 0;
347 }
348
349 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
350 {
351         wcsession *WCC = WC;
352         return (WCC == NULL)? 0 : 
353                 ( ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
354                    (WCC->CurRoom.is_inbox) || 
355                    (WCC->CurRoom.QRFlags2 & QR2_COLLABDEL) );
356 }
357
358
359
360 int ConditionalHaveRoomeditRights(StrBuf *Target, WCTemplputParams *TP)
361 {
362         wcsession *WCC = WC;
363
364         return ( (WCC!= NULL) && 
365                  ((WCC->axlevel >= 6) || 
366                   ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
367                   (WCC->CurRoom.is_inbox) ));
368 }
369 void tmplput_ThisRoomPass(StrBuf *Target, WCTemplputParams *TP) 
370 {
371         wcsession *WCC = WC;
372
373         LoadRoomXA();
374
375         StrBufAppendTemplate(Target, TP, WCC->CurRoom.XAPass, 0);
376 }
377
378
379
380
381
382
383 void tmplput_ThisRoom_nNewMessages(StrBuf *Target, WCTemplputParams *TP) 
384 {
385         wcsession *WCC = WC;
386
387         StrBufAppendPrintf(Target, "%d", WCC->CurRoom.nNewMessages);
388 }
389
390 void tmplput_ThisRoom_nTotalMessages(StrBuf *Target, WCTemplputParams *TP) 
391 {
392         wcsession *WCC = WC;
393
394         StrBufAppendPrintf(Target, "%d", WCC->CurRoom.nTotalMessages);
395 }
396
397
398
399
400
401
402 void tmplput_ThisRoomOrder(StrBuf *Target, WCTemplputParams *TP) 
403 {
404         wcsession *WCC = WC;
405
406         LoadRoomXA();
407
408         StrBufAppendPrintf(Target, "%d", WCC->CurRoom.Order);
409 }
410
411 int ConditionalThisRoomOrder(StrBuf *Target, WCTemplputParams *TP)
412 {
413         wcsession *WCC = WC;
414         long CheckThis;
415
416         if (WCC == NULL)
417                 return 0;
418
419         LoadRoomXA();
420
421         CheckThis = GetTemplateTokenNumber(Target, TP, 2, 0);
422         return CheckThis == WCC->CurRoom.Order;
423 }
424
425 void tmplput_ROOM_LISTORDER(StrBuf *Target, WCTemplputParams *TP) 
426 {
427         folder *Folder = (folder *)CTX;
428         StrBufAppendPrintf(Target, "%d", Folder->Order);
429 }
430
431
432
433
434
435 int ConditionalThisRoomXHavePic(StrBuf *Target, WCTemplputParams *TP)
436 {
437         wcsession *WCC = WC;
438         
439         if (WCC == NULL)
440                 return 0;
441
442         LoadXRoomPic();
443         return WCC->CurRoom.XHaveRoomPic == 1;
444 }
445
446
447 int ConditionalThisRoomXHaveInfoText(StrBuf *Target, WCTemplputParams *TP)
448 {
449         wcsession *WCC = WC;
450         
451         if (WCC == NULL)
452                 return 0;
453
454         LoadXRoomInfoText();
455         return (StrLength(WCC->CurRoom.XInfoText)>0);
456 }
457 void tmplput_ThisRoomInfoText(StrBuf *Target, WCTemplputParams *TP) 
458 {
459         wcsession *WCC = WC;
460         long nchars = 0;
461
462         LoadXRoomInfoText();
463
464         nchars = GetTemplateTokenNumber(Target, TP, 0, 0);
465         if (!nchars) {
466                 /* the whole thing */
467                 StrBufAppendTemplate(Target, TP, WCC->CurRoom.XInfoText, 1);
468         }
469         else {
470                 /* only a certain number of characters */
471                 StrBuf *SubBuf;
472                 SubBuf = NewStrBufDup(WCC->CurRoom.XInfoText);
473                 if (StrLength(SubBuf) > nchars) {
474                         StrBuf_Utf8StrCut(SubBuf, nchars);
475                         StrBufAppendBufPlain(SubBuf, HKEY("..."), 0);
476                 }
477                 StrBufAppendTemplate(Target, TP, SubBuf, 1);
478                 FreeStrBuf(&SubBuf);
479         }
480 }
481
482
483
484
485
486
487 void tmplput_ROOM_LASTCHANGE(StrBuf *Target, WCTemplputParams *TP) 
488 {
489         folder *Folder = (folder *)CTX;
490         StrBufAppendPrintf(Target, "%d", Folder->lastchange);
491 }
492
493
494
495
496
497
498
499
500 void tmplput_ThisRoomDirectory(StrBuf *Target, WCTemplputParams *TP) 
501 {
502         wcsession *WCC = WC;
503
504         LoadRoomXA();
505
506         StrBufAppendTemplate(Target, TP, WCC->CurRoom.Directory, 0);
507 }
508 void tmplput_ThisRoomXNFiles(StrBuf *Target, WCTemplputParams *TP) 
509 {
510         wcsession *WCC = WC;
511
512         LoadXRoomXCountFiles();
513
514         StrBufAppendPrintf(Target, "%d", WCC->CurRoom.XDownloadCount);
515 }
516
517 void tmplput_ThisRoomX_FileString(StrBuf *Target, WCTemplputParams *TP) 
518 {
519         wcsession *WCC = WC;
520
521         LoadXRoomXCountFiles();
522
523         if (WCC->CurRoom.XDownloadCount == 1)
524                 StrBufAppendBufPlain(Target, _("file"), -1, 0);
525         else
526                 StrBufAppendBufPlain(Target, _("files"), -1, 0);
527 }
528
529
530 void 
531 InitModule_ROOMTOKENS
532 (void)
533 {
534         RegisterNamespace("ROOMBANNER", 0, 1, tmplput_roombanner, NULL, CTX_NONE);
535
536         RegisterNamespace("FLOOR:ID", 0, 0, tmplput_FLOOR_ID, NULL, CTX_FLOORS);
537         RegisterNamespace("ROOM:INFO:FLOORID", 0, 1, tmplput_ROOM_FLOORID, NULL, CTX_ROOMS);
538         RegisterNamespace("ROOM:INFO:FLOOR:ID", 0, 0, tmplput_ROOM_FLOOR_ID, NULL, CTX_ROOMS);
539
540         RegisterNamespace("FLOOR:NAME", 0, 1, tmplput_FLOOR_NAME, NULL, CTX_FLOORS);
541         RegisterNamespace("ROOM:INFO:FLOOR:NAME", 0, 1, tmplput_ROOM_FLOOR_NAME, NULL, CTX_ROOMS);
542         RegisterNamespace("THISROOM:FLOOR:NAME", 0, 1, tmplput_ThisRoomFloorName, NULL, CTX_NONE);
543
544         RegisterNamespace("FLOOR:NROOMS", 0, 0, tmplput_FLOOR_NROOMS, NULL, CTX_FLOORS);
545         RegisterNamespace("ROOM:INFO:FLOOR:NROOMS", 0, 0, tmplput_ROOM_FLOOR_NROOMS, NULL, CTX_ROOMS);
546
547         RegisterConditional(HKEY("COND:FLOOR:ISSUBROOM"), 0, ConditionalFloorIsSUBROOM, CTX_FLOORS);
548         RegisterConditional(HKEY("COND:FLOOR:NROOMS"), 1, ConditionalFloorHaveNRooms, CTX_FLOORS);
549         RegisterConditional(HKEY("COND:ROOM:REST:ISSUBFLOOR"), 0, ConditionalFloorIsRESTSubFloor, CTX_FLOORS);
550         RegisterConditional(HKEY("COND:FLOOR:ISVIRTUAL"), 0, ConditionalFloorIsVirtual, CTX_FLOORS);
551
552         /**** Room... ******/
553         /**** Name ******/
554         RegisterNamespace("ROOMNAME", 0, 1, tmplput_RoomName, NULL, CTX_NONE);
555         RegisterNamespace("CURRENT_ROOM", 0, 1, tmplput_current_room, NULL, CTX_NONE);
556         RegisterNamespace("ROOM:INFO:NAME", 0, 1, tmplput_ROOM_NAME, NULL, CTX_ROOMS);
557         RegisterNamespace("ROOM:INFO:PRINT_NAME", 0, 1, tmplput_ROOM_NAME, NULL, CTX_NONE);
558         RegisterNamespace("ROOM:INFO:BASENAME", 0, 1, tmplput_ROOM_BASENAME, NULL, CTX_ROOMS);
559         RegisterNamespace("ROOM:INFO:LEVELNTIMES", 1, 2, tmplput_ROOM_LEVEL_N_TIMES, NULL, CTX_ROOMS);
560         RegisterConditional(HKEY("COND:ROOM:INFO:IS_INBOX"), 0, ConditionalRoomIsInbox, CTX_ROOMS);
561
562         /****** Properties ******/
563         RegisterNamespace("ROOM:INFO:QRFLAGS", 0, 1, tmplput_ROOM_QRFLAGS, NULL, CTX_ROOMS);
564         RegisterConditional(HKEY("COND:THISROOM:FLAG:QR"), 0, ConditionalThisRoomHas_QRFlag, CTX_NONE);
565         RegisterConditional(HKEY("COND:ROOM:FLAG:QR"), 0, ConditionalRoomHas_QRFlag, CTX_ROOMS);
566
567         RegisterConditional(HKEY("COND:THISROOM:FLAG:QR2"), 0, ConditionalThisRoomHas_QRFlag2, CTX_NONE);
568         RegisterConditional(HKEY("COND:ROOM:FLAG:QR2"), 0, ConditionalRoomHas_QRFlag2, CTX_ROOMS);
569
570         RegisterConditional(HKEY("COND:ROOM:FLAG:UA"), 0, ConditionalRoomHas_UAFlag, CTX_ROOMS);
571         RegisterNamespace("ROOM:INFO:RAFLAGS", 0, 1, tmplput_ROOM_RAFLAGS, NULL, CTX_ROOMS);
572
573
574         RegisterNamespace("ROOM:INFO:LISTORDER", 0, 1, tmplput_ROOM_LISTORDER, NULL, CTX_ROOMS);
575         RegisterNamespace("THISROOM:ORDER", 0, 0, tmplput_ThisRoomOrder, NULL, CTX_NONE);
576         RegisterConditional(HKEY("COND:THISROOM:ORDER"), 0, ConditionalThisRoomOrder, CTX_NONE);
577
578         RegisterNamespace("ROOM:INFO:LASTCHANGE", 0, 1, tmplput_ROOM_LASTCHANGE, NULL, CTX_ROOMS);
579
580         RegisterNamespace("THISROOM:MSGS:NEW", 0, 0, tmplput_ThisRoom_nNewMessages, NULL, CTX_NONE);
581         RegisterNamespace("THISROOM:MSGS:TOTAL", 0, 0, tmplput_ThisRoom_nTotalMessages, NULL, CTX_NONE);
582
583         RegisterNamespace("THISROOM:PASS", 0, 1, tmplput_ThisRoomPass, NULL, CTX_NONE);
584         RegisterNamespace("THISROOM:AIDE", 0, 1, tmplput_ThisRoomAide, NULL, CTX_NONE);
585         RegisterConditional(HKEY("COND:ROOMAIDE"), 2, ConditionalRoomAide, CTX_NONE);
586         RegisterConditional(HKEY("COND:ACCESS:DELETE"), 2, ConditionalRoomAcessDelete, CTX_NONE);
587         RegisterConditional(HKEY("COND:ROOM:EDITACCESS"), 0, ConditionalHaveRoomeditRights, CTX_NONE);
588
589         RegisterConditional(HKEY("COND:THISROOM:HAVE_PIC"), 0, ConditionalThisRoomXHavePic, CTX_NONE);
590
591         RegisterNamespace("THISROOM:INFOTEXT", 1, 2, tmplput_ThisRoomInfoText, NULL, CTX_NONE);
592         RegisterConditional(HKEY("COND:THISROOM:HAVE_INFOTEXT"), 0, ConditionalThisRoomXHaveInfoText, CTX_NONE);
593
594         RegisterNamespace("THISROOM:FILES:N", 0, 1, tmplput_ThisRoomXNFiles, NULL, CTX_NONE);
595         RegisterNamespace("THISROOM:FILES:STR", 0, 1, tmplput_ThisRoomX_FileString, NULL, CTX_NONE);
596         RegisterNamespace("THISROOM:DIRECTORY", 0, 1, tmplput_ThisRoomDirectory, NULL, CTX_NONE);
597
598
599
600
601
602
603         RegisterNamespace("ROOM:INFO:ACL", 0, 1, tmplput_ROOM_ACL, NULL, CTX_ROOMS);
604 }