24 require_once(
"./Services/COPage/classes/class.ilPCSkills.php");
25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
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();
77 $next_class = $this->ctrl->getNextClass($this);
80 $cmd = $this->ctrl->getCmd();
82 switch ($next_class) {
105 $tpl->setContent($a_form->getHTML());
122 $tpl->setContent($a_form->getHTML());
137 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
141 $form->setTitle($this->lng->txt(
"cont_create_lhist"));
143 $form->setTitle($this->lng->txt(
"cont_update_lhist"));
149 if ($this->content_obj->getFrom() !=
"") {
152 if ($this->content_obj->getTo() !=
"") {
156 $du->setAllowOpenIntervals(
true);
163 $radg->addOption($op1);
165 $radg->addOption($op2);
166 $form->addItem($radg);
171 foreach ($this->service->provider()->getAllProviders(
true) as $p) {
172 $options[get_class($p)] = $p->getName();
177 $si->setValue($this->content_obj->getClasses());
178 if (count($this->content_obj->getClasses()) > 0) {
183 $op2->addSubItem(
$si);
188 $form->addCommandButton(
"create_lhist", $this->lng->txt(
"insert"));
189 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
191 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
192 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
207 if (
$form->checkInput()) {
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);
222 $form->setValuesByPost();
232 if (
$form->checkInput()) {
233 $this->setAttributesFromInput(
$form);
234 $this->updated = $this->pg_obj->update();
235 if ($this->updated ===
true) {
237 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
241 $this->pg_obj->addHierIDs();
242 $form->setValuesByPost();
252 protected function setAttributesFromInput(
$form)
255 $item =
$form->getItemByPostVar(
"period");
256 $from = (is_null($item->getStart()))
259 $to = (is_null($item->getEnd()))
263 $this->content_obj->setFrom(
$from);
264 $this->content_obj->setTo($to);
265 $classes = (
$form->getInput(
"mode") ==
"1" && is_array(
$form->getInput(
"class")))
266 ?
$form->getInput(
"class")
268 $this->content_obj->setClasses($classes);
281 $lng = $DIC->language();
282 $lng->loadLanguageModule(
"lhist");
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>';
This class represents an option in a radio group.
update()
Update learning history component.
__construct(ilPageObject $a_pg_obj, ilPCLearningHistory $a_content_obj=null, $a_hier_id="", $a_pc_id="")
Constructor.
create()
Create new learning history component.
edit(ilPropertyFormGUI $a_form=null)
Edit skills form.
Learning history page content.
initForm($a_insert=false)
Init learning history edit form.
GUI class for learning history page content.
executeCommand()
execute command
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
static getPlaceholderPresentation()
Get placeholder presentation.
if(isset($_POST['submit'])) $form
insert(ilPropertyFormGUI $a_form=null)
Insert learning history form.
displayValidationError()
display validation errors