ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
All Data Structures Namespaces Files Functions Variables Typedefs Modules Pages
ilPCLearningHistoryGUI Class Reference

GUI class for learning history page content. More...

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

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ilPCLearningHistory $a_content_obj=null, $a_hier_id="", $a_pc_id="")
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 insert (ilPropertyFormGUI $a_form=null)
 Insert learning history form. More...
 
 edit (ilPropertyFormGUI $a_form=null)
 Edit skills form. More...
 
 create ()
 Create new learning history component. More...
 
 update ()
 Update learning history component. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 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 ()
 display validation errors More...
 
 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 ($a_type)
 Get table templates. More...
 

Static Public Member Functions

static getPlaceholderPresentation ()
 Get placeholder presentation. More...
 
- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 

Protected Member Functions

 initForm ($a_insert=false)
 Init learning history edit form. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 

Protected Attributes

 $user
 
 $ui
 
 $service
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $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 $common_bb_buttons
 

Detailed Description

GUI class for learning history page content.

Handles user commands on skills data

Author
killi.nosp@m.n@le.nosp@m.ifos..nosp@m.com

ilPCLearningHistoryGUI: ilPageEditorGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

References $DIC, and user().

58  {
59  global $DIC;
60 
61  $this->tpl = $DIC["tpl"];
62  $this->ctrl = $DIC->ctrl();
63  $this->user = $DIC->user();
64  $this->lng = $DIC->language();
65  $this->lng->loadLanguageModule("lhist");
66  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
67  $this->service = $DIC->learningHistory();
68  $this->ui = $DIC->ui();
69  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCLearningHistoryGUI::create ( )

Create new learning history component.

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

References $form, $valid, ilPageContentGUI\getPage(), initForm(), and insert().

203  {
204  $valid = false;
205 
206  $form = $this->initForm(true);
207  if ($form->checkInput()) {
208  //$data = $form->getInput("skill_id");
209  $valid = true;
210  }
211 
212  if ($valid) {
213  $this->content_obj = new ilPCLearningHistory($this->getPage());
214  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
215  $this->setAttributesFromInput($form);
216  $this->updated = $this->pg_obj->update();
217  if ($this->updated === true) {
218  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
219  }
220  }
221 
222  $form->setValuesByPost();
223  return $this->insert($form);
224  }
Learning history page content.
initForm($a_insert=false)
Init learning history edit form.
$valid
if(isset($_POST['submit'])) $form
insert(ilPropertyFormGUI $a_form=null)
Insert learning history form.
+ Here is the call graph for this function:

◆ edit()

ilPCLearningHistoryGUI::edit ( ilPropertyFormGUI  $a_form = null)

Edit skills form.

Parameters
ilPropertyFormGUI$a_form

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

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

Referenced by update().

114  {
115  $tpl = $this->tpl;
116 
117  $this->displayValidationError();
118 
119  if (!$a_form) {
120  $a_form = $this->initForm();
121  }
122  $tpl->setContent($a_form->getHTML());
123  }
initForm($a_insert=false)
Init learning history edit form.
displayValidationError()
display validation errors
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCLearningHistoryGUI::executeCommand ( )

execute command

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

References $ret.

75  {
76  // get next class that processes or forwards current command
77  $next_class = $this->ctrl->getNextClass($this);
78 
79  // get current command
80  $cmd = $this->ctrl->getCmd();
81 
82  switch ($next_class) {
83  default:
84  $ret = $this->$cmd();
85  break;
86  }
87 
88  return $ret;
89  }
$ret
Definition: parser.php:6

◆ getPlaceholderPresentation()

static ilPCLearningHistoryGUI::getPlaceholderPresentation ( )
static

Get placeholder presentation.

Parameters

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

References $DIC, and ilPageContentGUI\$lng.

278  {
279  global $DIC;
280 
281  $lng = $DIC->language();
282  $lng->loadLanguageModule("lhist");
283 
284  // @todo we need a ks element for this
285  $content = '<div style="margin:5px" class="ilBox"><h3>' . $lng->txt("lhist_lhist") . '</h3><div class="il_Description_no_margin">' .
286  $lng->txt("lhist_cont_placeholder_text") . '</div></div>';
287 
288  return $content;
289  }
global $DIC
Definition: saml.php:7

◆ initForm()

ilPCLearningHistoryGUI::initForm (   $a_insert = false)
protected

Init learning history edit form.

Parameters
bool$a_insert
Returns
ilPropertyFormGUI

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

References ilPageContentGUI\$ctrl, $form, $ilCtrl, $ilUser, ilPageContentGUI\$lng, PHPMailer\PHPMailer\$options, $si, $user, IL_CAL_DATE, and ilDateDurationInputGUI\setStart().

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

132  {
135  $lng = $this->lng;
136 
137  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
138  $form = new ilPropertyFormGUI();
139  $form->setFormAction($ilCtrl->getFormAction($this));
140  if ($a_insert) {
141  $form->setTitle($this->lng->txt("cont_create_lhist"));
142  } else {
143  $form->setTitle($this->lng->txt("cont_update_lhist"));
144  }
145 
146  // duration
147  $du = new ilDateDurationInputGUI($lng->txt("lhist_period"), "period");
148  if (!$a_insert) {
149  if ($this->content_obj->getFrom() != "") {
150  $du->setStart(new ilDate($this->content_obj->getFrom(), IL_CAL_DATE));
151  }
152  if ($this->content_obj->getTo() != "") {
153  $du->setEnd(new ilDate($this->content_obj->getTo(), IL_CAL_DATE));
154  }
155  }
156  $du->setAllowOpenIntervals(true);
157  $form->addItem($du);
158 
159  //
160  $radg = new ilRadioGroupInputGUI($lng->txt("lhist_type_of_achievement"), "mode");
161  //$radg->setValue();
162  $op1 = new ilRadioOption($lng->txt("lhist_all"), 0);
163  $radg->addOption($op1);
164  $op2 = new ilRadioOption($lng->txt("lhist_selected"), 1);
165  $radg->addOption($op2);
166  $form->addItem($radg);
167 
168 
169  // select type
170  $options = [];
171  foreach ($this->service->provider()->getAllProviders(true) as $p) {
172  $options[get_class($p)] = $p->getName();
173  }
174  $si = new ilMultiSelectInputGUI($lng->txt(""), "class");
175  $si->setHeight(130);
176  if (!$a_insert) {
177  $si->setValue($this->content_obj->getClasses());
178  if (count($this->content_obj->getClasses()) > 0) {
179  $radg->setValue(1);
180  }
181  }
182  $si->setOptions($options);
183  $op2->addSubItem($si);
184 
185 
186 
187  if ($a_insert) {
188  $form->addCommandButton("create_lhist", $this->lng->txt("insert"));
189  $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
190  } else {
191  $form->addCommandButton("update", $this->lng->txt("save"));
192  $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
193  }
194 
195  return $form;
196  }
This class represents an option in a radio group.
This class represents a property form user interface.
setStart(ilDateTime $a_date=null)
Set start date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilD...
global $ilCtrl
Definition: ilias.php:18
This class represents a multi selection list property in a property form.
input GUI for a time span (start and end date)
This class represents a property in a property form.
Class for single dates.
if(isset($_POST['submit'])) $form
$ilUser
Definition: imgupload.php:18
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.

Parameters
ilPropertyFormGUI$a_form

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

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

Referenced by create().

97  {
98  $tpl = $this->tpl;
99 
100  $this->displayValidationError();
101 
102  if (!$a_form) {
103  $a_form = $this->initForm(true);
104  }
105  $tpl->setContent($a_form->getHTML());
106  }
initForm($a_insert=false)
Init learning history edit form.
displayValidationError()
display validation errors
+ 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 229 of file class.ilPCLearningHistoryGUI.php.

References $form, $from, edit(), IL_CAL_DATE, initForm(), and ilUtil\sendInfo().

230  {
231  $form = $this->initForm();
232  if ($form->checkInput()) {
233  $this->setAttributesFromInput($form);
234  $this->updated = $this->pg_obj->update();
235  if ($this->updated === true) {
236  ilUtil::sendInfo($this->lng->txt("msg_obj_modified"), true);
237  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
238  }
239  }
240 
241  $this->pg_obj->addHierIDs();
242  $form->setValuesByPost();
243  return $this->edit($form);
244  }
edit(ilPropertyFormGUI $a_form=null)
Edit skills form.
initForm($a_insert=false)
Init learning history edit form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

Field Documentation

◆ $service

ilPCLearningHistoryGUI::$service
protected

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

◆ $ui

ilPCLearningHistoryGUI::$ui
protected

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

◆ $user

ilPCLearningHistoryGUI::$user
protected

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

Referenced by initForm().


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