[Openfirst-cvscommit] base/includes modules.php,1.1,1.2
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-05-26 21:28:02
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30814/includes Modified Files: modules.php Log Message: XML parser finnished, code to update still needs to be added Index: modules.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/modules.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** modules.php 26 May 2005 21:00:03 -0000 1.1 --- modules.php 26 May 2005 21:27:45 -0000 1.2 *************** *** 28,36 **** class Module { ! /*private*/ var $mName, $mCode, $mVersion, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; // XML /*private*/ var $mxmlCurTag, $mRootElement; function Module($File) { --- 28,38 ---- class Module { ! /*private*/ var $mName, $mID, $mVersion, $mAuthor, $mMaintainer; /*private*/ var $mIncludes, $mNavBar, $mAdminBar, $mTables; // XML /*private*/ var $mxmlCurTag, $mRootElement; + // Specific tags for later. + /*private*/ var $mIncludesTag, $mDBTag; function Module($File) { *************** *** 56,59 **** --- 58,70 ---- xml_parser_free($hXML); unset($hXML); + + $this->mIncludes = array() + // Handle includes + $IncludeTags = $this->mIncludesTag->Contents; + foreach($IncludeTags as $tag) { + if (is_object($tag) && is_a($tag, 'xmlElement')) { + $this->mIncludes[] = $tag->Contents[0]; + } + } } *************** *** 111,117 **** --- 122,150 ---- $this->mxmlCurTag =& new xmlElement($name, $attrs, $this); } + + if ($name == 'module') { + if (isset($attrs['ID'])) $this->mID = $attrs['ID']; + } } function endElement($parser, $name) { + if ($name == 'name') { + $this->mName = $this->mxmlCurTag->Contents[0]; + } else if ($name == 'version') { + $this->mVersion = $this->mxmlCurTag->Contents[0]; + } else if ($name == 'author') { + $this->mAuthor = $this->mxmlCurTag->Contents[0]; + } else if ($name == 'maintainer') { + $this->mMaintainer = $this->mxmlCurTag->Contents[0]; + } else if ($name == 'navbar') { + $this->mNavbar = $this->mxmlCurTag->Contents[0]; + } else if ($name == 'adminbar') { + $this->mAdminbar = $this->mxmlCurTag->Contents[0]; + } else if ($name == 'includes') { + $this->mIncludesTag =& $this->mxmlCurTag; + } else if ($name == 'db') { + $this->mDBTag =& $this->mxmlCurTag; + } + $this->mxmlCurTag =& $this->mxmlCurTag->getParent(); } *************** *** 133,137 **** /*public*/ function addCData($Text) { ! return $this->Contents[] = $Text; } --- 166,175 ---- /*public*/ function addCData($Text) { ! end($this->Contents); ! if (is_object(current($this->Contents))) { ! $this->Contents[] = $Text; ! } else { ! $this->Contents[key($this->Contents)] .= $Text; ! } } |