status/include/Responder.php

41 lines
1.0 KiB
PHP

<?php
require_once("functions.php");
require_once("WikiImport.php");
class Responder {
private $import;
public function __construct() {
$this->import = new WikiImport();
}
public function get_all_rooms() {
$roomlist = $this->import->get_roomlist();
$roomdata_list = array();
foreach($roomlist as $room) {
$roomdata = $this->import->get_roomdata($room);
$roomdata = $this->import->trim_extra_tags($roomdata);
$roomdata_list[$room] = $roomdata;
}
return json_encode($roomdata_list);
}
public function get_problem_rooms() {
$roomlist = $this->import->get_roomlist();
$roomdata_list = array();
foreach($roomlist as $room) {
$roomdata = $this->import->get_roomdata($room);
$roomdata = $this->import->trim_extra_tags($roomdata);
if($roomdata) {
$roomdata_list[$room] = $roomdata;
}
}
return json_encode($roomdata_list);
}
}
?>