[xoops-cvslog 4663] CVS update: xoops2jp/html/modules/base/kernel

Back to archive index

Minahito minah****@users*****
2006年 9月 28日 (木) 14:03:56 JST


Index: xoops2jp/html/modules/base/kernel/Legacy_BlockProcedure.class.php
diff -u xoops2jp/html/modules/base/kernel/Legacy_BlockProcedure.class.php:1.1.2.1 xoops2jp/html/modules/base/kernel/Legacy_BlockProcedure.class.php:1.1.2.1.2.1
--- xoops2jp/html/modules/base/kernel/Legacy_BlockProcedure.class.php:1.1.2.1	Thu Aug  3 18:36:36 2006
+++ xoops2jp/html/modules/base/kernel/Legacy_BlockProcedure.class.php	Thu Sep 28 14:03:56 2006
@@ -1,14 +1,83 @@
 <?php
 /**
  * @package Legacy
- * @version $Id: Legacy_BlockProcedure.class.php,v 1.1.2.1 2006/08/03 09:36:36 minahito Exp $
+ * @version $Id: Legacy_BlockProcedure.class.php,v 1.1.2.1.2.1 2006/09/28 05:03:56 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) die();
 
-require_once XOOPS_ROOT_PATH . "/class/XCube_BlockProcedure.class.php";
+/**
+ * The abstract block class of XOOPS Cube Legacy. This class has must interface
+ * for the controller. The sub-class must implement these interfaces to be
+ * called back by the controller.
+ */
+class Legacy_BlockProcedure
+{
+	function XCube_BlockProcedure()
+	{
+	}
+	
+	function getName()
+	{
+	}
+	
+	function execute(&$controller, &$user, &$render)
+	{
+	}
+	
+	function getId()
+	{
+	}
+	
+	function enableCached()
+	{
+		return true;
+	}
+	
+	/**
+	 * Return cache time
+	 * @return int
+	 */
+	function getCacheTime()
+	{
+		return 0;
+	}
 
-class Legacy_AdaptBlockProcedure extends XCube_BlockProcedure
+	function getTitle()
+	{
+	}
+	
+	function getEntryIndex()
+	{
+	}
+	
+	function getWeight()
+	{
+	}
+	
+	function hasResult()
+	{
+	}
+
+	function &getResult()
+	{
+	}
+	
+	/**
+	 * Return a name of the render-system which this object requests to render.
+	 *
+	 * @return string
+	 */
+	function getRenderSystemName()
+	{
+	}
+}
+
+/**
+ * The adapter class for XoopsBlock objects of XOOPS2 JP.
+ * @see Legacy_BlockProcedure
+ */
+class Legacy_AdaptBlockProcedure extends Legacy_BlockProcedure
 {
 	/**
 	 * @access private
Index: xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php
diff -u xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.79 xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.79.2.1
--- xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.79	Mon Sep 25 12:22:52 2006
+++ xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php	Thu Sep 28 14:03:56 2006
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package Legacy
- * @version $Id: Legacy_Controller.class.php,v 1.1.2.79 2006/09/25 03:22:52 minahito Exp $
+ * @version $Id: Legacy_Controller.class.php,v 1.1.2.79.2.1 2006/09/28 05:03:56 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -10,6 +10,7 @@
 define("LEGACY_CONTROLLER_STATE_ADMIN", 2);
 
 require_once XOOPS_ROOT_PATH . "/modules/base/kernel/Legacy_BlockProcedure.class.php";
+require_once XOOPS_ROOT_PATH . "/modules/base/class/Legacy_Utils.class.php";
 
 /**
  * This class is a virtual controller that has the compatibility with XOOPS 2.0.x.
@@ -33,16 +34,12 @@
 	var $mDialogMode = false;
 	
 	/**
-	 * @todo Rename this with "mModule"
+	 * @var Legacy_ModuleController
+	 * @todo Rename this with "mModuleContext"
 	 */
 	var $mModuleController = null;
 	
 	/**
-	 * @var XCube_Deleagate
-	 */
-	var $mSiteLogin = null;
-	
-	/**
 	 * @var XCube_Delegate
 	 */
 	var $mGetCountUnreadPM = null;
@@ -91,17 +88,18 @@
 	var $mBlockContents = array();
 	
 	/**
-	 * @deprecated
+	 * @var XoopsLogger
 	 */
-	var $mRenderSystem = null;
+	var $mLogger = null;
 	
 	function Legacy_Controller()
 	{
+		parent::XCube_Controller();
+		
 		//
 		// Setup member properties as member delegates.
 		//
-		$this->mSiteLogin =& new XCube_Delegate();
-		$this->mSiteLogin->register("Site.Login");
+		$this->mSetupUser->register("Legacy_Controller.SetupUser");
 		
 		$this->mGetCountUnreadPM =& new XCube_Delegate();
 		$this->mGetPMInboxUrl =& new XCube_Delegate();
@@ -187,11 +185,16 @@
 	
 	function _setupLogger()
 	{
-		require_once XOOPS_ROOT_PATH.'/class/logger.php';
-		$this->mLogger=&XoopsLogger::instance();
+		require_once XOOPS_ROOT_PATH . '/class/logger.php';
+		$this->mLogger =& XoopsLogger::instance();
 		$this->mLogger->startTime();
 
-		$GLOBALS['xoopsLogger']=&$this->mLogger;
+		$GLOBALS['xoopsLogger'] =& $this->mLogger;
+	}
+	
+	function &getLogger()
+	{
+		return $this->mLogger;
 	}
 
 	function _setupEnvironment()
@@ -211,7 +214,7 @@
 
 		require_once XOOPS_BASE_PATH."/kernel/object.php";				// ToDo (here?)
 		require_once XOOPS_BASE_PATH."/kernel/handler.php";				// ToDo
-		require_once XOOPS_ROOT_PATH."/class/XCube_Utils.class.php";	// ToDo
+		require_once XOOPS_ROOT_PATH."/kernel/XCube_Utils.class.php";	// ToDo
 
 		require_once XOOPS_ROOT_PATH.'/class/xoopssecurity.php';
 		$_GLOBALS['xoopsSecurity'] = new XoopsSecurity();
@@ -349,6 +352,11 @@
 	{
 		$this->_mStrategy->setupModuleController();
 	}
+	
+	function &getModuleController()
+	{
+		return $this->mModuleController;
+	}
 
 	function _processModuleController()
 	{
@@ -401,19 +409,22 @@
 
 	function _setupUser()
 	{
-		$this->mSiteLogin->call(new XCube_Ref($this->mXoopsUser));
-		
-		$this->mUser =& new XCube_UserAccount();
+		parent::_setupUser();
+
+		/****************************************************/
+		/* Principal                                        */
+		/****************************************************/
+				
 		if (is_object($this->mXoopsUser)) {
-			$this->mUser->_mId = $this->mXoopsUser->get('uid');	//< FIXME
+/*			$this->mUser->_mId = $this->mXoopsUser->get('uid');	//< FIXME
 			$this->mUser->setGuest(false);
-			$this->mUser->setService(false);
+			$this->mUser->setService(false);*/
 		}
-		else {
+/*		else {
 			$this->mUser->_mId = 0;	//< FIXME
 			$this->mUser->setGuest(true);
 			$this->mUser->setService(false);
-		}
+		}*/
 		
 		// Set instance to global variable for compatiblity with XOOPS 2.0.x
 		$GLOBALS['xoopsUser'] =& $this->mXoopsUser;
@@ -553,7 +564,7 @@
 		$configHandler=&xoops_gethandler('config');
 		$this->mConfig=&$configHandler->getConfigsByCat(XOOPS_CONF);
 
-		$this->setMainTheme($this->mConfig['theme_set']);
+		$this->setTheme($this->mConfig['theme_set']);
 	    $this->mConfig['language'] = $this->mRoot->mLanguageManager->getLanguage();
 	    
 		$GLOBALS['xoopsConfig']=&$this->mConfig;
@@ -587,7 +598,7 @@
         parent::_processPreBlockFilter();
     }
 	
-	function _executeModulePreload($dirname)
+	function _processModulePreload($dirname)
 	{
 		//
 		// Auto pre-loading for Module.
@@ -693,9 +704,9 @@
 	/**
 	 * @var string $theme
 	 */	
-	function setMainTheme($theme)
+	function setTheme($theme)
 	{
-		$this->mMainTheme = $theme;
+		$this->mTheme = $theme;
 		$this->mConfig['theme_set'] = $theme;
 	}
 	
@@ -1221,7 +1232,7 @@
 		// Auto pre-loading.
 		//
 		if($this->mController->mRoot->getSiteConfig('Legacy', 'AutoPreload') == 1) {
-			$this->mController->_executePreload(XOOPS_ROOT_PATH . "/preload");
+			$this->mController->_processPreload(XOOPS_ROOT_PATH . "/preload");
 		}
 	}
 
@@ -1241,7 +1252,7 @@
 	
 	function _processPreBlockFilter()
 	{
-		$this->mController->_executeModulePreload('/preload');
+		$this->mController->_processModulePreload('/preload');
 	}
 
 	/**
@@ -1321,7 +1332,7 @@
 		// the new solution about this process.
 		//
 		$handler =& xoops_getmodulehandler('theme', 'base');
-		$theme =& $handler->get($this->mController->getMainTheme());
+		$theme =& $handler->get($this->mController->getTheme());
 		
 		return $theme;
 	}
@@ -1382,7 +1393,7 @@
 		// Auto pre-loading.
 		//
 		if($this->mController->mRoot->getSiteConfig('Legacy', 'AutoPreload') == 1) {
-			$this->mController->_executePreload(XOOPS_ROOT_PATH . "/preload/admin");
+			$this->mController->_processPreload(XOOPS_ROOT_PATH . "/preload/admin");
 		}
 	}
 	
@@ -1405,7 +1416,7 @@
 	function _processPreBlockFilter()
 	{
 		parent::_processPreBlockFilter();
-		$this->mController->_executeModulePreload('/admin/preload/');
+		$this->mController->_processModulePreload('/admin/preload');
 	}
 
 	function &getVirtualCurrentModule()


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