diff options
author | msquare <msquare@notrademark.de> | 2017-12-10 15:02:37 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2017-12-10 15:02:37 +0100 |
commit | 4143680297808dd23fe03b121f28ad5183601b8b (patch) | |
tree | 75d8c819afd4590d0d792200a6d906c7957b63dc /includes/model/Room_model.php | |
parent | ef0dbe8a1bd80fb9bec0400e84550df02f138dbd (diff) |
remove room number and visible flag, rename pentabarf to frab and introduce map/c3nav integration as well as markdown description for rooms
Diffstat (limited to 'includes/model/Room_model.php')
-rw-r--r-- | includes/model/Room_model.php | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php index 74a08be4..79536e93 100644 --- a/includes/model/Room_model.php +++ b/includes/model/Room_model.php @@ -5,12 +5,11 @@ use Engelsystem\Database\DB; /** * returns a list of rooms. * - * @param boolean $show_all returns also hidden rooms when true * @return array */ -function Rooms($show_all = false) +function Rooms() { - return DB::select('SELECT * FROM `Room`' . ($show_all ? '' : ' WHERE `show`=\'Y\'') . ' ORDER BY `Name`'); + return DB::select('SELECT * FROM `Room` ORDER BY `Name`'); } /** @@ -39,21 +38,21 @@ function Room_delete($room_id) * * @param string $name Name of the room * @param boolean $from_frab Is this a frab imported room? - * @param boolean $public Is the room visible for angels? - * @param int $number Room number + * @param string $map_url URL to a map tha can be displayed in an iframe + * @param description markdown description * @return false|int */ -function Room_create($name, $from_frab, $public, $number = null) +function Room_create($name, $from_frab, $map_url, $description) { DB::insert(' - INSERT INTO `Room` (`Name`, `FromPentabarf`, `show`, `Number`) + INSERT INTO `Room` (`Name`, `from_frab`, `map_url`, `description`) VALUES (?, ?, ?, ?) ', [ $name, - $from_frab ? 'Y' : '', - $public ? 'Y' : '', - (int)$number, + (int) $from_frab, + $map_url, + $description, ] ); @@ -67,13 +66,12 @@ function Room_create($name, $from_frab, $public, $number = null) * @param bool $onlyVisible * @return array|false */ -function Room($room_id, $onlyVisible = true) +function Room($room_id) { return DB::selectOne(' SELECT * FROM `Room` - WHERE `RID` = ? - ' . ($onlyVisible ? 'AND `show` = \'Y\'' : ''), + WHERE `RID` = ?', [$room_id] ); } |