ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPCList Class Reference

Class ilPCList. More...

+ Inheritance diagram for ilPCList:
+ Collaboration diagram for ilPCList:

Public Member Functions

 init ()
 Init page content component. More...
 
 setNode (&$a_node)
 Set pc node. More...
 
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create new list. More...
 
 addItems ($a_nr)
 Add a number of items to list. More...
 
 getOrderType ()
 Set order type. More...
 
 getListType ()
 Get list type. More...
 
 setListType ($a_val)
 Set list type. More...
 
 getNumberingType ()
 Get numbering type. More...
 
 setNumberingType ($a_val)
 Set numbering type. More...
 
 setStartValue ($a_val)
 Set start value. More...
 
 getStartValue ()
 Get start value. More...
 
 setStyleClass ($a_val)
 Set style class. More...
 
 getStyleClass ()
 Get style class. 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 ()
 Get Javascript files. More...
 
 getCssFiles ()
 Get css files. More...
 
 getOnloadCode ()
 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...
 
 readPCId ()
 Read PC Id. More...
 
 writePCId ($a_pc_id)
 Write pc id. More...
 
 isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b. 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...
 

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

Detailed Description

Class ilPCList.

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$

Definition at line 16 of file class.ilPCList.php.

Member Function Documentation

◆ addItems()

ilPCList::addItems (   $a_nr)

Add a number of items to list.

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

52 {
53 for ($i=1; $i<=$a_nr; $i++)
54 {
55 $new_item =& $this->dom->create_element("ListItem");
56 $new_item =& $this->list_node->append_child($new_item);
57 }
58 }

◆ create()

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

Create new list.

Definition at line 40 of file class.ilPCList.php.

41 {
42 $this->node = $this->createPageContentNode();
43 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
44 $this->list_node =& $this->dom->create_element("List");
45 $this->list_node =& $this->node->append_child($this->list_node);
46 }
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:

◆ getListType()

ilPCList::getListType ( )

Get list type.

Definition at line 117 of file class.ilPCList.php.

118 {
119 if ($this->list_node->get_attribute("Type") == "Unordered")
120 {
121 return "Unordered";
122 }
123 return "Ordered";
124 }

◆ getNumberingType()

ilPCList::getNumberingType ( )

Get numbering type.

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

140 {
141 $nt = $this->list_node->get_attribute("NumberingType");
142 switch ($nt)
143 {
144 case "Number":
145 case "Roman":
146 case "roman":
147 case "Alphabetic":
148 case "alphabetic":
149 case "Decimal":
150 return $nt;
151 break;
152
153 default:
154 return "Number";
155 }
156 }

◆ getOrderType()

ilPCList::getOrderType ( )

Set order type.

Get order type

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

91 {
92 if ($this->list_node->get_attribute("Type") == "Unordered")
93 {
94 return "Unordered";
95 }
96
97 $nt = $this->list_node->get_attribute("NumberingType");
98 switch ($nt)
99 {
100 case "Number":
101 case "Roman":
102 case "roman":
103 case "Alphabetic":
104 case "alphabetic":
105 case "Decimal":
106 return $nt;
107 break;
108
109 default:
110 return "Number";
111 }
112 }

◆ getStartValue()

ilPCList::getStartValue ( )

Get start value.

Returns
int start value

Definition at line 203 of file class.ilPCList.php.

204 {
205 return $this->list_node->get_attribute("StartValue");
206 }

◆ getStyleClass()

ilPCList::getStyleClass ( )

Get style class.

Returns
string style class

Definition at line 233 of file class.ilPCList.php.

234 {
235 return $this->list_node->get_attribute("Class");
236 }

◆ init()

ilPCList::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

24 {
25 $this->setType("list");
26 }
setType($a_type)
Set Type.

References ilPageContent\setType().

+ Here is the call graph for this function:

◆ setListType()

ilPCList::setListType (   $a_val)

Set list type.

Parameters
stringlist type

Definition at line 131 of file class.ilPCList.php.

132 {
133 $this->list_node->set_attribute("Type", $a_val);
134 }

◆ setNode()

ilPCList::setNode ( $a_node)

Set pc node.

Reimplemented from ilPageContent.

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

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

◆ setNumberingType()

ilPCList::setNumberingType (   $a_val)

Set numbering type.

Parameters
stringnumbering type

Definition at line 163 of file class.ilPCList.php.

164 {
165 if ($a_val != "")
166 {
167 $this->list_node->set_attribute("NumberingType", $a_val);
168 }
169 else
170 {
171 if ($this->list_node->has_attribute("NumberingType"))
172 {
173 $this->list_node->remove_attribute("NumberingType");
174 }
175 }
176 }

◆ setStartValue()

ilPCList::setStartValue (   $a_val)

Set start value.

Parameters
intstart value

Definition at line 183 of file class.ilPCList.php.

184 {
185 if ($a_val != "")
186 {
187 $this->list_node->set_attribute("StartValue", $a_val);
188 }
189 else
190 {
191 if ($this->list_node->has_attribute("StartValue"))
192 {
193 $this->list_node->remove_attribute("StartValue");
194 }
195 }
196 }

◆ setStyleClass()

ilPCList::setStyleClass (   $a_val)

Set style class.

Parameters
stringstyle class

Definition at line 213 of file class.ilPCList.php.

214 {
215 if (!in_array($a_val, array("", "BulletedList", "NumberedList")))
216 {
217 $this->list_node->set_attribute("Class", $a_val);
218 }
219 else
220 {
221 if ($this->list_node->has_attribute("Class"))
222 {
223 $this->list_node->remove_attribute("Class");
224 }
225 }
226 }

Field Documentation

◆ $list_node

ilPCList::$list_node

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


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