Also removed the folder view. This will be redone as a better in-iconbar version later.
/*
* Lots of different room-related operations.
+ *
+ * Copyright (c) 1996-2011 by the citadel.org team
+ *
+ * This program is open source software. You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "webcit.h"
#include "webserver.h"
-
ConstStr QRFlagList[] = {
{HKEY(strof(QR_PERMANENT))},
{HKEY(strof(QR_INUSE))},
http_transmit_thing(ChrPtr(do_template("room_edit", NULL)), 0);
}
-/**
- * \brief Do either a known rooms list or a folders list, depending on the
- * user's preference
+/*
+ * Known rooms list (box style)
*/
void knrooms(void)
{
- StrBuf *ListView = NULL;
-
- /** Determine whether the user is trying to change views */
- if (havebstr("view")) {
- ListView = NewStrBufDup(SBSTR("view"));
- set_preference("roomlistview", ListView, 1);
- }
- /** Sanitize the input so its safe */
- if ((get_preference("roomlistview", &ListView) == 0)||
- (
- (strcasecmp(ChrPtr(ListView), "folders") != 0) &&
- (strcasecmp(ChrPtr(ListView), "rooms") != 0)
- )
- )
- {
- ListView = NewStrBufPlain(HKEY("rooms"));
- set_preference("roomlistview", ListView, 0);
- }
- url_do_template();
+ output_headers(1, 1, 1, 0, 0, 0);
+ do_template("knrooms", NULL);
+ wDumpContent(1);
}
_FlushRoomList (sess);
}
-
-/*@}*/
-<?=("head")>
-<?=("important_msg")><?%("COND:LOGGEDIN", 1, 1, 1, "", ="paging")>
-<div id="banner">
-<div class="banner" id="room_banner">
-<h1><?%("COND:PREF", 1, "roomlistview", "rooms", _("Room list"), "")><?%("COND:PREF", 1, "roomlistview", "folders", _("Folder list"), "")><?%("COND:PREF", 1, "roomlistview", "table", _("Room list"), "")></h1>
-</div>
-<?=("loggedinas")>
-<!-- offer the ability to switch views-->
-<div id="actiondiv">
-<ul class="room_actions">
-<li class="start_page">
-<?OFFERSTARTPAGE>
-</li>
-
- <li><form name="roomlistomatic">
- <select name="newview" size="1"
-OnChange="location.href=roomlistomatic.newview.options[selectedIndex].value">
-
-<option <?%("COND:PREF", 1, "roomlistview", "rooms", "SELECTED", "")> value="knrooms?view=rooms?template=knrooms?SortBy=byfloorroom?SortOrder=1"><?_("View as room list")></option>
-<option <?%("COND:PREF", 1, "roomlistview", "folders", "SELECTED", "")> value="knrooms?view=folders?template=knrooms?SortBy=byfloorroom?SortOrder=1"><?_("View as folder list")></option>
-<?%("COND:PREF", 1, "roomlistview", "table", "SELECTED", "")>
-</select>
-
-</form></li>
-</ul></div></div>
-
-<??("COND:PREF", 2, "roomlistview", "folders")>
<div id="content" class="service">
<table BORDER=0 WIDTH=96%% CELLPADDING=5>
<?ITERATE("LKRA", ="knrooms_rooms")>
</table>
-<??("X", 2)>
-
-<?!("COND:PREF", 3, "roomlistview", "folders")>
-<div id="content" class="service">
-<div class="box">
- <div class="boxlabel"><?_("Room Listing")></div>
- <div class="boxcontent">
- <div id="roomlist_knrooms"></div>
- </div>
-</div>
-<?!("X", 3)>
-<script type="text/javascript">
-FillRooms(KNRoomsRoomList);
-</script>
-<?=("trailing")>
-<?!("COND:ITERATE:FIRSTN", 1)><tr><td valign=top><?=("beginbox_1")><?ROOM:INFO:FLOOR:NAME><?=("beginbox_2")><?!("X", 1)>
-<?!("COND:ITERATE:ISGROUPCHANGE", 2)><?=("endbox")><br><?!("COND:ITERATE:ISGROUPCHANGE", 3, 2)></td><td valign=top> <?!("X", 3)><?=("beginbox_1")><?ROOM:INFO:FLOOR:NAME><?=("beginbox_2")><?!("X", 2)>
+<?!("COND:ITERATE:FIRSTN", 1)>
+ <tr><td valign=top><?=("beginbox_1")>
+ <?ROOM:INFO:FLOOR:NAME><?=("beginbox_2")>
+<?!("X", 1)>
+<?!("COND:ITERATE:ISGROUPCHANGE", 2)>
+ <?=("endbox")><br>
+ <?!("COND:ITERATE:ISGROUPCHANGE", 3, 2)>
+ </td><td valign=top>
+ <?!("X", 3)>
+ <?=("beginbox_1")>
+ <?ROOM:INFO:FLOOR:NAME><?=("beginbox_2")>
+<?!("X", 2)>
<a href="dotgoto?room=<?ROOM:INFO:NAME("U")>"><span class="<?%("COND:ROOM:FLAG:UA", 4, #"UA_HASNEWMSGS", 0, "roomlist_new", "roomlist_old")>">
-<?ROOM:INFO:LEVELNTIMES(" ")><?ROOM:INFO:BASENAME></span></a><?%("COND:ROOM:INFO:IS_INBOX", 5, 0, 0, _"(INBOX)", "")><br>
-<?!("COND:ITERATE:LASTN", 2)><?=("endbox")></td></tr><??("X", 3)>
+<?ROOM:INFO:LEVELNTIMES(" ")><?ROOM:INFO:BASENAME></span></a>
+<?%("COND:ROOM:INFO:IS_INBOX", 5, 0, 0, _"(INBOX)", "")><br>
+<?!("COND:ITERATE:LASTN", 2)>
+ <?=("endbox")></td></tr>
+<??("X", 2)>