28 public function init(): void
32 $this->
user = $DIC->user();
38 parent::setNode($a_node);
49 $this->lhist_node = $this->dom->create_element(
"LearningHistory");
50 $this->lhist_node = $this->node->append_child($this->lhist_node);
53 public function setFrom(
string $a_val): void
55 $this->lhist_node->set_attribute(
"From", $a_val);
60 return (
string) $this->lhist_node->get_attribute(
"From");
63 public function setTo(
string $a_val): void
65 $this->lhist_node->set_attribute(
"To", $a_val);
70 return (
string) $this->lhist_node->get_attribute(
"To");
76 $children = $this->lhist_node->child_nodes();
77 foreach ($children as $iValue) {
78 $this->lhist_node->remove_child($iValue);
81 foreach ($a_val as
$key => $class) {
82 $prop_node = $this->dom->create_element(
"LearningHistoryProvider");
83 $prop_node = $this->lhist_node->append_child($prop_node);
84 $prop_node->set_attribute(
"Name", $class);
92 $children = $this->lhist_node->child_nodes();
93 foreach ($children as $iValue) {
94 $classes[] = $iValue->get_attribute(
"Name");
132 return array(
"ed_insert_learning_history",
"pc_learning_history");
138 bool $a_abstract_only =
false 140 $start = strpos($a_output,
"{{{{{LearningHistory");
142 if (is_int($start)) {
143 $end = strpos($a_output,
"}}}}}", $start);
147 $param = substr($a_output, $start + 5, $end - $start - 5);
148 $param = str_replace(
' xmlns:xhtml="http://www.w3.org/1999/xhtml"',
"",
$param);
152 $classes = explode(
";",
$param[3]);
153 $classes = array_map(
static function (
$i) {
158 $a_output = substr($a_output, 0, $start) .
160 substr($a_output, $end + 5);
162 if (strlen($a_output) > $start + 5) {
163 $start = strpos($a_output,
"{{{{{LearningHistory", $start + 5);
168 if (is_int($start)) {
169 $end = strpos($a_output,
"}}}}}", $start);
188 if ($a_mode ===
"preview" || $a_mode ===
"presentation" || $a_mode ===
"print") {
189 if ($this->
getPage()->getParentType() ===
"prtf") {
194 $tpl =
new ilTemplate(
"tpl.pc_lhist.html",
true,
true,
"Services/LearningHistory");
196 $hist_gui->setUserId($user_id);
197 $from_unix = ($from !=
"")
200 $to_unix = ($to !=
"")
203 $classes = (is_array($classes))
204 ? array_filter($classes,
static function (
$i):
bool {
208 if (count($classes) === 0) {
211 $tpl->setVariable(
"LHIST", $hist_gui->getEmbeddedHTML($from_unix, $to_unix, $classes, $a_mode));
static beforePageDelete(ilPageObject $a_page)
setType(string $a_type)
Set Type.
getPresentation(string $from, string $to, array $classes, string $a_mode)
Get presentation.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
setNode(php4DOMElement $a_node)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLangVars()
Get lang vars needed for editing.
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
Create learning history node.
static getPlaceholderPresentation()
static afterPageHistoryEntry(ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
After page history entry has been created.
insertContent(ilPageContent $a_cont_obj, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="", bool $remove_placeholder=true)
insert a content node before/after a sibling or as first child of a parent
php4DOMElement $lhist_node
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
static afterPageUpdate(ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
createPageContentNode(bool $a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
modifyPageContentPostXsl(string $a_output, string $a_mode, bool $a_abstract_only=false)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl