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");
71 $ilToolbar = $DIC[
'ilToolbar'];
72 $ilLocator = $DIC[
'ilLocator'];
78 $this->parent_gui = $a_parent_gui;
79 $this->ref_id = $a_ref_id;
80 $this->parent_gui = $a_parent_gui;
85 $this->ilLocator = $ilLocator;
87 $this->toolbar = $ilToolbar;
94 $lng->loadLanguageModule(
"prg");
99 $cmd = $this->ctrl->getCmd();
110 $content = $this->$cmd();
113 throw new ilException(
"ilObjStudyProgrammeSettingsGUI: " .
114 "Command not supported: $cmd");
117 if (!$this->ctrl->isAsynch()) {
118 $this->tpl->setContent($content);
121 $heading = $this->lng->txt(
"prg_async_" . $this->ctrl->getCmd());
122 if (isset($this->tmp_heading)) {
125 $output_handler->setHeading($heading);
126 $output_handler->setContent($content);
127 $output_handler->terminate();
137 return $form->getHTML();
147 $form->setValuesByPost();
150 if ($update_possible) {
160 if ($this->ctrl->isAsynch()) {
163 if ($update_possible) {
164 $this->ctrl->redirect($this);
166 return $form->getHTML();
175 $this->ctrl->redirect($this->parent_gui);
180 if (!$current_node) {
181 $this->ctrl->saveParameterByClass(
'ilobjstudyprogrammesettingsgui',
'ref_id');
183 $heading_button->setCaption(
'prg_open_node');
184 $heading_button->setUrl($this->ctrl->getLinkTargetByClass(
'ilobjstudyprogrammetreegui',
'view'));
186 $heading =
"<div class=''>" . $label .
"<div class='pull-right'>" . $heading_button->render() .
"</div></div>";
187 $this->tmp_heading = $heading;
189 $this->tmp_heading =
"<div class=''>" . $label .
"</div>";
203 if (!$this->ctrl->isAsynch()) {
204 $form->setAsync(
false);
207 $form->setFormAction($this->ctrl->getFormAction($this));
210 $header->setTitle($this->lng->txt(
"prg_edit"));
213 $item =
new ilTextInputGUI($this->lng->txt(
"title"), self::PROP_TITLE);
215 $form->addItem($item);
218 $form->addItem($item);
221 $header->setTitle($this->lng->txt(
"prg_type"));
226 $form->addItem($item);
229 $header->setTitle($this->lng->txt(
"prg_assessment"));
232 $item =
new ilNumberInputGUI($this->lng->txt(
"prg_points"), self::PROP_POINTS);
234 $form->addItem($item);
236 $item =
new ilSelectInputGUI($this->lng->txt(
"prg_status"), self::PROP_STATUS);
238 $form->addItem($item);
240 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
241 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
248 if ($this->
object === null) {
258 $a_form->setValuesByArray(
array( self::PROP_TITLE => $obj->getTitle()
259 , self::PROP_DESC => $obj->getDescription()
260 , self::PROP_TYPE => $obj->getSubtypeId()
261 , self::PROP_POINTS => $obj->getPoints()
262 , self::PROP_STATUS => $obj->getStatus()
268 if (!$a_form->checkInput()) {
278 $obj->setTitle($a_form->getItemByPostVar(self::PROP_TITLE)->getValue());
279 $obj->setDescription($a_form->getItemByPostVar(self::PROP_DESC)->getValue());
281 if ($obj->getSubtypeId() != $a_form->getItemByPostVar(self::PROP_TYPE)->getValue()) {
282 $obj->setSubtypeId($a_form->getItemByPostVar(self::PROP_TYPE)->getValue());
283 $obj->updateCustomIcon();
284 $this->parent_gui->setTitleAndDescription();
287 $obj->setPoints($a_form->getItemByPostVar(self::PROP_POINTS)->getValue());
288 $obj->setStatus($a_form->getItemByPostVar(self::PROP_STATUS)->getValue());
297 =>
$lng->txt(
"prg_status_draft")
299 =>
$lng->txt(
"prg_status_active")
301 =>
$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.
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.
if(isset($_POST['submit'])) $form
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.