ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 Init object. More...
 
 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, ?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)
 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)
 Overwrite in derived classes, if old history entries are being deleted. 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 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 = ""
 
- 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=[])
 

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.

Reimplemented from ilPageContent.

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

95 : void {
96 self::saveSkillUsage($a_page, $a_old_domdoc, $a_old_nr);
97 }
static saveSkillUsage(ilPageObject $a_page, DOMDocument $a_domdoc, int $a_old_nr=0)

◆ afterPageUpdate()

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

After page has been updated (or created)

Reimplemented from ilPageContent.

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

67 : void {
68 // pc skill
69 self::saveSkillUsage($a_page, $a_domdoc);
70 }

◆ beforePageDelete()

static ilPCSkills::beforePageDelete ( ilPageObject  $a_page)
static

Before page is being deleted.

Reimplemented from ilPageContent.

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

77 : void {
79 "skmg",
80 $a_page->getParentType() . ":pg",
81 $a_page->getId(),
82 0,
83 $a_page->getLanguage()
84 );
85 }
static deleteAllUsages(string $a_pc_type, string $a_usage_type, int $a_usage_id, int $a_usage_hist_nr=0, string $a_lang="-")

◆ collectSkills()

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

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

129 : array {
130 $xpath = new DOMXPath($a_domdoc);
131 $nodes = $xpath->query('//Skills');
132
133 $skl_ids = array();
134 foreach ($nodes as $node) {
135 $user = $node->getAttribute("User");
136 $id = $node->getAttribute("Id");
137 $inst_id = $node->getAttribute("InstId");
138 $skl_ids[$user . ":" . $id . ":" . $inst_id] = array(
139 "user" => $user, "id" => $id, "inst_id" => $inst_id);
140 }
141
142 return $skl_ids;
143 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
ilObjUser $user

◆ create()

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

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

40 : void {
41 $this->createInitialChildNode($a_hier_id, $a_pc_id, "Skills");
42 }
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])

◆ deleteHistoryLowerEqualThan()

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

Overwrite in derived classes, if old history entries are being deleted.

Reimplemented from ilPageContent.

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

150 : void {
151 global $DIC;
152
153 $usage_repo = $DIC->copage()
154 ->internal()
155 ->repo()
156 ->usage();
157
158 $usage_repo->deleteHistoryUsagesLowerEqualThan(
159 "skmg",
160 $parent_type . ":pg",
161 $page_id,
162 $delete_lower_than_nr,
163 $lang
164 );
165 }
global $DIC
Definition: shib_login.php:26
$lang
Definition: xapiexit.php:25

◆ getSkillId()

ilPCSkills::getSkillId ( )

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

51 : string
52 {
53 if (is_object($this->getChildNode())) {
54 return $this->getChildNode()->getAttribute("Id");
55 }
56 return "";
57 }

◆ init()

ilPCSkills::init ( )

Init object.

This function must be overwritten and at least set the content type.

Reimplemented from ilPageContent.

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

28 : void
29 {
30 global $DIC;
31
32 $this->user = $DIC->user();
33 $this->setType("skills");
34 }
setType(string $a_type)
Set Type.

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

+ 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 99 of file class.ilPCSkills.php.

103 : void {
104 $skl_ids = self::collectSkills($a_page, $a_domdoc);
106 "skmg",
107 $a_page->getParentType() . ":pg",
108 $a_page->getId(),
109 $a_old_nr,
110 $a_page->getLanguage()
111 );
112 foreach ($skl_ids as $skl_id) {
113 if ((int) $skl_id["inst_id"] <= 0) {
115 "skmg",
116 $skl_id["id"],
117 $a_page->getParentType() . ":pg",
118 $a_page->getId(),
119 $a_old_nr,
120 $a_page->getLanguage()
121 );
122 }
123 }
124 }
static collectSkills(ilPageObject $a_page, DOMDocument $a_domdoc)
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="-")

◆ setData()

ilPCSkills::setData ( string  $a_skill_id)

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

44 : void
45 {
46 $ilUser = $this->user;
47 $this->getChildNode()->setAttribute("Id", $a_skill_id);
48 $this->getChildNode()->setAttribute("User", $ilUser->getId());
49 }

Field Documentation

◆ $user

ilObjUser ilPCSkills::$user
protected

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


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