ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPCFileList Class Reference

Class ilPCFileList. More...

+ Inheritance diagram for ilPCFileList:
+ Collaboration diagram for ilPCFileList:

Public Member Functions

 init ()
 Init page content component.
 setNode (&$a_node)
 Set xml node of page content.
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 appendItem ($a_id, $a_location, $a_format)
 setListTitle ($a_title, $a_language)
 getListTitle ()
 getLanguage ()
 getFileList ()
 Get list of files.
 deleteFileItems ($a_ids)
 Delete file items.
 savePositions ($a_pos)
 Save positions of file items.
 getAllClasses ()
 Get all style classes.
 saveStyleClasses ($a_class)
 Save style classes of file items.
- Public Member Functions inherited from ilPageContent
 __construct ($a_dom)
 Constructor.
 getType ()
 Get type of page content.
getNode ()
 Get xml node of page content.
 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.
 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)

Data Fields

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

Additional Inherited Members

- 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.
- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type.

Detailed Description

Class ilPCFileList.

File List content object (see ILIAS DTD)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilPCFileList.php 18368 2009-01-07 11:06:08Z akill

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

Member Function Documentation

ilPCFileList::appendItem (   $a_id,
  $a_location,
  $a_format 
)

Definition at line 72 of file class.ilPCFileList.php.

{
// File Item
$new_item =& $this->dom->create_element("FileItem");
$new_item =& $this->list_node->append_child($new_item);
// Identifier
$id_node =& $this->dom->create_element("Identifier");
$id_node =& $new_item->append_child($id_node);
$id_node->set_attribute("Catalog", "ILIAS");
$id_node->set_attribute("Entry", "il__file_".$a_id);
// Location
$loc_node =& $this->dom->create_element("Location");
$loc_node =& $new_item->append_child($loc_node);
$loc_node->set_attribute("Type", "LocalFile");
$loc_node->set_content($a_location);
// Format
$form_node =& $this->dom->create_element("Format");
$form_node =& $new_item->append_child($form_node);
$form_node->set_content($a_format);
}
ilPCFileList::create ( $a_pg_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Definition at line 54 of file class.ilPCFileList.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->list_node =& $this->dom->create_element("FileList");
$this->list_node =& $this->node->append_child($this->list_node);
}

+ Here is the call graph for this function:

ilPCFileList::deleteFileItems (   $a_ids)

Delete file items.

Definition at line 169 of file class.ilPCFileList.php.

References $files, and ilPageContent\$hier_id.

{
$files = array();
// File Item
$childs = $this->list_node->child_nodes();
for ($i=0; $i<count($childs); $i++)
{
if ($childs[$i]->node_name() == "FileItem")
{
$id = $entry = "";
$pc_id = $childs[$i]->get_attribute("PCID");
$hier_id = $childs[$i]->get_attribute("HierId");
if (in_array($hier_id.":".$pc_id, $a_ids))
{
$childs[$i]->unlink($childs[$i]);
}
}
}
}
ilPCFileList::getAllClasses ( )

Get all style classes.

Definition at line 226 of file class.ilPCFileList.php.

{
$classes = array();
// File Item
$childs = $this->list_node->child_nodes();
for ($i=0; $i<count($childs); $i++)
{
if ($childs[$i]->node_name() == "FileItem")
{
$classes[$childs[$i]->get_attribute("HierId").":".
$childs[$i]->get_attribute("PCID")] = $childs[$i]->get_attribute("Class");
}
}
return $classes;
}
ilPCFileList::getFileList ( )

Get list of files.

Definition at line 132 of file class.ilPCFileList.php.

References $files, and ilPageContent\$hier_id.

{
$files = array();
// File Item
$childs = $this->list_node->child_nodes();
for ($i=0; $i<count($childs); $i++)
{
if ($childs[$i]->node_name() == "FileItem")
{
$id = $entry = "";
$pc_id = $childs[$i]->get_attribute("PCID");
$hier_id = $childs[$i]->get_attribute("HierId");
$class = $childs[$i]->get_attribute("Class");
// Identifier
$id_node = $childs[$i]->first_child();
if ($id_node->node_name() == "Identifier")
{
$entry = $id_node->get_attribute("Entry");
if (substr($entry, 0, 9) == "il__file_")
{
$id = substr($entry, 9);
}
}
$files[] = array("entry" => $entry, "id" => $id,
"pc_id" => $pc_id, "hier_id" => $hier_id,
"class" => $class);
}
}
return $files;
}
ilPCFileList::getLanguage ( )

Definition at line 116 of file class.ilPCFileList.php.

{
$chlds =& $this->list_node->child_nodes();
for($i=0; $i<count($chlds); $i++)
{
if ($chlds[$i]->node_name() == "Title")
{
return $chlds[$i]->get_attribute("Language");
}
}
return "";
}
ilPCFileList::getListTitle ( )

Definition at line 103 of file class.ilPCFileList.php.

{
$chlds =& $this->list_node->child_nodes();
for($i=0; $i<count($chlds); $i++)
{
if ($chlds[$i]->node_name() == "Title")
{
return $chlds[$i]->get_content();
}
}
return "";
}
ilPCFileList::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

References ilPageContent\setType().

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

+ Here is the call graph for this function:

ilPCFileList::savePositions (   $a_pos)

Save positions of file items.

Definition at line 195 of file class.ilPCFileList.php.

References ilPageContent\$hier_id.

{
asort($a_pos);
// File Item
$childs = $this->list_node->child_nodes();
$nodes = array();
for ($i=0; $i<count($childs); $i++)
{
if ($childs[$i]->node_name() == "FileItem")
{
$id = $entry = "";
$pc_id = $childs[$i]->get_attribute("PCID");
$hier_id = $childs[$i]->get_attribute("HierId");
$nodes[$hier_id.":".$pc_id] = $childs[$i];
$childs[$i]->unlink($childs[$i]);
}
}
foreach($a_pos as $k => $v)
{
if (is_object($nodes[$k]))
{
$nodes[$k] = $this->list_node->append_child($nodes[$k]);
}
}
}
ilPCFileList::saveStyleClasses (   $a_class)

Save style classes of file items.

Definition at line 248 of file class.ilPCFileList.php.

{
// File Item
$childs = $this->list_node->child_nodes();
for ($i=0; $i<count($childs); $i++)
{
if ($childs[$i]->node_name() == "FileItem")
{
$childs[$i]->set_attribute("Class",
$a_class[$childs[$i]->get_attribute("HierId").":".
$childs[$i]->get_attribute("PCID")]);
}
}
}
ilPCFileList::setListTitle (   $a_title,
  $a_language 
)

Definition at line 96 of file class.ilPCFileList.php.

References ilDOMUtil\setFirstOptionalElement().

{
$this->list_node, "Title", array("FileItem"),
$a_title, array("Language" => $a_language));
}

+ Here is the call graph for this function:

ilPCFileList::setNode ( $a_node)

Set xml node of page content.

Parameters
object$a_nodenode object

Reimplemented from ilPageContent.

Definition at line 48 of file class.ilPCFileList.php.

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

Field Documentation

ilPCFileList::$list_node

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


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