summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc
diff options
context:
space:
mode:
authorDirk Riestere2017-02-22 14:51:30 +0100
committerDirk Riestere2017-02-22 14:51:30 +0100
commit7e47f9f5c5206312048df0a20c1082352a4fcb5d (patch)
treed995ff2380b37dc61a283b1eca82cdb04db583f8 /modules-available/locationinfo/inc
parentMerge branch 'location-info-panel' of git.openslx.org:openslx-ng/slx-admin in... (diff)
downloadslx-admin-7e47f9f5c5206312048df0a20c1082352a4fcb5d.tar.gz
slx-admin-7e47f9f5c5206312048df0a20c1082352a4fcb5d.tar.xz
slx-admin-7e47f9f5c5206312048df0a20c1082352a4fcb5d.zip
die klassen können jetzt ohne parameter erstellt werden, die url und die serverID wird jetzt in setCredentials gesetzt
Diffstat (limited to 'modules-available/locationinfo/inc')
-rw-r--r--modules-available/locationinfo/inc/coursebackend.inc.php11
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php32
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php10
3 files changed, 40 insertions, 13 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend.inc.php b/modules-available/locationinfo/inc/coursebackend.inc.php
index e10cb08b..e21cbac3 100644
--- a/modules-available/locationinfo/inc/coursebackend.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend.inc.php
@@ -75,12 +75,6 @@ abstract class CourseBackend
*/
public abstract function getDisplayName();
- /**
- * initializes the class.
- * @param string $url adress of the server
- * @param int $serverID ID of the server
- */
- public abstract function __construct($url,$serverID);
/**
@@ -91,9 +85,12 @@ abstract class CourseBackend
/**
* uses json to setCredentials, the json must follow the form given in
* getCredentials
+ * @param json $json jsonarray with the credentials
+ * @param string $url adress of the server
+ * @param int $serverID ID of the server
* @returns void
*/
- public abstract function setCredentials($json);
+ public abstract function setCredentials($json, $url, $serverID);
/**
* @return int desired caching time of results, in seconds. 0 = no caching
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
new file mode 100644
index 00000000..3bb17e88
--- /dev/null
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
@@ -0,0 +1,32 @@
+<?php
+class Coursebackend_Davinci extends CourseBackend {
+
+ private $location;
+ public $serverID;
+
+ function __construct($location, $serverID) {
+ $this->location = $location."/daVinciIS.dll?";
+ $this->serverID = $serverID;
+ }
+ public function setCredentials($param) {
+ //Davinci doesn't have credentials
+ }
+ public function getCredentials(){
+ $return = array();
+ return $return;
+ }
+ public function getDisplayName(){
+ return'Davinci';
+ }
+ public function getCacheTime(){
+ return 0;
+ }
+ public function getRefreshTime(){
+ return 0;
+ }
+ public function fetchSchedulesInternal($roomId){
+
+ }
+
+}
+?>
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
index 1922f9e5..01b476fb 100644
--- a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
@@ -8,16 +8,14 @@ class CourseBackend_HisInOne extends CourseBackend
public $serverID;
- //Constructs the HisInOneClient
- function __construct($location, $serverID) {
- $this->location = $location."/qisserver/services2/CourseService";
- $this->serverID = $serverID;
- }
+
//
- public function setCredentials($json) {
+ public function setCredentials($json,$location,$serverID) {
$data = json_decode($json, TRUE);
$this->password = $data['password'];
$this->username = $data['username']."/t".$data['role'];
+ $this->location = $location."/qisserver/services2/CourseService";
+ $this->serverID = $serverID;
}
//Cache the timetables for 30 minutes ttables older than 60 are not refreshed