ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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_lhist ()
 
 create ()
 
 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 ()
 
 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 ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 

Protected Attributes

ilObjUser $user
 
ILIAS DI UIServices $ui
 
ilLearningHistoryService $service
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
LOMServices $lom_services
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
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 = ""
 
DOMDocument $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 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.

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

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: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCLearningHistoryGUI::create ( )

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

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

Referenced by create_lhist().

158  : void
159  {
160  $valid = false;
161 
162  $form = $this->initForm(true);
163  if ($form->checkInput()) {
164  //$data = $form->getInput("skill_id");
165  $valid = true;
166  }
167 
168  if ($valid) {
169  $this->content_obj = new ilPCLearningHistory($this->getPage());
170  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
171  $this->setAttributesFromInput($form);
172  $this->updated = $this->pg_obj->update();
173  if ($this->updated === true) {
174  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
175  }
176  }
177 
178  $form->setValuesByPost();
179  $this->insert($form);
180  }
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
initForm(bool $a_insert=false)
Init learning history edit form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_lhist()

ilPCLearningHistoryGUI::create_lhist ( )

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

References create().

153  : void
154  {
155  $this->create();
156  }
+ Here is the call graph for this function:

◆ edit()

ilPCLearningHistoryGUI::edit ( ?ilPropertyFormGUI  $a_form = null)

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

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by update().

75  : void
76  {
77  $tpl = $this->tpl;
78 
79  $this->displayValidationError();
80 
81  if (!$a_form) {
82  $a_form = $this->initForm();
83  }
84  $tpl->setContent($a_form->getHTML());
85  }
setContent(string $a_html)
Sets content for standard template.
initForm(bool $a_insert=false)
Init learning history edit form.
ilGlobalTemplateInterface $tpl
+ 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.

References ILIAS\Repository\ctrl().

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  }
+ Here is the call graph for this function:

◆ getPlaceholderPresentation()

static ilPCLearningHistoryGUI::getPlaceholderPresentation ( )
static

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

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

Referenced by ilPCLearningHistory\getPresentation().

221  : string
222  {
223  global $DIC;
224 
225  $lng = $DIC->language();
226  $lng->loadLanguageModule("lhist");
227 
228  // @todo we need a ks element for this
229  $content = '<div style="margin:5px" class="ilBox"><h3>' . $lng->txt("lhist_lhist") . '</h3><div class="il_Description_no_margin">' .
230  $lng->txt("lhist_cont_placeholder_text") . '</div></div>';
231 
232  return $content;
233  }
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...
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller 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.

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

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

91  {
92  $ilCtrl = $this->ctrl;
93  $lng = $this->lng;
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  }
This class represents an option in a radio group.
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...
This class represents a multi selection list property in a property form.
This class represents a property in a property form.
const IL_CAL_DATE
+ 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.

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by create().

63  : void
64  {
65  $tpl = $this->tpl;
66 
67  $this->displayValidationError();
68 
69  if (!$a_form) {
70  $a_form = $this->initForm(true);
71  }
72  $tpl->setContent($a_form->getHTML());
73  }
setContent(string $a_html)
Sets content for standard template.
initForm(bool $a_insert=false)
Init learning history edit form.
ilGlobalTemplateInterface $tpl
+ 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 185 of file class.ilPCLearningHistoryGUI.php.

References ILIAS\Repository\ctrl(), edit(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), IL_CAL_DATE, initForm(), and ILIAS\Repository\lng().

185  : void
186  {
187  $form = $this->initForm();
188  if ($form->checkInput()) {
189  $this->setAttributesFromInput($form);
190  $this->updated = $this->pg_obj->update();
191  if ($this->updated === true) {
192  $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_obj_modified"), true);
193  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
194  }
195  }
196 
197  $this->pg_obj->addHierIDs();
198  $form->setValuesByPost();
199  $this->edit($form);
200  }
initForm(bool $a_insert=false)
Init learning history edit form.
edit(?ilPropertyFormGUI $a_form=null)
+ 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: