ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPCLearningHistory 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 ilPCLearningHistory:
+ Collaboration diagram for ilPCLearningHistory:

Public Member Functions

 init ()
 
 create (ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
 Create learning history node. More...
 
 setFrom (string $a_val)
 
 getFrom ()
 
 setTo (string $a_val)
 
 getTo ()
 
 setClasses (array $a_val)
 
 getClasses ()
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj, ?PageManagerInterface $page_manager=null, ?ObjectAdapterInterface $object_adapter=null)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 getDomNode ()
 
 getDomDoc ()
 
 setDomNode (DOMNode $node)
 
 getChildNode ()
 
 getJavascriptFiles (string $a_mode)
 
 getCssFiles (string $a_mode)
 
 getOnloadCode (string $a_mode)
 
 setHierId (string $a_hier_id)
 
 getHierId ()
 
 lookupHierId ()
 
 readHierId ()
 
 setPcId (string $a_pcid)
 
 getPCId ()
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setProfileBackUrl (string $url)
 
 getProfileBackUrl ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 readPCId ()
 
 writePCId (string $a_pc_id)
 
 setEnabled (string $value)
 Set Enabled value for page content component. More...
 
 enable ()
 
 disable ()
 
 isEnabled ()
 
 createPageContentNode (bool $a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 getNewPageContentNode ()
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 Get model as needed for the front-end editor. More...
 

Static Public Member Functions

static afterPageUpdate (ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
 
static beforePageDelete (ilPageObject $a_page)
 
static afterPageHistoryEntry (ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
 After page history entry has been created. More...
 
static getLangVars ()
 Get lang vars needed for editing. More...
 
- Static Public Member Functions inherited from ilPageContent
static sortHierIds (array $a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId (string $a, string $b)
 Check whether Hier ID $a is greater than Hier ID $b. More...
 
static getLangVars ()
 Get lang vars needed for editing. More...
 
static handleCopiedContent (DOMDocument $a_domdoc, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 Handle copied content. More...
 
static afterPageUpdate (ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete (ilPageObject $a_page)
 Before page is being deleted. More...
 
static afterRepositoryCopy (ilPageObject $page, array $mapping, int $source_ref_id)
 After repository (container) copy action. More...
 
static afterPageHistoryEntry (ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
 After page history entry has been created. More...
 
static deleteHistoryLowerEqualThan (string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
 Overwrite in derived classes, if old history entries are being deleted. More...
 

Protected Member Functions

 getPresentation (string $from, string $to, array $classes, string $a_mode)
 Get presentation. More...
 
- Protected Member Functions inherited from ilPageContent
 getPageManager ()
 
 setType (string $a_type)
 Set Type. More...
 
 hasNode ()
 
 createInitialChildNode (string $hier_id, string $pc_id, string $child, array $child_attributes=[])
 

Protected Attributes

ilObjUser $user
 
- Protected Attributes inherited from ilPageContent
DOMDocument $dom_doc
 
ILIAS COPage InternalDomainService $domain
 
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link
 
string $fullscreen_link
 
string $sourcecode_download_script
 
ilLogger $log
 
string $profile_back_url = ""
 
ILIAS COPage Dom DomUtil $dom_util
 
PageManagerInterface $page_manager = null
 
ObjectAdapterInterface $object = null
 

Additional Inherited Members

- Data Fields inherited from ilPageContent
string $hier_id = ""
 
DOMNode $dom_node = null
 
string $page_lang = ""
 

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 Learning history page content

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.ilPCLearningHistory.php.

Member Function Documentation

◆ afterPageHistoryEntry()

static ilPCLearningHistory::afterPageHistoryEntry ( ilPageObject  $a_page,
DOMDocument  $a_old_domdoc,
string  $a_old_xml,
int  $a_old_nr 
)
static

After page history entry has been created.

Parameters
ilPageObject$a_pagepage object
DOMDocument$a_old_domdocold dom document
string$a_old_xmlold xml
int$a_old_nrhistory number

Definition at line 112 of file class.ilPCLearningHistory.php.

117  : void {
118  }

◆ afterPageUpdate()

static ilPCLearningHistory::afterPageUpdate ( ilPageObject  $a_page,
DOMDocument  $a_domdoc,
string  $a_xml,
bool  $a_creation 
)
static

Definition at line 92 of file class.ilPCLearningHistory.php.

97  : void {
98  }

◆ beforePageDelete()

static ilPCLearningHistory::beforePageDelete ( ilPageObject  $a_page)
static

Definition at line 100 of file class.ilPCLearningHistory.php.

102  : void {
103  }

◆ create()

ilPCLearningHistory::create ( ilPageObject  $a_pg_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Create learning history node.

Definition at line 38 of file class.ilPCLearningHistory.php.

References ilPageContent\createPageContentNode(), ilPageContent\getDomNode(), IL_INSERT_AFTER, and ilPageObject\insertContent().

38  : void
39  {
40  $this->createPageContentNode();
41  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
42  $lhist_node = $this->dom_doc->createElement("LearningHistory");
43  $lhist_node = $this->getDomNode()->appendChild($lhist_node);
44  }
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
const IL_INSERT_AFTER
createPageContentNode(bool $a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
+ Here is the call graph for this function:

◆ getClasses()

ilPCLearningHistory::getClasses ( )

Definition at line 81 of file class.ilPCLearningHistory.php.

References ilPageContent\getChildNode().

81  : array
82  {
83  $classes = [];
84  // delete properties
85  $children = $this->getChildNode()->childNodes;
86  foreach ($children as $iValue) {
87  $classes[] = $iValue->getAttribute("Name");
88  }
89  return $classes;
90  }
+ Here is the call graph for this function:

◆ getFrom()

ilPCLearningHistory::getFrom ( )

Definition at line 51 of file class.ilPCLearningHistory.php.

References ilPageContent\getChildNode().

51  : string
52  {
53  return (string) $this->getChildNode()->getAttribute("From");
54  }
+ Here is the call graph for this function:

◆ getLangVars()

static ilPCLearningHistory::getLangVars ( )
static

Get lang vars needed for editing.

Definition at line 123 of file class.ilPCLearningHistory.php.

123  : array
124  {
125  return array("ed_insert_learning_history", "pc_learning_history");
126  }

◆ getPresentation()

ilPCLearningHistory::getPresentation ( string  $from,
string  $to,
array  $classes,
string  $a_mode 
)
protected

Get presentation.

Exceptions
ilCtrlException
ilDateTimeException

Definition at line 174 of file class.ilPCLearningHistory.php.

References $user_id, ilObject\_lookupOwner(), ilPageContent\getPage(), ilPCLearningHistoryGUI\getPlaceholderPresentation(), IL_CAL_DATETIME, IL_CAL_UNIX, and null.

Referenced by modifyPageContentPostXsl().

179  : string {
180  $user_id = 0;
181  if ($a_mode === "preview" || $a_mode === "presentation" || $a_mode === "print") {
182  if ($this->getPage()->getParentType() === "prtf") {
183  $user_id = ilObject::_lookupOwner($this->getPage()->getPortfolioId());
184  }
185  }
186  if ($user_id > 0) {
187  $tpl = new ilTemplate("tpl.pc_lhist.html", true, true, "components/ILIAS/LearningHistory");
188  $hist_gui = new ilLearningHistoryGUI();
189  $hist_gui->setUserId($user_id);
190  $from_unix = ($from != "")
191  ? (new ilDateTime($from . " 00:00:00", IL_CAL_DATETIME))->get(IL_CAL_UNIX)
192  : null;
193  $to_unix = ($to != "")
194  ? (new ilDateTime($to . " 23:59:59", IL_CAL_DATETIME))->get(IL_CAL_UNIX)
195  : null;
196  $classes = (is_array($classes))
197  ? array_filter($classes, static function ($i): bool {
198  return ($i != "");
199  })
200  : [];
201  if (count($classes) === 0) {
202  $classes = null;
203  }
204  $tpl->setVariable("LHIST", $hist_gui->getEmbeddedHTML($from_unix, $to_unix, $classes, $a_mode));
205  return $tpl->get();
206  }
207 
209  }
const IL_CAL_DATETIME
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
const IL_CAL_UNIX
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTo()

ilPCLearningHistory::getTo ( )

Definition at line 61 of file class.ilPCLearningHistory.php.

References ilPageContent\getChildNode().

61  : string
62  {
63  return (string) $this->getChildNode()->getAttribute("To");
64  }
+ Here is the call graph for this function:

◆ init()

ilPCLearningHistory::init ( )

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

References $DIC, ilPageContent\setType(), and ILIAS\Repository\user().

27  : void
28  {
29  global $DIC;
30 
31  $this->user = $DIC->user();
32  $this->setType("lhist");
33  }
setType(string $a_type)
Set Type.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

ilPCLearningHistory::modifyPageContentPostXsl ( string  $a_output,
string  $a_mode,
bool  $a_abstract_only = false 
)

Definition at line 128 of file class.ilPCLearningHistory.php.

References $param, and getPresentation().

132  : string {
133  $start = strpos($a_output, "{{{{{LearningHistory");
134  $end = 0;
135  if (is_int($start)) {
136  $end = strpos($a_output, "}}}}}", $start);
137  }
138 
139  while ($end > 0) {
140  $param = substr($a_output, $start + 5, $end - $start - 5);
141  $param = str_replace(' xmlns:xhtml="http://www.w3.org/1999/xhtml"', "", $param);
142  $param = explode("#", $param);
143  $from = $param[1];
144  $to = $param[2];
145  $classes = explode(";", $param[3]);
146  $classes = array_map(static function ($i) {
147  return trim($i);
148  }, $classes);
149 
150 
151  $a_output = substr($a_output, 0, $start) .
152  $this->getPresentation($from, $to, $classes, $a_mode) .
153  substr($a_output, $end + 5);
154 
155  if (strlen($a_output) > $start + 5) {
156  $start = strpos($a_output, "{{{{{LearningHistory", $start + 5);
157  } else {
158  $start = false;
159  }
160  $end = 0;
161  if (is_int($start)) {
162  $end = strpos($a_output, "}}}}}", $start);
163  }
164  }
165 
166  return $a_output;
167  }
getPresentation(string $from, string $to, array $classes, string $a_mode)
Get presentation.
$param
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ setClasses()

ilPCLearningHistory::setClasses ( array  $a_val)

Definition at line 66 of file class.ilPCLearningHistory.php.

References ilPageContent\getChildNode().

66  : void
67  {
68  // delete properties
69  $children = $this->getChildNode()->childNodes;
70  foreach ($children as $iValue) {
71  $this->getChildNode()->removeChild($iValue);
72  }
73  // set classes
74  foreach ($a_val as $key => $class) {
75  $prop_node = $this->dom_doc->createElement("LearningHistoryProvider");
76  $prop_node = $this->getChildNode()->appendChild($prop_node);
77  $prop_node->setAttribute("Name", $class);
78  }
79  }
+ Here is the call graph for this function:

◆ setFrom()

ilPCLearningHistory::setFrom ( string  $a_val)

Definition at line 46 of file class.ilPCLearningHistory.php.

References ilPageContent\getChildNode().

46  : void
47  {
48  $this->getChildNode()->setAttribute("From", $a_val);
49  }
+ Here is the call graph for this function:

◆ setTo()

ilPCLearningHistory::setTo ( string  $a_val)

Definition at line 56 of file class.ilPCLearningHistory.php.

References ilPageContent\getChildNode().

56  : void
57  {
58  $this->getChildNode()->setAttribute("To", $a_val);
59  }
+ Here is the call graph for this function:

Field Documentation

◆ $user

ilObjUser ilPCLearningHistory::$user
protected

Definition at line 25 of file class.ilPCLearningHistory.php.


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