[xoops-cvslog 1640] CVS update: xoops2jp/html/kernel

Back to archive index

Minahito minah****@users*****
2006年 1月 11日 (水) 12:31:48 JST


Index: xoops2jp/html/kernel/XCube_Root.class.php
diff -u xoops2jp/html/kernel/XCube_Root.class.php:1.1.2.8 xoops2jp/html/kernel/XCube_Root.class.php:1.1.2.9
--- xoops2jp/html/kernel/XCube_Root.class.php:1.1.2.8	Thu Jan  5 17:27:04 2006
+++ xoops2jp/html/kernel/XCube_Root.class.php	Wed Jan 11 12:31:48 2006
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version $Id: XCube_Root.class.php,v 1.1.2.8 2006/01/05 08:27:04 minahito Exp $
+ * @version $Id: XCube_Root.class.php,v 1.1.2.9 2006/01/11 03:31:48 minahito Exp $
  * @package Cube
  */
 
@@ -32,8 +32,13 @@
 	
 	var $mServiceManager=null;
 
+	/**
+	 * @deprecated
+	 */
 	var $mRenderSystem=null;
 	
+	var $mRenderSystems=array();
+	
 	var $mSiteConfig=array();
 	
 	/**
@@ -158,19 +163,9 @@
 		// [NOTICE]
 		// We don't decide the style of SiteConfig.
 		//
-		$this->mController=&$this->createController($this->mSiteConfig['Cube']['Controller.class'],$this->mSiteConfig['Cube']['Controller.path']);
-	}
-
-	function &createController($className='XCube_Controller',$classpath=null)
-	{
-		if(!$this->mController) {
-			if($classpath!=null)
-				require_once XOOPS_ROOT_PATH."/".$classpath."/".$className.".class.php";
-			if(class_exists($className))
-				$this->mController = new $className($this);
-		}
-		
-		return $this->mController;
+		$controllerName = $this->mSiteConfig['Cube']['Controller'];
+		$this->mController=&$this->_createInstance($this->mSiteConfig[$controllerName]['class'],$this->mSiteConfig[$controllerName]['path']);
+		$this->mController->prepare($this);
 	}
 
 	function &getController()
@@ -246,6 +241,27 @@
 
 		return $this->mCacheSystem;
 	}
+	
+	function &getRenderSystem($name)
+	{
+		if (isset($this->mRenderSystems[$name])) {
+			return $this->mRenderSystems[$name];
+		}
+		
+		//
+		// create
+		//
+		$chunkName = $this->mSiteConfig['RenderSystems'][$name];
+		$this->mRenderSystems[$name] =& $this->_createInstance($this->mSiteConfig[$chunkName]['class'], $this->mSiteConfig[$chunkName]['path']);
+		
+		if (!is_object($this->mRenderSystems[$name])) {
+			die("NO");
+		}
+		
+		// $this->mRenderSystems[$name]->prepare();
+		
+		return $this->mRenderSystems[$name];
+	}
 
 	function &_createInstance($className, $classPath=null)
 	{
@@ -254,7 +270,7 @@
 		if($classPath!=null) {
 			require_once XOOPS_ROOT_PATH . "/" . $classPath . "/" . $className . ".class.php";
 		}
-
+		
 		if(class_exists($className)) {
 			$ret =& new $className();
 		}


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