summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php35
1 files changed, 33 insertions, 2 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
index b8aa44a0..482ca097 100644
--- a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
@@ -2,6 +2,15 @@
class Coursebackend_Dummy extends CourseBackend {
private $pw;
+ /**
+ * uses json to setCredentials, the json must follow the form given in
+ * getCredentials
+ *
+ * @param array $data with the credentials
+ * @param string $url address of the server
+ * @param int $serverID ID of the server
+ * @returns bool if the credentials were in the correct format
+ */
public function setCredentials($json,$location,$serverID) {
$x = $json;
$this->pw = $x['password'];
@@ -16,6 +25,9 @@ class Coursebackend_Dummy extends CourseBackend {
}
}
+ /**
+ * @return boolean true if the connection works, false otherwise
+ */
public function checkConnection(){
if ($this->pw == "mfg") {
$this->error = false;
@@ -27,24 +39,43 @@ class Coursebackend_Dummy extends CourseBackend {
}
}
+ /**
+ * @returns array with parameter name as key and and an array with type, help text and mask as value
+ */
public function getCredentials(){
$options = ["opt1", "opt2", "opt3", "opt4", "opt5", "opt6", "opt7", "opt8"];
$credentials = ["username" => "string","password"=>"password","integer"=>"int","option"=>$options,"CheckTheBox" =>"bool","CB2 t" =>"bool"];
return $credentials;
}
+ /**
+ * @return string return display name of backend
+ */
public function getDisplayName(){
return'Dummy with array';
}
-
+ /**
+ * @return int desired caching time of results, in seconds. 0 = no caching
+ */
public function getCacheTime(){
return 0;
}
-
+ /**
+ * @return int age after which timetables are no longer refreshed should be
+ * greater then CacheTime
+ */
public function getRefreshTime(){
return 0;
}
+ /**
+ * Internal version of fetch, to be overridden by subclasses.
+ *
+ * @param $roomIds array with local ID as key and serverID as value
+ * @return array a recursive array that uses the roomID as key
+ * and has the schedule array as value. A shedule array contains an array in this format:
+ * ["start"=>'JJJJ-MM-DD HH:MM:SS',"end"=>'JJJJ-MM-DD HH:MM:SS',"title"=>string]
+ */
public function fetchSchedulesInternal($roomId){
$a = array();
foreach ($roomId as $id) {