コード例 #1
0
 /**
  * Read data from db and from Adobe Connect server
  */
 public function doRead()
 {
     /**
      * @var $ilDB   ilDB
      * @var $ilCtrl ilCtrl
      */
     global $ilDB, $ilCtrl;
     if ($ilCtrl->isAsynch()) {
         return;
     }
     $set = $ilDB->query("SELECT * FROM rep_robj_xavc_data " . " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
     while ($rec = $ilDB->fetchAssoc($set)) {
         $this->sco_id = $rec["sco_id"];
         $this->instructions = $rec['instructions'];
         $this->contact_info = $rec['contact_info'];
         $this->permanent_room = $rec['permanent_room'];
         $this->read_contents = $rec['perm_read_contents'];
         $this->read_records = $rec['perm_read_records'];
         $this->folder_id = $rec['folder_id'];
         $this->url = $rec['url_path'];
     }
     if ($this->sco_id == NULL) {
         #$this->ilias->raiseError($this->lng->txt("err_no_valid_sco_id_given"),$this->ilias->error_obj->MESSAGE);
     }
     $session = $this->xmlApi->getBreezeSession();
     if ($session != NULL && $this->xmlApi->login($this->adminLogin, $this->adminPass, $session)) {
         //only read url via api, if url in database is empty
         if (!$this->url) {
             //the parameter meeting is used for the switchaai-case
             $this->url = substr($this->xmlApi->getURL($this->sco_id, $this->folder_id, $session, 'meeting'), 0, -1);
         }
         $date_begin = $this->xmlApi->getStartDate($this->sco_id, $this->folder_id, $session);
         $this->start_date = new ilDateTime(strtotime($date_begin), IL_CAL_UNIX);
         $date_end_string = $this->xmlApi->getEndDate($this->sco_id, $this->folder_id, $session);
         $end_date = new ilDateTime(strtotime($date_end_string), IL_CAL_UNIX);
         $this->end_date = $end_date;
         $unix_duration = $end_date->getUnixTime() - $this->start_date->getUnixTime();
         $hours = floor($unix_duration / 3600);
         $minutes = floor(($unix_duration - $hours * 3600) / 60);
         $this->duration = array("hours" => $hours, "minutes" => $minutes);
         $this->pluginObj->includeClass('class.ilAdobeConnectContents.php');
         $this->contents = new ilAdobeConnectContents();
         $this->access_level = $this->xmlApi->getPermissionId($this->sco_id, $session);
     }
     $this->initParticipantsObject();
 }