ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPCSkills Class Reference

Class ilPCSkills. More...

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

Public Member Functions

 init ()
 Init page content component.
 setNode (&$a_node)
 Set node.
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create skill node in xml.
 setData ($a_skill_id)
 Set skill settings.
 getSkillId ()
 Get skill mode.
- Public Member Functions inherited from ilPageContent
 __construct ($a_pg_obj)
 Constructor.
 setPage ($a_val)
 Set page.
 getPage ()
 Get page.
 getType ()
 Get type of page content.
getNode ()
 Get xml node of page content.
 getJavascriptFiles ()
 Get Javascript files.
 getCssFiles ()
 Get css files.
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure.
 getHierId ()
 Get hierarchical id.
 lookupHierId ()
 Get hierarchical id from dom.
 readHierId ()
 Read PC Id.
 setPcId ($a_pcid)
 Set PC Id.
 getPCId ()
 Get PC Id.
 readPCId ()
 Read PC Id.
 writePCId ($a_pc_id)
 Write pc id.
 isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b.
 setEnabled ($value)
 Set Enabled value for page content component.
 enable ()
 Enable page content.
 disable ()
 Disable page content.
 isEnabled ()
 Check whether page content is enabled.
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element)
 modifyPageContentPostXsl ($a_output, $a_mode)
 Modify page content after xsl.

Static Public Member Functions

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

Data Fields

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

Additional Inherited Members

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

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

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

References saveSkillUsage().

{
self::saveSkillUsage($a_page, $a_old_domdoc, $a_old_nr);
}

+ Here is the call graph for this function:

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

References saveSkillUsage().

{
// pc skill
self::saveSkillUsage($a_page, $a_domdoc);
}

+ Here is the call graph for this function:

static ilPCSkills::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

Reimplemented from ilPageContent.

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

References ilPageContentUsage\deleteAllUsages().

{
ilPageContentUsage::deleteAllUsages("skmg", $a_page->getParentType().":pg", $a_page->getId(), false,
$a_page->getLanguage());
}

+ Here is the call graph for this function:

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

get all content includes that are used within the page

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

References ilPageContent\$node.

Referenced by saveSkillUsage().

{
$xpath = new DOMXPath($a_domdoc);
$nodes = $xpath->query('//Skills');
$skl_ids = array();
foreach($nodes as $node)
{
$user = $node->getAttribute("User");
$id = $node->getAttribute("Id");
$inst_id = $node->getAttribute("InstId");
$skl_ids[$user.":".$id.":".$inst_id] = array(
"user" => $user, "id" => $id, "inst_id" => $inst_id);
}
return $skl_ids;
}

+ Here is the caller graph for this function:

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

References ilPageContent\createPageContentNode(), and IL_INSERT_AFTER.

{
$this->node = $this->createPageContentNode();
$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
$this->skill_node = $this->dom->create_element("Skills");
$this->skill_node = $this->node->append_child($this->skill_node);
}

+ Here is the call graph for this function:

ilPCSkills::getSkillId ( )

Get skill mode.

Returns
string

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

{
if (is_object($this->skill_node))
{
return $this->skill_node->get_attribute("Id");
}
}
ilPCSkills::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

References ilPageContent\setType().

{
$this->setType("skills");
}

+ Here is the call graph for this function:

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

save content include usages

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

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

Referenced by afterPageHistoryEntry(), and afterPageUpdate().

{
include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
$skl_ids = self::collectSkills($a_page, $a_domdoc);
ilPageContentUsage::deleteAllUsages("skmg", $a_page->getParentType().":pg", $a_page->getId(), $a_old_nr,
$a_page->getLanguage());
foreach($skl_ids as $skl_id)
{
if ((int) $skl_id["inst_id"] <= 0)
{
ilPageContentUsage::saveUsage("skmg", $skl_id["id"], $a_page->getParentType().":pg", $a_page->getId(), $a_old_nr,
$a_page->getLanguage());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCSkills::setData (   $a_skill_id)

Set skill settings.

Parameters
int$a_skill_id

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

References $ilUser.

{
global $ilUser;
$this->skill_node->set_attribute("Id", $a_skill_id);
$this->skill_node->set_attribute("User", $ilUser->getId());
}
ilPCSkills::setNode ( $a_node)

Set node.

Reimplemented from ilPageContent.

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

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

Field Documentation

ilPCSkills::$dom

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


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