ILIAS  release_8 Revision v8.24
ilPCLearningHistoryGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilPCLearningHistoryGUI:
+ Collaboration diagram for ilPCLearningHistoryGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPCLearningHistory $a_content_obj=null, string $a_hier_id="", string $a_pc_id="")
 
 executeCommand ()
 
 insert (ilPropertyFormGUI $a_form=null)
 Insert learning history form. More...
 
 edit (ilPropertyFormGUI $a_form=null)
 
 create ()
 Create new learning history component. More...
 
 update ()
 Update learning history component. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions (string $a_type="")
 Get table templates. More...
 

Static Public Member Functions

static getPlaceholderPresentation ()
 
- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 

Protected Member Functions

 initForm (bool $a_insert=false)
 Init learning history edit form. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 

Protected Attributes

ilObjUser $user
 
ILIAS DI UIServices $ui
 
ilLearningHistoryService $service
 
- Protected Attributes inherited from ilPageContentGUI
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
php4DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning GUI class for learning history page content

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_isCalledBy ilPCLearningHistoryGUI: ilPageEditorGUI

Definition at line 24 of file class.ilPCLearningHistoryGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCLearningHistoryGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPCLearningHistory  $a_content_obj = null,
string  $a_hier_id = "",
string  $a_pc_id = "" 
)

Definition at line 30 of file class.ilPCLearningHistoryGUI.php.

35 {
36 global $DIC;
37
38 $this->tpl = $DIC["tpl"];
39 $this->ctrl = $DIC->ctrl();
40 $this->user = $DIC->user();
41 $this->lng = $DIC->language();
42 $this->lng->loadLanguageModule("lhist");
43 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
44 $this->service = $DIC->learningHistory();
45 $this->ui = $DIC->ui();
46 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCLearningHistoryGUI::create ( )

Create new learning history component.

Definition at line 156 of file class.ilPCLearningHistoryGUI.php.

156 : void
157 {
158 $valid = false;
159
160 $form = $this->initForm(true);
161 if ($form->checkInput()) {
162 //$data = $form->getInput("skill_id");
163 $valid = true;
164 }
165
166 if ($valid) {
167 $this->content_obj = new ilPCLearningHistory($this->getPage());
168 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
169 $this->setAttributesFromInput($form);
170 $this->updated = $this->pg_obj->update();
171 if ($this->updated === true) {
172 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
173 }
174 }
175
176 $form->setValuesByPost();
177 $this->insert($form);
178 }
initForm(bool $a_insert=false)
Init learning history edit form.
insert(ilPropertyFormGUI $a_form=null)
Insert learning history form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$valid

References $valid, ILIAS\Repository\ctrl(), ilPageContentGUI\getPage(), initForm(), and insert().

+ Here is the call graph for this function:

◆ edit()

ilPCLearningHistoryGUI::edit ( ilPropertyFormGUI  $a_form = null)

Definition at line 75 of file class.ilPCLearningHistoryGUI.php.

75 : void
76 {
78
80
81 if (!$a_form) {
82 $a_form = $this->initForm();
83 }
84 $tpl->setContent($a_form->getHTML());
85 }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), and ilGlobalTemplateInterface\setContent().

Referenced by update().

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

◆ executeCommand()

ilPCLearningHistoryGUI::executeCommand ( )

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

48 : void
49 {
50 $next_class = $this->ctrl->getNextClass($this);
51 $cmd = $this->ctrl->getCmd();
52
53 switch ($next_class) {
54 default:
55 $this->$cmd();
56 break;
57 }
58 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getPlaceholderPresentation()

static ilPCLearningHistoryGUI::getPlaceholderPresentation ( )
static

Definition at line 219 of file class.ilPCLearningHistoryGUI.php.

219 : string
220 {
221 global $DIC;
222
223 $lng = $DIC->language();
224 $lng->loadLanguageModule("lhist");
225
226 // @todo we need a ks element for this
227 $content = '<div style="margin:5px" class="ilBox"><h3>' . $lng->txt("lhist_lhist") . '</h3><div class="il_Description_no_margin">' .
228 $lng->txt("lhist_cont_placeholder_text") . '</div></div>';
229
230 return $content;
231 }
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References $DIC, ilPageContentGUI\$lng, ilLanguage\loadLanguageModule(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ initForm()

ilPCLearningHistoryGUI::initForm ( bool  $a_insert = false)
protected

Init learning history edit form.

Definition at line 90 of file class.ilPCLearningHistoryGUI.php.

91 {
92 $ilCtrl = $this->ctrl;
94
95 $form = new ilPropertyFormGUI();
96 $form->setFormAction($ilCtrl->getFormAction($this));
97 if ($a_insert) {
98 $form->setTitle($this->lng->txt("cont_create_lhist"));
99 } else {
100 $form->setTitle($this->lng->txt("cont_update_lhist"));
101 }
102
103 // duration
104 $du = new ilDateDurationInputGUI($lng->txt("lhist_period"), "period");
105 if (!$a_insert) {
106 if ($this->content_obj->getFrom() != "") {
107 $du->setStart(new ilDate($this->content_obj->getFrom(), IL_CAL_DATE));
108 }
109 if ($this->content_obj->getTo() != "") {
110 $du->setEnd(new ilDate($this->content_obj->getTo(), IL_CAL_DATE));
111 }
112 }
113 $du->setAllowOpenIntervals(true);
114 $form->addItem($du);
115
116 //
117 $radg = new ilRadioGroupInputGUI($lng->txt("lhist_type_of_achievement"), "mode");
118 $radg->setValue("0");
119 $op1 = new ilRadioOption($lng->txt("lhist_all"), "0");
120 $radg->addOption($op1);
121 $op2 = new ilRadioOption($lng->txt("lhist_selected"), "1");
122 $radg->addOption($op2);
123 $form->addItem($radg);
124
125
126 // select type
127 $options = [];
128 foreach ($this->service->provider()->getAllProviders(true) as $p) {
129 $options[get_class($p)] = $p->getName();
130 }
131 $si = new ilMultiSelectInputGUI($lng->txt(""), "class");
132 $si->setHeight(130);
133 if (!$a_insert) {
134 $si->setValue($this->content_obj->getClasses());
135 if (count($this->content_obj->getClasses()) > 0) {
136 $radg->setValue(1);
137 }
138 }
139 $si->setOptions($options);
140 $op2->addSubItem($si);
141
142 if ($a_insert) {
143 $form->addCommandButton("create_lhist", $this->lng->txt("insert"));
144 $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
145 } else {
146 $form->addCommandButton("update", $this->lng->txt("save"));
147 $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
148 }
149
150 return $form;
151 }
const IL_CAL_DATE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class for single dates.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, IL_CAL_DATE, ILIAS\Repository\lng(), and ilLanguage\txt().

Referenced by create(), edit(), insert(), and update().

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

◆ insert()

ilPCLearningHistoryGUI::insert ( ilPropertyFormGUI  $a_form = null)

Insert learning history form.

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

63 : void
64 {
66
68
69 if (!$a_form) {
70 $a_form = $this->initForm(true);
71 }
72 $tpl->setContent($a_form->getHTML());
73 }

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), and ilGlobalTemplateInterface\setContent().

Referenced by create().

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

◆ update()

ilPCLearningHistoryGUI::update ( )

Update learning history component.

Definition at line 183 of file class.ilPCLearningHistoryGUI.php.

183 : void
184 {
185 $form = $this->initForm();
186 if ($form->checkInput()) {
187 $this->setAttributesFromInput($form);
188 $this->updated = $this->pg_obj->update();
189 if ($this->updated === true) {
190 $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_obj_modified"), true);
191 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
192 }
193 }
194
195 $this->pg_obj->addHierIDs();
196 $form->setValuesByPost();
197 $this->edit($form);
198 }
edit(ilPropertyFormGUI $a_form=null)

References ILIAS\Repository\ctrl(), edit(), initForm(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $service

ilLearningHistoryService ilPCLearningHistoryGUI::$service
protected

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

◆ $ui

ILIAS DI UIServices ilPCLearningHistoryGUI::$ui
protected

Definition at line 27 of file class.ilPCLearningHistoryGUI.php.

◆ $user

ilObjUser ilPCLearningHistoryGUI::$user
protected

Definition at line 26 of file class.ilPCLearningHistoryGUI.php.


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