5 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
6 require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
7 require_once(
"./Modules/StudyProgramme/classes/helpers/class.ilAsyncOutputHandler.php");
8 require_once(
"./Modules/StudyProgramme/classes/helpers/class.ilAsyncPropertyFormGUI.php");
9 require_once(
"./Services/UIComponent/Button/classes/class.ilLinkButton.php");
67 $this->parent_gui = $a_parent_gui;
68 $this->ref_id = $a_ref_id;
69 $this->parent_gui = $a_parent_gui;
74 $this->ilLocator = $ilLocator;
76 $this->toolbar = $ilToolbar;
83 $lng->loadLanguageModule(
"prg");
87 $cmd = $this->ctrl->getCmd();
98 $content = $this->
$cmd();
101 throw new ilException(
"ilObjStudyProgrammeSettingsGUI: ".
102 "Command not supported: $cmd");
105 if(!$this->ctrl->isAsynch()) {
106 $this->tpl->setContent($content);
109 $heading = $this->lng->txt(
"prg_async_".$this->ctrl->getCmd());
110 if(isset($this->tmp_heading)) {
113 $output_handler->setHeading($heading);
114 $output_handler->setContent($content);
115 $output_handler->terminate();
124 return $form->getHTML();
134 $form->setValuesByPost();
135 $update_possible = $this->
checkForm($form);
137 if ($update_possible) {
147 if($this->ctrl->isAsynch()) {
150 if($update_possible) {
151 $this->ctrl->redirect($this);
153 return $form->getHTML();
161 $this->ctrl->redirect($this->parent_gui);
166 $this->ctrl->saveParameterByClass(
'ilobjstudyprogrammesettingsgui',
'ref_id');
168 $heading_button->setCaption(
'prg_open_node');
169 $heading_button->setUrl($this->ctrl->getLinkTargetByClass(
'ilobjstudyprogrammetreegui',
'view'));
171 $heading =
"<div class=''>".$label.
"<div class='pull-right'>".$heading_button->render().
"</div></div>";
172 $this->tmp_heading = $heading;
174 $this->tmp_heading =
"<div class=''>".$label.
"</div>";
188 if(!$this->ctrl->isAsynch()) {
189 $form->setAsync(
false);
192 $form->setFormAction($this->ctrl->getFormAction($this));
195 $header->setTitle($this->lng->txt(
"prg_edit"));
198 $item =
new ilTextInputGUI($this->lng->txt(
"title"), self::PROP_TITLE);
200 $form->addItem($item);
203 $form->addItem($item);
206 $header->setTitle($this->lng->txt(
"prg_type"));
211 $form->addItem($item);
214 $header->setTitle($this->lng->txt(
"prg_assessment"));
217 $item =
new ilNumberInputGUI($this->lng->txt(
"prg_points"), self::PROP_POINTS);
219 $form->addItem($item);
221 $item =
new ilSelectInputGUI($this->lng->txt(
"prg_status"), self::PROP_STATUS);
223 $form->addItem($item);
225 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
226 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
232 if ($this->
object === null) {
241 $a_form->setValuesByArray(array
242 ( self::PROP_TITLE => $obj->getTitle()
243 , self::PROP_DESC => $obj->getDescription()
244 , self::PROP_TYPE => $obj->getSubtypeId()
245 , self::PROP_POINTS => $obj->getPoints()
246 , self::PROP_STATUS => $obj->getStatus()
251 if (!$a_form->checkInput()) {
260 $obj->setTitle($a_form->getItemByPostVar(self::PROP_TITLE)->getValue());
261 $obj->setDescription($a_form->getItemByPostVar(self::PROP_DESC)->getValue());
263 if($obj->getSubtypeId() != $a_form->getItemByPostVar(self::PROP_TYPE)->getValue()) {
264 $obj->setSubtypeId($a_form->getItemByPostVar(self::PROP_TYPE)->getValue());
265 $obj->updateCustomIcon();
266 $this->parent_gui->setTitleAndDescription();
269 $obj->setPoints($a_form->getItemByPostVar(self::PROP_POINTS)->getValue());
270 $obj->setStatus($a_form->getItemByPostVar(self::PROP_STATUS)->getValue());
277 => $lng->txt(
"prg_status_draft")
279 => $lng->txt(
"prg_status_active")
281 => $lng->txt(
"prg_status_outdated")
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilAsyncOutputHandler Handles the output for async-requests.
Base class for ILIAS Exception handling.
static getAllTypesArray($add_empty_on_begin=true)
buildModalHeading($label, $current_node)
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.
__construct($a_parent_gui, $a_ref_id)
static encodeAsyncResponse(array $data=array())
Encode data as json for async output.
static getStatusOptions()
This class represents a text property in a property form.
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a text area property in a property form.
Class ilObjStudyProgrammeSettingsGUI.
static handleAsyncOutput($normal_content, $async_content=null, $apply_to_tpl=true)
Handles async output.