• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

content/classes/Pages/class.ilPageContent.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00037 class ilPageContent
00038 {
00039         var $ilias;
00040         var $type;
00041         var $hier_id;                           // hierarchical editing 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 //              echo "enable<br>";
00180                 $this->setEnabled ("True");
00181         }
00182           
00186         function disable()      
00187         {
00188 //              echo "disable<br>";
00189                 $this->setEnabled ("False");
00190         }
00191 
00192 }
00193 ?>

Generated on Fri Dec 13 2013 13:52:10 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1