33 $this->dom = $a_pg_obj->getDom();
37 die (
"Error: ilPageContent::init() did not set type");
48 $this->pg_obj = $a_val;
65 abstract function init();
74 $this->type = $a_type;
94 $this->node =& $a_node;
131 $this->hier_id = $a_hier_id;
148 return $this->node->get_attribute(
"HierId");
158 if (is_object($this->node))
160 return $this->node->get_attribute(
"HierId");
171 $this->pcid = $a_pcid;
192 if (is_object($this->node))
194 return $this->node->get_attribute(
"PCID");
203 if (is_object($this->node))
205 $this->node->set_attribute(
"PCID", $a_pc_id);
218 $id = explode(
"_", $ed_id);
219 $id[count($id) - 1]++;
221 return implode($id,
"_");
233 $id = explode(
"_", $ed_id);
234 $id[count($id) - 1]--;
236 return implode($id,
"_");
249 $id1 = explode(
"_", $ed_id1);
250 $id2 = explode(
"_", $ed_id1);
251 if(count($id1) == count($id2))
255 foreach ($id1 as $key => $id)
257 if($id != $id2[$key])
272 uasort($a_array, array(
"ilPageContent",
"isGreaterHierId"));
282 $a_arr = explode(
"_", $a);
283 $b_arr = explode(
"_", $b);
284 for ($i = 0; $i < count($a_arr); $i++)
286 if ((
int) $a_arr[$i] > (int) $b_arr[$i])
290 else if ((
int) $a_arr[$i] < (int) $b_arr[$i])
306 if (is_object($this->node))
308 $this->node->set_attribute(
"Enabled", $value);
335 if (is_object($this->node) && $this->node->has_attribute(
"Enabled"))
337 $compare = $this->node->get_attribute(
"Enabled");
344 return strcasecmp($compare,
"true") == 0;
352 $node = $this->dom->create_element(
"PageContent");
353 if ($a_set_this_node)
setPcId($a_pcid)
Set PC Id.
static incEdId($ed_id)
Increases an hierarchical editing id at lowest level (last number)
getCssFiles()
Get css files.
lookupHierId()
Get hierarchical id from dom.
getJavascriptFiles()
Get Javascript files.
disable()
Disable page content.
getType()
Get type of page content.
static sortHierIds($a_array)
Sort an array of Hier IDS in ascending order.
isGreaterHierId($a, $b)
Check whether Hier ID $a is greater than Hier ID $b.
& getNode()
Get xml node of page content.
setEnabled($value)
Set Enabled value for page content component.
static getLangVars()
Get lang vars needed for editing.
static beforePageDelete($a_page)
Before page is being deleted.
setType($a_type)
Set Type.
modifyPageContentPostXsl($a_output, $a_mode)
Modify page content after xsl.
static haveSameContainer($ed_id1, $ed_id2)
Check, if two ids are in same container.
__construct($a_pg_obj)
Constructor.
enable()
Enable page content.
setNode(&$a_node)
Set xml node of page content.
static handleCopiedContent(DOMDocument $a_domdoc, $a_self_ass=true, $a_clone_mobs=false)
Handle copied content.
static afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
After page has been updated (or created)
isEnabled()
Check whether page content is enabled.
static afterPageHistoryEntry($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
After page history entry has been created.
writePCId($a_pc_id)
Write pc id.
getHierId()
Get hierarchical id.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
static decEdId($ed_id)
Decreases an hierarchical editing id at lowest level (last number)
setHierId($a_hier_id)
Set hierarchical ID in xml structure.