ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPCFileItem Class Reference

Class ilPCFileItem. More...

+ Inheritance diagram for ilPCFileItem:
+ Collaboration diagram for ilPCFileItem:

Public Member Functions

 init ()
 Init page content component. More...
 
 newItemAfter ($a_id, $a_location, $a_format)
 insert new list item after current one More...
 
 newItemBefore ($a_id, $a_location, $a_format)
 insert new list item before current one More...
 
 deleteItem ()
 Delete file item. More...
 
 moveItemDown ()
 move list item down More...
 
 moveItemUp ()
 move list item up 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...
 
 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)
 Modify page content after xsl. More...
 

Additional Inherited Members

- 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 inherited from ilPageContent
 $hier_id
 
 $node
 
 $dom
 
 $page_lang
 
- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type. More...
 
- Protected Attributes inherited from ilPageContent
 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

Detailed Description

Class ilPCFileItem.

File Item 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$

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

Member Function Documentation

◆ deleteItem()

ilPCFileItem::deleteItem ( )

Delete file item.

Definition at line 91 of file class.ilPCFileItem.php.

References ilPageContent\getNode().

92  {
93  $li = $this->getNode();
94  $li->unlink($li);
95  }
& getNode()
Get xml node of page content.
+ Here is the call graph for this function:

◆ init()

ilPCFileItem::init ( )

Init page content component.

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

References ilPageContent\setType().

24  {
25  $this->setType("flit");
26  }
setType($a_type)
Set Type.
+ Here is the call graph for this function:

◆ moveItemDown()

ilPCFileItem::moveItemDown ( )

move list item down

Definition at line 100 of file class.ilPCFileItem.php.

References ilPageContent\getNode().

101  {
102  $li = $this->getNode();
103  $next = $li->next_sibling();
104  $next_copy = $next->clone_node(true);
105  $next_copy = $li->insert_before($next_copy, $li);
106  $next->unlink($next);
107  }
& getNode()
Get xml node of page content.
+ Here is the call graph for this function:

◆ moveItemUp()

ilPCFileItem::moveItemUp ( )

move list item up

Definition at line 112 of file class.ilPCFileItem.php.

References ilPageContent\getNode().

113  {
114  $li = $this->getNode();
115  $prev = $li->previous_sibling();
116  $li_copy = $li->clone_node(true);
117  $li_copy = $prev->insert_before($li_copy, $prev);
118  $li->unlink($li);
119  }
& getNode()
Get xml node of page content.
+ Here is the call graph for this function:

◆ newItemAfter()

ilPCFileItem::newItemAfter (   $a_id,
  $a_location,
  $a_format 
)

insert new list item after current one

Definition at line 31 of file class.ilPCFileItem.php.

References ilPageContent\getNode().

32  {
33  $li = $this->getNode();
34  $new_item = $this->dom->create_element("FileItem");
35  if ($next_li = $li->next_sibling()) {
36  $new_item = $next_li->insert_before($new_item, $next_li);
37  } else {
38  $parent_list = $li->parent_node();
39  $new_item = $parent_list->append_child($new_item);
40  }
41 
42  // Identifier
43  $id_node = $this->dom->create_element("Identifier");
44  $id_node = $new_item->append_child($id_node);
45  $id_node->set_attribute("Catalog", "ILIAS");
46  $id_node->set_attribute("Entry", "il__file_" . $a_id);
47 
48  // Location
49  $loc_node = $this->dom->create_element("Location");
50  $loc_node = $new_item->append_child($loc_node);
51  $loc_node->set_attribute("Type", "LocalFile");
52  $loc_node->set_content($a_location);
53 
54  // Format
55  $form_node = $this->dom->create_element("Format");
56  $form_node = $new_item->append_child($form_node);
57  $form_node->set_content($a_format);
58  }
& getNode()
Get xml node of page content.
+ Here is the call graph for this function:

◆ newItemBefore()

ilPCFileItem::newItemBefore (   $a_id,
  $a_location,
  $a_format 
)

insert new list item before current one

Definition at line 64 of file class.ilPCFileItem.php.

References ilPageContent\getNode().

65  {
66  $li = $this->getNode();
67  $new_item = $this->dom->create_element("FileItem");
68  $new_item = $li->insert_before($new_item, $li);
69 
70  // Identifier
71  $id_node = $this->dom->create_element("Identifier");
72  $id_node = $new_item->append_child($id_node);
73  $id_node->set_attribute("Catalog", "ILIAS");
74  $id_node->set_attribute("Entry", "il__file_" . $a_id);
75 
76  // Location
77  $loc_node = $this->dom->create_element("Location");
78  $loc_node = $new_item->append_child($loc_node);
79  $loc_node->set_attribute("Type", "LocalFile");
80  $loc_node->set_content($a_location);
81 
82  // Format
83  $form_node = $this->dom->create_element("Format");
84  $form_node = $new_item->append_child($form_node);
85  $form_node->set_content($a_format);
86  }
& getNode()
Get xml node of page content.
+ Here is the call graph for this function:

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