[xoops-cvslog 1699] CVS update: xoops2jp/html/modules/legacyRender/class

Back to archive index

Minahito minah****@users*****
2006年 1月 13日 (金) 01:22:56 JST


Index: xoops2jp/html/modules/legacyRender/class/theme.php
diff -u xoops2jp/html/modules/legacyRender/class/theme.php:1.1.2.1 xoops2jp/html/modules/legacyRender/class/theme.php:1.1.2.2
--- xoops2jp/html/modules/legacyRender/class/theme.php:1.1.2.1	Thu Jan 12 20:21:32 2006
+++ xoops2jp/html/modules/legacyRender/class/theme.php	Fri Jan 13 01:22:56 2006
@@ -2,6 +2,9 @@
 
 class LegacyRenderThemeObject extends XoopsSimpleObject
 {
+	var $mPackage = array();
+	var $mActiveResource = true;
+	
 	function LegacyRenderThemeObject()
 	{
 		$this->initVar('id', XOBJ_DTYPE_INT, '', true);
@@ -9,13 +12,48 @@
 		$this->initVar('tplset_id', XOBJ_DTYPE_INT, '0', true);
 		$this->initVar('enable_select', XOBJ_DTYPE_BOOL, '0', true);
 	}
+	
+	function loadPackage()
+	{
+		$mnfFile = XOOPS_THEME_PATH . "/" . $this->get('name') . "/package.ini.php";
+		
+		if (file_exists($mnfFile)) {
+			$this->mPackage = parse_ini_file($mnfFile, true);
+			
+			if (isset($this->mPackage['Manifesto']) && isset($this->mPackage['Manifesto']['Depends'])) {
+				$this->mActiveResource = ($this->mPackage['Manifesto']['Depends'] == "Legacy_RenderSystem");
+			}
+		}
+		else {
+			$file = XOOPS_THEME_PATH . "/" . $this->get('name') . "/theme.html";
+			$this->mActiveResource = file_exists($file);
+		}
+	}
+	
+	function isActiveResource()
+	{
+		return $this->mActiveResource;
+	}
 }
 
 class LegacyRenderThemeHandler extends XoopsObjectGenericHandler
 {
-	var $mTable = "theme";
+	var $mTable = "legacyrender_theme";
 	var $mPrimary = "id";
 	var $mClass = "LegacyRenderThemeObject";
+	
+	function &getByName($themeName)
+	{
+		$criteria = new Criteria('name', $themeName);
+		$obj =& $this->getObjects($criteria);
+		if (count($obj) > 0) {
+			return $obj[0];
+		}
+		else {
+			$obj =& $this->create();
+			return $obj;
+		}
+	}
 }
 
 ?>


xoops-cvslog メーリングリストの案内
Back to archive index