/** * Give the preview information about a room given * * @param $roomid : the id of the room * @return an array with the key as the name of the attribute * and the value as the value of the attribute */ function lcapi_get_room_preview($roomid) { $roominfo = array(); $params = "&filter00=" . LCAPI_ATTR_CLASSID . "&filter00value=" . $this->prefix . $roomid . "&attribute=" . LCAPI_ATTR_PREVIEW; $response = $this->lcapi_send_query(LCAPI_FUNCTION_GET_ROOM_LIST, $params); preg_match("(\\d*)", $response, $matches); $respcode = $matches[0]; if ($respcode != 100) { // $this->lcapi_error(self::LCAPIEQRY); wimba_add_log(WIMBA_ERROR, WC, __FUNCTION__ . ": cannot query room info for {$roomid}"); return false; } list(, $body) = explode("\n", $response, 2); $records = explode(LCAPI_RECORD_SEPARATOR, $body); $lines = explode("\n", $records[0]); foreach ($lines as $line) { if (!empty($line)) { list($key, $value) = explode("=", $line); if (!empty($key)) { $roominfo[$key] = $value; } } } $room = new LCRoom(); $room->setByRecord($roominfo, $this->prefix); wimba_add_log(WIMBA_DEBUG, WC, __FUNCTION__ . ": returning room availability for {$roomid}: " . print_r($roominfo, true)); return $room->isPreview(); }
function setRoomPreview($roomId, $preview) { $room = new LCRoom(); $room->setPreview($preview); $this->api->lcapi_modify_room($roomId, $room->getAttributes()); }