ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCSkills 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 ilPCSkills:
+ Collaboration diagram for ilPCSkills:

Public Member Functions

 init ()
 
 setNode (php4DOMElement $a_node)
 
 create (ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
 
 setData (string $a_skill_id)
 
 getSkillId ()
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 setNode (php4DOMElement $a_node)
 Set xml node of page content. More...
 
 getNode ()
 
 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...
 
 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)
 After page has been updated (or created) More...
 
static beforePageDelete (ilPageObject $a_page)
 Before page is being deleted. 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 saveSkillUsage (ilPageObject $a_page, DOMDocument $a_domdoc, int $a_old_nr=0)
 
static collectSkills (ilPageObject $a_page, DOMDocument $a_domdoc)
 
static deleteHistoryLowerEqualThan (string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
 
- Static Public Member Functions inherited from ilPageContent
static incEdId (string $ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId (string $ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
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 Attributes

php4DOMElement $skill_node
 
ilObjUser $user
 
- Protected Attributes inherited from ilPageContent
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link
 
string $fullscreen_link
 
string $sourcecode_download_script
 
ilLogger $log
 
string $profile_back_url = ""
 

Additional Inherited Members

- Data Fields inherited from ilPageContent
string $hier_id = ""
 
php4DOMElement $node = null
 
php4DOMDocument $dom = null
 
string $page_lang = ""
 
- Protected Member Functions inherited from ilPageContent
 setType (string $a_type)
 Set Type. More...
 

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 Class ilPCSkills Skills content object (see ILIAS DTD)

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 24 of file class.ilPCSkills.php.

Member Function Documentation

◆ afterPageHistoryEntry()

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

After page history entry has been created.

Definition at line 101 of file class.ilPCSkills.php.

106  : void {
107  self::saveSkillUsage($a_page, $a_old_domdoc, $a_old_nr);
108  }

◆ afterPageUpdate()

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

After page has been updated (or created)

Definition at line 73 of file class.ilPCSkills.php.

78  : void {
79  // pc skill
80  self::saveSkillUsage($a_page, $a_domdoc);
81  }

◆ beforePageDelete()

static ilPCSkills::beforePageDelete ( ilPageObject  $a_page)
static

Before page is being deleted.

Definition at line 86 of file class.ilPCSkills.php.

References ilPageContentUsage\deleteAllUsages(), ilPageObject\getId(), ilPageObject\getLanguage(), and ilPageObject\getParentType().

88  : void {
90  "skmg",
91  $a_page->getParentType() . ":pg",
92  $a_page->getId(),
93  0,
94  $a_page->getLanguage()
95  );
96  }
static deleteAllUsages(string $a_pc_type, string $a_usage_type, int $a_usage_id, int $a_usage_hist_nr=0, string $a_lang="-")
+ Here is the call graph for this function:

◆ collectSkills()

static ilPCSkills::collectSkills ( ilPageObject  $a_page,
DOMDocument  $a_domdoc 
)
static

Definition at line 137 of file class.ilPCSkills.php.

References $id, and ilPageContent\$node.

140  : array {
141  $xpath = new DOMXPath($a_domdoc);
142  $nodes = $xpath->query('//Skills');
143 
144  $skl_ids = array();
145  foreach ($nodes as $node) {
146  $user = $node->getAttribute("User");
147  $id = $node->getAttribute("Id");
148  $inst_id = $node->getAttribute("InstId");
149  $skl_ids[$user . ":" . $id . ":" . $inst_id] = array(
150  "user" => $user, "id" => $id, "inst_id" => $inst_id);
151  }
152 
153  return $skl_ids;
154  }
php4DOMElement $node
ilObjUser $user
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ create()

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

Definition at line 43 of file class.ilPCSkills.php.

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

47  : void {
48  $this->node = $this->createPageContentNode();
49  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
50  $this->skill_node = $this->dom->create_element("Skills");
51  $this->skill_node = $this->node->append_child($this->skill_node);
52  }
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:

◆ deleteHistoryLowerEqualThan()

static ilPCSkills::deleteHistoryLowerEqualThan ( string  $parent_type,
int  $page_id,
string  $lang,
int  $delete_lower_than_nr 
)
static

Definition at line 156 of file class.ilPCSkills.php.

References $DIC.

161  : void {
162  global $DIC;
163 
164  $usage_repo = $DIC->copage()
165  ->internal()
166  ->repo()
167  ->usage();
168 
169  $usage_repo->deleteHistoryUsagesLowerEqualThan(
170  "skmg",
171  $parent_type . ":pg",
172  $page_id,
173  $delete_lower_than_nr,
174  $lang
175  );
176  }
global $DIC
Definition: feed.php:28
$lang
Definition: xapiexit.php:26

◆ getSkillId()

ilPCSkills::getSkillId ( )

Definition at line 62 of file class.ilPCSkills.php.

62  : string
63  {
64  if (is_object($this->skill_node)) {
65  return $this->skill_node->get_attribute("Id");
66  }
67  return "";
68  }

◆ init()

ilPCSkills::init ( )

Definition at line 29 of file class.ilPCSkills.php.

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

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

◆ saveSkillUsage()

static ilPCSkills::saveSkillUsage ( ilPageObject  $a_page,
DOMDocument  $a_domdoc,
int  $a_old_nr = 0 
)
static

Definition at line 110 of file class.ilPCSkills.php.

References ilPageContentUsage\deleteAllUsages(), ilPageObject\getId(), ilPageObject\getLanguage(), ilPageObject\getParentType(), and ilPageContentUsage\saveUsage().

114  : void {
115  $skl_ids = self::collectSkills($a_page, $a_domdoc);
117  "skmg",
118  $a_page->getParentType() . ":pg",
119  $a_page->getId(),
120  $a_old_nr,
121  $a_page->getLanguage()
122  );
123  foreach ($skl_ids as $skl_id) {
124  if ((int) $skl_id["inst_id"] <= 0) {
126  "skmg",
127  $skl_id["id"],
128  $a_page->getParentType() . ":pg",
129  $a_page->getId(),
130  $a_old_nr,
131  $a_page->getLanguage()
132  );
133  }
134  }
135  }
static saveUsage(string $a_pc_type, int $a_pc_id, string $a_usage_type, int $a_usage_id, int $a_usage_hist_nr=0, string $a_lang="-")
static deleteAllUsages(string $a_pc_type, string $a_usage_type, int $a_usage_id, int $a_usage_hist_nr=0, string $a_lang="-")
+ Here is the call graph for this function:

◆ setData()

ilPCSkills::setData ( string  $a_skill_id)

Definition at line 54 of file class.ilPCSkills.php.

References $ilUser, and $user.

54  : void
55  {
57 
58  $this->skill_node->set_attribute("Id", $a_skill_id);
59  $this->skill_node->set_attribute("User", $ilUser->getId());
60  }
ilObjUser $user
$ilUser
Definition: imgupload.php:34

◆ setNode()

ilPCSkills::setNode ( php4DOMElement  $a_node)

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

References php4DOMNode\first_child().

37  : void
38  {
39  parent::setNode($a_node); // this is the PageContent node
40  $this->skill_node = $a_node->first_child(); // this is the skill node
41  }
+ Here is the call graph for this function:

Field Documentation

◆ $skill_node

php4DOMElement ilPCSkills::$skill_node
protected

Definition at line 26 of file class.ilPCSkills.php.

◆ $user

ilObjUser ilPCSkills::$user
protected

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

Referenced by setData().


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