Update of /cvsroot/phpvortex/phpvortex
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23048
Modified Files:
SEC_Base.class.php SEC_Static.class.php
Removed Files:
PG_Base.class.php
Log Message:
Unified the PG_Base code into SEC_Base, and removed PG_Base. From now on, the pages will be composed from sections with subsections.
Index: SEC_Static.class.php
===================================================================
RCS file: /cvsroot/phpvortex/phpvortex/SEC_Static.class.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SEC_Static.class.php 30 Sep 2004 14:26:01 -0000 1.3
--- SEC_Static.class.php 5 Oct 2004 15:12:42 -0000 1.4
***************
*** 46,49 ****
--- 46,50 ----
echo $this->code;
}
+ parent::Show();
}
}
--- PG_Base.class.php DELETED ---
Index: SEC_Base.class.php
===================================================================
RCS file: /cvsroot/phpvortex/phpvortex/SEC_Base.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SEC_Base.class.php 28 Sep 2004 18:43:24 -0000 1.2
--- SEC_Base.class.php 5 Oct 2004 15:12:42 -0000 1.3
***************
*** 19,22 ****
--- 19,28 ----
{
/**
+ * Child sections list.
+ * @var array
+ */
+ var $sections = array();
+
+ /**
* Constructor: Load all parameters into member variables.
*
***************
*** 31,40 ****
/**
* Outputs the section to the client.
*
! * @abstract
*/
function Show()
{
}
}
--- 37,89 ----
/**
+ * Add a new child section.
+ *
+ * @param string $section Section name.
+ * @param SEC_Base $class Section class.
+ * @param array $opts Section class options.
+ * @param string $position Position on where to insert the section (insert before section $position).
+ */
+ function AddSection($section, $class, $opts = array(), $position = NULL)
+ {
+ include_once($class.'.class.php');
+ if (is_null($position)) {
+ $this->sections[$section] = &new $class($opts);
+ } else {
+ $tmp = array();
+ $found = false;
+ foreach ($this->sections as $k => $i) {
+ if (!strcmp($k, $position)) {
+ $found = true;
+ $tmp[$section] = &new $class($opts);
+ }
+ $tmp[$k] = &$this->sections[$k];
+ }
+ if (!$found) {
+ $tmp[$section] = &new $class($opts);
+ }
+ $this->sections = &$tmp;
+ }
+ }
+
+ /**
+ * Remove a child section from the section.
+ *
+ * @param string $section Section name.
+ */
+ function DelSection($section)
+ {
+ unset($this->sections[$section]);
+ }
+
+ /**
* Outputs the section to the client.
*
! * Show all childs in order.
*/
function Show()
{
+ foreach ($this->sections as $sec) {
+ $sec->Show();
+ }
}
}
|