/** * Get item properties * * @return array array of property arrays: * "alert" (boolean) => display as an alert property (usually in red) * "property" (string) => property name * "value" (string) => property value */ function getProperties() { global $lng, $ilias, $rbacsystem; $props = array(); include_once "./Modules/ILinc/classes/class.ilObjiLincCourse.php"; if (!ilObjiLincCourse::_isActivated($this->obj_id)) { $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("offline")); } if (!$ilias->getSetting("ilinc_active")) { $props[] = array("alert" => false, "property" => $lng->txt("ilinc_remark"), "value" => $lng->txt("ilinc_server_not_active")); } // Display cost centers if active if ($ilias->getSetting("ilinc_akclassvalues_active") and $rbacsystem->checkAccess("write", $this->ref_id)) { $akclassvalues = ilObjiLincCourse::_getAKClassValues($this->obj_id); $value = ""; if (!empty($akclassvalues[0])) { $value = $akclassvalues[0]; $property = $lng->txt("ilinc_akclassvalue"); if (!empty($akclassvalues[1])) { $value .= " / " . $akclassvalues[1]; $property = $lng->txt("ilinc_akclassvalues"); } } elseif (!empty($akclassvalues[1])) { $value = $akclassvalues[1]; $property = $lng->txt("ilinc_akclassvalue"); } else { $property = $lng->txt("ilinc_akclassvalues"); $value = $lng->txt("ilinc_no_akclassvalues"); } } $props[] = array("alert" => false, "property" => $property, "value" => $value); return $props; }
/** * updates class room on ilinc server * * @access public */ public function updateClassroom() { $this->initSettingsForm('edit'); if ($this->form_gui->checkInput()) { $this->object->setTitle($this->form_gui->getInput('title')); $this->object->setDescription($this->form_gui->getInput('desc')); $this->object->setDocentId($this->form_gui->getInput('instructoruserid')); $this->object->setStatus($this->form_gui->getInput('alwaysopen')); if (!$this->object->update()) { $this->ilErr->raiseError($this->object->getErrorMsg(), $this->ilErr->MESSAGE); } ilUtil::sendInfo($this->getResultMsg(), true); $this->ctrl->redirectByClass('ilobjilinccoursegui'); } else { if ($this->ilias->getSetting('ilinc_akclassvalues_active')) { $icrs_obj_id = ilObject::_lookupObjectId($this->parent); include_once 'Modules/ILinc/classes/class.ilObjiLincCourse.php'; $akclassvalues = ilObjiLincCourse::_getAKClassValues($icrs_obj_id); $_POST['akclassvalue1'] = $akclassvalues[0]; $_POST['akclassvalue2'] = $akclassvalues[1]; } $this->form_gui->setValuesByPost(); return $this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml()); } }