Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00037 class ilPageContent
00038 {
00039 var $ilias;
00040 var $type;
00041 var $hier_id;
00042 var $node;
00043
00048 function ilPageContent()
00049 {
00050 global $ilias;
00051
00052 $this->ilias =& $ilias;
00053 }
00054
00055
00056 function setType($a_type)
00057 {
00058 $this->type = $a_type;
00059 }
00060
00061 function getType()
00062 {
00063 return $this->type;
00064 }
00065
00068 function setNode(&$a_node)
00069 {
00070 $this->node =& $a_node;
00071 }
00072
00073
00076 function &getNode()
00077 {
00078 return $this->node;
00079 }
00080
00081
00085 function setHierId($a_hier_id)
00086 {
00087 $this->hier_id = $a_hier_id;
00088 }
00089
00093 function getHierId()
00094 {
00095 return $this->hier_id;
00096 }
00097
00102 function incEdId($ed_id)
00103 {
00104 $id = explode("_", $ed_id);
00105 $id[count($id) - 1]++;
00106 return implode($id, "_");
00107 }
00108
00113 function decEdId($ed_id)
00114 {
00115 $id = explode("_", $ed_id);
00116 $id[count($id) - 1]--;
00117 return implode($id, "_");
00118 }
00119
00124 function haveSameContainer($ed_id1, $ed_id2)
00125 {
00126 $id1 = explode("_", $ed_id1);
00127 $id2 = explode("_", $ed_id1);
00128 if(count($id1) == count($id2))
00129 {
00130 array_pop($id1);
00131 array_pop($id2);
00132 foreach ($id1 as $key => $id)
00133 {
00134 if($id != $id2[$key])
00135 {
00136 return false;
00137 }
00138 }
00139 return true;
00140 }
00141 return false;
00142 }
00143
00148 function setEnabled ($value)
00149 {
00150 if (is_object($this->node))
00151 {
00152 $this->node->set_attribute("Enabled", $value);
00153 }
00154 }
00155
00156
00162 function isEnabled ()
00163 {
00164 if (is_object($this->node) && $this->node->has_attribute("Enabled"))
00165 {
00166 $compare = $this->node->get_attribute("Enabled");
00167 }
00168 else $compare = "True";
00169
00170 return strcasecmp($compare,"true") == 0;
00171 }
00172
00173
00177 function enable()
00178 {
00179
00180 $this->setEnabled ("True");
00181 }
00182
00186 function disable()
00187 {
00188
00189 $this->setEnabled ("False");
00190 }
00191
00192 }
00193 ?>