ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilPCSkills Class Reference

Class ilPCSkills. More...

+ Inheritance diagram for ilPCSkills:
+ Collaboration diagram for ilPCSkills:

Public Member Functions

 init ()
 Init page content component. More...
 
 setNode ($a_node)
 Set node. More...
 
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create skill node in xml. More...
 
 setData ($a_skill_id)
 Set skill settings. More...
 
 getSkillId ()
 Get skill mode. More...
 
- Public Member Functions inherited from ilPageContent
 __construct ($a_pg_obj)
 Constructor. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 init ()
 Init object. More...
 
 getType ()
 Get type of page content. More...
 
 setNode ($a_node)
 Set xml node of page content. More...
 
getNode ()
 Get xml node of page content. More...
 
 getJavascriptFiles ($a_mode)
 Get Javascript files. More...
 
 getCssFiles ($a_mode)
 Get css files. More...
 
 getOnloadCode ($a_mode)
 Get on load code. More...
 
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure. More...
 
 getHierId ()
 Get hierarchical id. More...
 
 lookupHierId ()
 Get hierarchical id from dom. More...
 
 readHierId ()
 Read PC Id. More...
 
 setPcId ($a_pcid)
 Set PC Id. More...
 
 getPCId ()
 Get PC Id. More...
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setProfileBackUrl ($url)
 
 getProfileBackUrl ()
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 readPCId ()
 Read PC Id. More...
 
 writePCId ($a_pc_id)
 Write pc id. More...
 
 setEnabled ($value)
 Set Enabled value for page content component. More...
 
 enable ()
 Enable page content. More...
 
 disable ()
 Disable page content. More...
 
 isEnabled ()
 Check whether page content is enabled. More...
 
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 modifyPageContentPostXsl ($a_output, $a_mode, $a_abstract_only=false)
 Modify page content after xsl. More...
 

Static Public Member Functions

static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete ($a_page)
 Before page is being deleted. More...
 
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created. More...
 
static saveSkillUsage ($a_page, $a_domdoc, $a_old_nr=0)
 save content include usages More...
 
static collectSkills ($a_page, $a_domdoc)
 get all content includes that are used within the page More...
 
- Static Public Member Functions inherited from ilPageContent
static incEdId ($ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId ($ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
static haveSameContainer ($ed_id1, $ed_id2)
 Check, if two ids are in same container. More...
 
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId ($a, $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, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content. More...
 
static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete ($a_page)
 Before page is being deleted. More...
 
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created. More...
 

Data Fields

 $dom
 
- Data Fields inherited from ilPageContent
 $hier_id
 
 $node
 
 $dom
 
 $page_lang
 

Protected Attributes

 $user
 
- Protected Attributes inherited from ilPageContent
 $profile_back_url
 
 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

Additional Inherited Members

- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type. More...
 

Detailed Description

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
Version
Id
class.ilPCListItem.php 22210 2009-10-26 09:46:06Z akill

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

Member Function Documentation

◆ afterPageHistoryEntry()

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

After page history entry has been created.

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

Reimplemented from ilPageContent.

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

126 {
127 self::saveSkillUsage($a_page, $a_old_domdoc, $a_old_nr);
128 }
static saveSkillUsage($a_page, $a_domdoc, $a_old_nr=0)
save content include usages

References saveSkillUsage().

+ Here is the call graph for this function:

◆ afterPageUpdate()

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

After page has been updated (or created)

Parameters
object$a_pagepage object
DOMDocument$a_domdocdom document
string$a_xmlxml
bool$a_creationtrue on creation, otherwise false

Reimplemented from ilPageContent.

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

95 {
96 // pc skill
97 self::saveSkillUsage($a_page, $a_domdoc);
98 }

References saveSkillUsage().

+ Here is the call graph for this function:

◆ beforePageDelete()

static ilPCSkills::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

Reimplemented from ilPageContent.

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

106 {
107 require_once('Services/COPage/classes/class.ilPageContentUsage.php'); // Mantis #18636
109 "skmg",
110 $a_page->getParentType() . ":pg",
111 $a_page->getId(),
112 false,
113 $a_page->getLanguage()
114 );
115 }
static deleteAllUsages($a_pc_type, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0, $a_lang="-")
Delete all usages.

References ilPageContentUsage\deleteAllUsages().

+ Here is the call graph for this function:

◆ collectSkills()

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

get all content includes that are used within the page

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

162 {
163 $xpath = new DOMXPath($a_domdoc);
164 $nodes = $xpath->query('//Skills');
165
166 $skl_ids = array();
167 foreach ($nodes as $node) {
168 $user = $node->getAttribute("User");
169 $id = $node->getAttribute("Id");
170 $inst_id = $node->getAttribute("InstId");
171 $skl_ids[$user . ":" . $id . ":" . $inst_id] = array(
172 "user" => $user, "id" => $id, "inst_id" => $inst_id);
173 }
174
175 return $skl_ids;
176 }

References ilPageContent\$node, and $user.

Referenced by saveSkillUsage().

+ Here is the caller graph for this function:

◆ create()

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

Create skill node in xml.

Parameters
object$a_pg_objPage Object
string$a_hier_idHierarchical ID

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

54 {
55 $this->node = $this->createPageContentNode();
56 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
57 $this->skill_node = $this->dom->create_element("Skills");
58 $this->skill_node = $this->node->append_child($this->skill_node);
59 }
const IL_INSERT_AFTER
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)

References ilPageContent\createPageContentNode(), and IL_INSERT_AFTER.

+ Here is the call graph for this function:

◆ getSkillId()

ilPCSkills::getSkillId ( )

Get skill mode.

Returns
string

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

80 {
81 if (is_object($this->skill_node)) {
82 return $this->skill_node->get_attribute("Id");
83 }
84 }

◆ init()

ilPCSkills::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

31 {
32 global $DIC;
33
34 $this->user = $DIC->user();
35 $this->setType("skills");
36 }
user()
Definition: user.php:4
setType($a_type)
Set Type.
$DIC
Definition: xapitoken.php:46

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

+ Here is the call graph for this function:

◆ saveSkillUsage()

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

save content include usages

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

134 {
135 include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
136 $skl_ids = self::collectSkills($a_page, $a_domdoc);
138 "skmg",
139 $a_page->getParentType() . ":pg",
140 $a_page->getId(),
141 $a_old_nr,
142 $a_page->getLanguage()
143 );
144 foreach ($skl_ids as $skl_id) {
145 if ((int) $skl_id["inst_id"] <= 0) {
147 "skmg",
148 $skl_id["id"],
149 $a_page->getParentType() . ":pg",
150 $a_page->getId(),
151 $a_old_nr,
152 $a_page->getLanguage()
153 );
154 }
155 }
156 }
static collectSkills($a_page, $a_domdoc)
get all content includes that are used within the page
static saveUsage($a_pc_type, $a_pc_id, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0, $a_lang="-")
Save usages.

References collectSkills(), ilPageContentUsage\deleteAllUsages(), and ilPageContentUsage\saveUsage().

Referenced by afterPageHistoryEntry(), and afterPageUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setData()

ilPCSkills::setData (   $a_skill_id)

Set skill settings.

Parameters
int$a_skill_id

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

67 {
69
70 $this->skill_node->set_attribute("Id", $a_skill_id);
71 $this->skill_node->set_attribute("User", $ilUser->getId());
72 }
$ilUser
Definition: imgupload.php:18

References $ilUser, and $user.

◆ setNode()

ilPCSkills::setNode (   $a_node)

Set node.

Reimplemented from ilPageContent.

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

42 {
43 parent::setNode($a_node); // this is the PageContent node
44 $this->skill_node = $a_node->first_child(); // this is the skill node
45 }

Field Documentation

◆ $dom

ilPCSkills::$dom

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

◆ $user

ilPCSkills::$user
protected

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

Referenced by collectSkills(), and setData().


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