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");
69 $ilToolbar = $DIC[
'ilToolbar'];
70 $ilLocator = $DIC[
'ilLocator'];
76 $this->parent_gui = $a_parent_gui;
77 $this->ref_id = $a_ref_id;
78 $this->parent_gui = $a_parent_gui;
83 $this->ilLocator = $ilLocator;
85 $this->toolbar = $ilToolbar;
92 $lng->loadLanguageModule(
"prg");
96 $cmd = $this->ctrl->getCmd();
107 $content = $this->
$cmd();
110 throw new ilException(
"ilObjStudyProgrammeSettingsGUI: ".
111 "Command not supported: $cmd");
114 if(!$this->ctrl->isAsynch()) {
115 $this->tpl->setContent($content);
118 $heading = $this->lng->txt(
"prg_async_".$this->ctrl->getCmd());
119 if(isset($this->tmp_heading)) {
122 $output_handler->setHeading($heading);
123 $output_handler->setContent($content);
124 $output_handler->terminate();
133 return $form->getHTML();
143 $form->setValuesByPost();
144 $update_possible = $this->
checkForm($form);
146 if ($update_possible) {
156 if($this->ctrl->isAsynch()) {
159 if($update_possible) {
160 $this->ctrl->redirect($this);
162 return $form->getHTML();
170 $this->ctrl->redirect($this->parent_gui);
175 $this->ctrl->saveParameterByClass(
'ilobjstudyprogrammesettingsgui',
'ref_id');
177 $heading_button->setCaption(
'prg_open_node');
178 $heading_button->setUrl($this->ctrl->getLinkTargetByClass(
'ilobjstudyprogrammetreegui',
'view'));
180 $heading =
"<div class=''>".$label.
"<div class='pull-right'>".$heading_button->render().
"</div></div>";
181 $this->tmp_heading = $heading;
183 $this->tmp_heading =
"<div class=''>".$label.
"</div>";
197 if(!$this->ctrl->isAsynch()) {
198 $form->setAsync(
false);
201 $form->setFormAction($this->ctrl->getFormAction($this));
204 $header->setTitle($this->lng->txt(
"prg_edit"));
207 $item =
new ilTextInputGUI($this->lng->txt(
"title"), self::PROP_TITLE);
209 $form->addItem($item);
212 $form->addItem($item);
215 $header->setTitle($this->lng->txt(
"prg_type"));
220 $form->addItem($item);
223 $header->setTitle($this->lng->txt(
"prg_assessment"));
226 $item =
new ilNumberInputGUI($this->lng->txt(
"prg_points"), self::PROP_POINTS);
228 $form->addItem($item);
230 $item =
new ilSelectInputGUI($this->lng->txt(
"prg_status"), self::PROP_STATUS);
232 $form->addItem($item);
234 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
235 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
241 if ($this->
object === null) {
250 $a_form->setValuesByArray(
array 251 ( self::PROP_TITLE => $obj->getTitle()
252 , self::PROP_DESC => $obj->getDescription()
253 , self::PROP_TYPE => $obj->getSubtypeId()
254 , self::PROP_POINTS => $obj->getPoints()
255 , self::PROP_STATUS => $obj->getStatus()
260 if (!$a_form->checkInput()) {
269 $obj->setTitle($a_form->getItemByPostVar(self::PROP_TITLE)->getValue());
270 $obj->setDescription($a_form->getItemByPostVar(self::PROP_DESC)->getValue());
272 if($obj->getSubtypeId() != $a_form->getItemByPostVar(self::PROP_TYPE)->getValue()) {
273 $obj->setSubtypeId($a_form->getItemByPostVar(self::PROP_TYPE)->getValue());
274 $obj->updateCustomIcon();
275 $this->parent_gui->setTitleAndDescription();
278 $obj->setPoints($a_form->getItemByPostVar(self::PROP_POINTS)->getValue());
279 $obj->setStatus($a_form->getItemByPostVar(self::PROP_STATUS)->getValue());
287 =>
$lng->txt(
"prg_status_draft")
289 =>
$lng->txt(
"prg_status_active")
291 =>
$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) ...
Create styles array
The data for the language used.
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.