ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjStudyProgrammeSettingsGUI Class Reference

Class ilObjStudyProgrammeSettingsGUI. More...

+ Collaboration diagram for ilObjStudyProgrammeSettingsGUI:

Public Member Functions

 __construct ($a_parent_gui, $a_ref_id)
 
 executeCommand ()
 

Data Fields

 $ctrl
 
 $tpl
 
 $object
 
 $ilias
 
 $lng
 
const PROP_TITLE = "title"
 
const PROP_DESC = "desc"
 
const PROP_TYPE = "type"
 
const PROP_POINTS = "points"
 
const PROP_STATUS = "status"
 

Protected Member Functions

 view ()
 
 update ()
 
 cancel ()
 
 buildModalHeading ($label, $current_node)
 
 buildForm ()
 
 getObject ()
 
 fillForm ($a_form)
 
 checkForm ($a_form)
 
 updateFromFrom ($a_form)
 

Static Protected Member Functions

static getStatusOptions ()
 

Protected Attributes

 $ilAccess
 
 $ilLog
 
 $parent_gui
 
 $tmp_heading
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeSettingsGUI::__construct (   $a_parent_gui,
  $a_ref_id 
)

Definition at line 65 of file class.ilObjStudyProgrammeSettingsGUI.php.

66 {
67 global $DIC;
68 $tpl = $DIC['tpl'];
69 $ilCtrl = $DIC['ilCtrl'];
70 $ilAccess = $DIC['ilAccess'];
71 $ilToolbar = $DIC['ilToolbar'];
72 $ilLocator = $DIC['ilLocator'];
73 $tree = $DIC['tree'];
74 $lng = $DIC['lng'];
75 $ilLog = $DIC['ilLog'];
76 $ilias = $DIC['ilias'];
77
78 $this->parent_gui = $a_parent_gui;
79 $this->ref_id = $a_ref_id;
80 $this->parent_gui = $a_parent_gui;
81
82 $this->tpl = $tpl;
83 $this->ctrl = $ilCtrl;
84 $this->ilAccess = $ilAccess;
85 $this->ilLocator = $ilLocator;
86 $this->tree = $tree;
87 $this->toolbar = $ilToolbar;
88 $this->ilLog = $ilLog;
89 $this->ilias = $ilias;
90 $this->lng = $lng;
91
92 $this->object = null;
93
94 $lng->loadLanguageModule("prg");
95 }
Class ilAccessHandler.
logging
Definition: class.ilLog.php:19
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)
global $DIC
Definition: saml.php:7

References $DIC, $ilAccess, $ilCtrl, $ilias, $ilLog, $lng, and $tpl.

Member Function Documentation

◆ buildForm()

ilObjStudyProgrammeSettingsGUI::buildForm ( )
protected

Definition at line 199 of file class.ilObjStudyProgrammeSettingsGUI.php.

200 {
202
203 if (!$this->ctrl->isAsynch()) {
204 $form->setAsync(false);
205 }
206
207 $form->setFormAction($this->ctrl->getFormAction($this));
208
210 $header->setTitle($this->lng->txt("prg_edit"));
211 $form->addItem($header);
212
213 $item = new ilTextInputGUI($this->lng->txt("title"), self::PROP_TITLE);
214 $item->setRequired(true);
215 $form->addItem($item);
216
217 $item = new ilTextAreaInputGUI($this->lng->txt("description"), self::PROP_DESC);
218 $form->addItem($item);
219
221 $header->setTitle($this->lng->txt("prg_type"));
222 $form->addItem($header);
223
224 $item = new ilSelectInputGUI($this->lng->txt("type"), self::PROP_TYPE);
225 $item->setOptions(ilStudyProgrammeType::getAllTypesArray());
226 $form->addItem($item);
227
229 $header->setTitle($this->lng->txt("prg_assessment"));
230 $form->addItem($header);
231
232 $item = new ilNumberInputGUI($this->lng->txt("prg_points"), self::PROP_POINTS);
233 $item->setMinValue(0);
234 $form->addItem($item);
235
236 $item = new ilSelectInputGUI($this->lng->txt("prg_status"), self::PROP_STATUS);
237 $item->setOptions(self::getStatusOptions());
238 $form->addItem($item);
239
240 $form->addCommandButton("update", $this->lng->txt("save"));
241 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
242
243 return $form;
244 }
Class ilAsyncPropertyFormGUI.
This class represents a section header in a property form.
This class represents a number property in a property form.
This class represents a selection list property in a property form.
static getAllTypesArray($add_empty_on_begin=true)
This class represents a text area property in a property form.
This class represents a text property in a property form.
if(isset($_POST['submit'])) $form

References $form, $header, and ilStudyProgrammeType\getAllTypesArray().

Referenced by update(), and view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildModalHeading()

ilObjStudyProgrammeSettingsGUI::buildModalHeading (   $label,
  $current_node 
)
protected

Definition at line 178 of file class.ilObjStudyProgrammeSettingsGUI.php.

179 {
180 if (!$current_node) {
181 $this->ctrl->saveParameterByClass('ilobjstudyprogrammesettingsgui', 'ref_id');
182 $heading_button = ilLinkButton::getInstance();
183 $heading_button->setCaption('prg_open_node');
184 $heading_button->setUrl($this->ctrl->getLinkTargetByClass('ilobjstudyprogrammetreegui', 'view'));
185
186 $heading = "<div class=''>" . $label . "<div class='pull-right'>" . $heading_button->render() . "</div></div>";
187 $this->tmp_heading = $heading;
188 } else {
189 $this->tmp_heading = "<div class=''>" . $label . "</div>";
190 }
191 }
static getInstance()
Factory.

References ilLinkButton\getInstance().

Referenced by view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilObjStudyProgrammeSettingsGUI::cancel ( )
protected

Definition at line 171 of file class.ilObjStudyProgrammeSettingsGUI.php.

172 {
174
175 $this->ctrl->redirect($this->parent_gui);
176 }
static handleAsyncOutput($normal_content, $async_content=null, $apply_to_tpl=true)
Handles async output.
static encodeAsyncResponse(array $data=array())
Encode data as json for async output.

References ilAsyncOutputHandler\encodeAsyncResponse(), and ilAsyncOutputHandler\handleAsyncOutput().

+ Here is the call graph for this function:

◆ checkForm()

ilObjStudyProgrammeSettingsGUI::checkForm (   $a_form)
protected

Definition at line 266 of file class.ilObjStudyProgrammeSettingsGUI.php.

267 {
268 if (!$a_form->checkInput()) {
269 return false;
270 }
271 return true;
272 }

Referenced by update().

+ Here is the caller graph for this function:

◆ executeCommand()

ilObjStudyProgrammeSettingsGUI::executeCommand ( )

Definition at line 97 of file class.ilObjStudyProgrammeSettingsGUI.php.

98 {
99 $cmd = $this->ctrl->getCmd();
100
101
102 if ($cmd == "") {
103 $cmd = "view";
104 }
105
106 switch ($cmd) {
107 case "view":
108 case "update":
109 case "cancel":
110 $content = $this->$cmd();
111 break;
112 default:
113 throw new ilException("ilObjStudyProgrammeSettingsGUI: " .
114 "Command not supported: $cmd");
115 }
116
117 if (!$this->ctrl->isAsynch()) {
118 $this->tpl->setContent($content);
119 } else {
120 $output_handler = new ilAsyncOutputHandler();
121 $heading = $this->lng->txt("prg_async_" . $this->ctrl->getCmd());
122 if (isset($this->tmp_heading)) {
123 $heading = $this->tmp_heading;
124 }
125 $output_handler->setHeading($heading);
126 $output_handler->setContent($content);
127 $output_handler->terminate();
128 }
129 }
Class ilAsyncOutputHandler Handles the output for async-requests.
Base class for ILIAS Exception handling.

References $tmp_heading.

◆ fillForm()

ilObjStudyProgrammeSettingsGUI::fillForm (   $a_form)
protected

Definition at line 254 of file class.ilObjStudyProgrammeSettingsGUI.php.

255 {
256 $obj = $this->getObject();
257
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()
263 ));
264 }

References getObject().

Referenced by view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObject()

ilObjStudyProgrammeSettingsGUI::getObject ( )
protected

Definition at line 246 of file class.ilObjStudyProgrammeSettingsGUI.php.

247 {
248 if ($this->object === null) {
249 $this->object = ilObjStudyProgramme::getInstanceByRefId($this->ref_id);
250 }
251 return $this->object;
252 }
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.

References $object, and ilObjStudyProgramme\getInstanceByRefId().

Referenced by fillForm(), and updateFromFrom().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStatusOptions()

static ilObjStudyProgrammeSettingsGUI::getStatusOptions ( )
staticprotected

Definition at line 291 of file class.ilObjStudyProgrammeSettingsGUI.php.

292 {
293 global $DIC;
294 $lng = $DIC['lng'];
295
297 => $lng->txt("prg_status_draft")
299 => $lng->txt("prg_status_active")
301 => $lng->txt("prg_status_outdated")
302 );
303 }

References $DIC, $lng, ilStudyProgramme\STATUS_ACTIVE, ilStudyProgramme\STATUS_DRAFT, and ilStudyProgramme\STATUS_OUTDATED.

◆ update()

ilObjStudyProgrammeSettingsGUI::update ( )
protected

Definition at line 144 of file class.ilObjStudyProgrammeSettingsGUI.php.

145 {
146 $form = $this->buildForm();
147 $form->setValuesByPost();
148 $update_possible = $this->checkForm($form);
149
150 if ($update_possible) {
151 $this->updateFromFrom($form);
152 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
153 $response = ilAsyncOutputHandler::encodeAsyncResponse(array("success"=>true, "message"=>$this->lng->txt("msg_obj_modified")));
154 } else {
155 // TODO:
156 ilUtil::sendFailure($this->lng->txt("msg_form_save_error"));
157 $response = ilAsyncOutputHandler::encodeAsyncResponse(array("success"=>false, "errors"=>$form->getErrors()));
158 }
159
160 if ($this->ctrl->isAsynch()) {
162 } else {
163 if ($update_possible) {
164 $this->ctrl->redirect($this);
165 } else {
166 return $form->getHTML();
167 }
168 }
169 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$response

References $form, $response, buildForm(), checkForm(), ilAsyncOutputHandler\encodeAsyncResponse(), ilAsyncOutputHandler\handleAsyncOutput(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and updateFromFrom().

+ Here is the call graph for this function:

◆ updateFromFrom()

ilObjStudyProgrammeSettingsGUI::updateFromFrom (   $a_form)
protected

Definition at line 274 of file class.ilObjStudyProgrammeSettingsGUI.php.

275 {
276 $obj = $this->getObject();
277
278 $obj->setTitle($a_form->getItemByPostVar(self::PROP_TITLE)->getValue());
279 $obj->setDescription($a_form->getItemByPostVar(self::PROP_DESC)->getValue());
280
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();
285 }
286
287 $obj->setPoints($a_form->getItemByPostVar(self::PROP_POINTS)->getValue());
288 $obj->setStatus($a_form->getItemByPostVar(self::PROP_STATUS)->getValue());
289 }

References getObject().

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilObjStudyProgrammeSettingsGUI::view ( )
protected

Definition at line 131 of file class.ilObjStudyProgrammeSettingsGUI.php.

132 {
133 $this->buildModalHeading($this->lng->txt('prg_async_settings'), isset($_GET["currentNode"]));
134
135 $form = $this->buildForm();
136 $this->fillForm($form);
137 return $form->getHTML();
138 }
$_GET["client_id"]

References $_GET, $form, buildForm(), buildModalHeading(), and fillForm().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilObjStudyProgrammeSettingsGUI::$ctrl

Definition at line 23 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ $ilAccess

ilObjStudyProgrammeSettingsGUI::$ilAccess
protected

Definition at line 33 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $ilias

ilObjStudyProgrammeSettingsGUI::$ilias

Definition at line 48 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $ilLog

ilObjStudyProgrammeSettingsGUI::$ilLog
protected

Definition at line 43 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $lng

ilObjStudyProgrammeSettingsGUI::$lng

Definition at line 53 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct(), and getStatusOptions().

◆ $object

ilObjStudyProgrammeSettingsGUI::$object

Definition at line 38 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by getObject().

◆ $parent_gui

ilObjStudyProgrammeSettingsGUI::$parent_gui
protected

Definition at line 58 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ $tmp_heading

ilObjStudyProgrammeSettingsGUI::$tmp_heading
protected

Definition at line 63 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by executeCommand().

◆ $tpl

ilObjStudyProgrammeSettingsGUI::$tpl

Definition at line 28 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ PROP_DESC

const ilObjStudyProgrammeSettingsGUI::PROP_DESC = "desc"

Definition at line 194 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_POINTS

const ilObjStudyProgrammeSettingsGUI::PROP_POINTS = "points"

Definition at line 196 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_STATUS

const ilObjStudyProgrammeSettingsGUI::PROP_STATUS = "status"

Definition at line 197 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_TITLE

const ilObjStudyProgrammeSettingsGUI::PROP_TITLE = "title"

Definition at line 193 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_TYPE

const ilObjStudyProgrammeSettingsGUI::PROP_TYPE = "type"

Definition at line 195 of file class.ilObjStudyProgrammeSettingsGUI.php.


The documentation for this class was generated from the following file: