Minahito
minah****@users*****
2006年 8月 2日 (水) 18:34:46 JST
Index: xoops2jp/html/kernel/XCube_Theme.class.php diff -u /dev/null xoops2jp/html/kernel/XCube_Theme.class.php:1.1.2.1 --- /dev/null Wed Aug 2 18:34:46 2006 +++ xoops2jp/html/kernel/XCube_Theme.class.php Wed Aug 2 18:34:46 2006 @@ -0,0 +1,95 @@ +<?php + +/** + * The theme class. + */ +class XCube_Theme +{ + /** + * A name of the theme. + * + * @var string + */ + var $mName = null; + + /** + * A name of the theme on the file system. + * + * @var string + */ + var $mDirname = null; + + /** + * A name of entities system which this theme depends on. + * + * @var string + */ + var $mDepends = array(); + + var $mUrl = null; + + /** + * A name of the render system which this theme depends on. + * + * @var string + */ + var $mRenderSystemName = null; + + /** + * A file name of screen shot. + * + * @var string + */ + var $mScreenShot = null; + + var $mDescription = null; + + /** + * A description of this theme file format. This information isn't used by + * a program. But, this is an important information for users + * + * @var string + */ + var $mFormat = null; + + var $mAuthor = null; + + var $_mManifesto = array(); + + /** + * Load manifesto file, and set infomations from the file to member + * property. + * + * @return bool + */ + function loadManifesto($file) + { + if (file_exists($file)) { + $this->_mManifesto = parse_ini_file($file, true); + $this->mName = $this->_mManifesto['Manifesto']['Name']; + $this->mDepends = $this->_mManifesto['Manifesto']['Depends']; + $this->mVersion = $this->_mManifesto['Manifesto']['Version']; + $this->mUrl = $this->_mManifesto['Manifesto']['Url']; + + $this->mRenderSystemName = $this->_mManifesto['Theme']['RenderSystem']; + $this->mAuthor = $this->_mManifesto['Theme']['Author']; + + if (isset($this->_mManifesto['Theme']['ScreenShot'])) { + $this->mScreenShot = $this->_mManifesto['Theme']['ScreenShot']; + } + + if (isset($this->_mManifesto['Theme']['Description'])) { + $this->mDescription = $this->_mManifesto['Theme']['Description']; + } + + $this->mFormat = $this->_mManifesto['Theme']['Format']; + + return true; + } + else { + return false; + } + } +} + +?> \ No newline at end of file