[xoops-cvslog 5366] CVS update: xoops2jp/html/modules/user/class

Back to archive index

Minahito minah****@users*****
2006年 10月 16日 (月) 18:56:23 JST


Index: xoops2jp/html/modules/user/class/ActionFrame.class.php
diff -u xoops2jp/html/modules/user/class/ActionFrame.class.php:1.1.2.9.2.4 xoops2jp/html/modules/user/class/ActionFrame.class.php:1.1.2.9.2.5
--- xoops2jp/html/modules/user/class/ActionFrame.class.php:1.1.2.9.2.4	Fri Oct 13 18:22:13 2006
+++ xoops2jp/html/modules/user/class/ActionFrame.class.php	Mon Oct 16 18:56:23 2006
@@ -20,9 +20,17 @@
 	var $mAction = null;
 	var $mAdminFlag = null;
 
+	/**
+	 * @var XCube_Delegate
+	 */
+	var $mCreateAction = null;
+	
 	function User_ActionFrame($admin)
 	{
 		$this->mAdminFlag = $admin;
+		$this->mCreateAction =& new XCube_Delegate();
+		$this->mCreateAction->register('User_ActionFrame.createAction');
+		$this->mCreateAction->add(array(&$this, '_createAction'));
 	}
 
 	function setActionName($name)
@@ -37,18 +45,18 @@
 		$root->mContext->mModule->setAttribute('actionName', $name);
 	}
 
-	function execute(&$controller)
+	function _createAction(&$actionFrame)
 	{
-		if (!preg_match("/^\w+$/", $this->mActionName)) {
-			die();
+		if (is_object($this->mAction)) {
+			return;
 		}
 		
 		//
 		// Create action object by mActionName
 		//
-		$className = "User_" . ucfirst($this->mActionName) . "Action";
-		$fileName = ucfirst($this->mActionName) . "Action";
-		if ($this->mAdminFlag) {
+		$className = "User_" . ucfirst($actionFrame->mActionName) . "Action";
+		$fileName = ucfirst($actionFrame->mActionName) . "Action";
+		if ($actionFrame->mAdminFlag) {
 			$fileName = XOOPS_MODULE_PATH . "/user/admin/actions/${fileName}.class.php";
 		}
 		else {
@@ -56,17 +64,29 @@
 		}
 	
 		if (!file_exists($fileName)) {
-			$controller->executeForward(XOOPS_URL . '/');
+			die();
 		}
 	
 		require_once $fileName;
 	
 		if (class_exists($className)) {
-			$this->mAction =& new $className();
+			$this->mAction =& new $className($actionFrame->mAdminFlag);
 		}
+	}
 	
-		if (!is_object($this->mAction)) {
-			$controller->executeForward(XOOPS_URL . '/');
+	function execute(&$controller)
+	{
+		if (!preg_match("/^\w+$/", $this->mActionName)) {
+			die();
+		}
+		
+		//
+		// Create action object by mActionName
+		//
+		$this->mCreateAction->call(new XCube_Ref($this));
+
+		if (!(is_object($this->mAction) && is_a($this->mAction, 'User_Action'))) {
+			die();	//< TODO
 		}
 	
 		if ($this->mAction->isSecure() && !is_object($controller->mRoot->mContext->mXoopsUser)) {


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