[xoops-cvslog 1748] CVS update: xoops2jp/html/modules/legacyRender/admin/actions

Zurück zum Archiv-Index

Minahito minah****@users*****
2006年 1月 14日 (土) 18:20:50 JST


Index: xoops2jp/html/modules/legacyRender/admin/actions/TplsetCloneAction.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/actions/TplsetCloneAction.class.php:1.1.2.1 xoops2jp/html/modules/legacyRender/admin/actions/TplsetCloneAction.class.php:1.1.2.2
--- xoops2jp/html/modules/legacyRender/admin/actions/TplsetCloneAction.class.php:1.1.2.1	Sat Jan 14 02:29:01 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplsetCloneAction.class.php	Sat Jan 14 18:20:50 2006
@@ -1,37 +1,29 @@
 <?php
 
+require_once XOOPS_MODULE_PATH . "/legacyRender/admin/actions/TplsetEditAction.class.php";
 require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetCloneForm.class.php";
 
-class LegacyRender_TplsetCloneAction extends LegacyRender_Action
+class LegacyRender_TplsetCloneAction extends LegacyRender_TplsetEditAction
 {
-	var $mObject = null;
 	var $mCloneObject = null;
-	var $mObjectHandler = null;
-	var $mActionForm=null;
 	
-	function getDefaultView(&$controller,&$xoopsUser)
+	function _setupObject()
 	{
-		$this->_setupActionForm();
-		$this->_setupObject($controller);
-		
-		if ($this->mObject == null) {
-			return LEGACYRENDER_FRAME_VIEW_ERROR;
-		}
-
-		$this->mActionForm->load($this->mObject);
-
-		return LEGACYRENDER_FRAME_VIEW_INPUT;
+		parent::_setupObject();
+		$this->mCloneObject =& $this->mObjectHandler->create();
 	}
 	
-	function execute(&$controller,&$xoopsUser)
+	function _setupActionForm()
 	{
-		$this->_setupActionForm();
-		$this->_setupObject($controller);
+		$this->mActionForm =& new TplsetCloneForm();
+		$this->mActionForm->prepare();
+	}
 
+	function execute(&$controller, &$xoopsUser)
+	{
 		if ($this->mObject == null) {
 			return LEGACYRENDER_FRAME_VIEW_ERROR;
 		}
-
 		//
 		// If image is no, the data has to continue to keep his value.
 		//
@@ -40,8 +32,9 @@
 		$this->mActionForm->fetch();
 		$this->mActionForm->validate();
 
-		if($this->mActionForm->hasError())
+		if($this->mActionForm->hasError()) {
 			return LEGACYRENDER_FRAME_VIEW_INPUT;
+		}
 			
 		$this->mActionForm->update($this->mCloneObject);
 		
@@ -49,34 +42,6 @@
 		                                                     : LEGACYRENDER_FRAME_VIEW_ERROR;
 	}
 
-	function _setupObject(&$controller)
-	{
-		$id = $this->_getId();
-		
-		$this->mObjectHandler =& $this->_getHandler();
-
-		$this->mObject =& $this->mObjectHandler->get($id);
-		
-		$this->mCloneObject =& $this->mObjectHandler->create();
-	}
-	
-	function &_getHandler()
-	{
-		$handler = xoops_getmodulehandler('tplset');
-		return $handler;
-	}
-	
-	function _getId()
-	{
-		return isset($_REQUEST['tplset_id']) ? intval($_REQUEST['tplset_id']) : 0;
-	}
-	
-	function _setupActionForm()
-	{
-		$this->mActionForm =& new TplsetCloneForm();
-		$this->mActionForm->prepare();
-	}
-
 	function executeViewInput(&$controller, &$xoopsUser, &$render)
 	{
 		$render->setTemplateName("tplset_clone.html");
@@ -86,8 +51,7 @@
 
 	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
 	{
-		header("location: ./index.php?action=TplsetList");
-		exit();
+		$controller->executeForward("./index.php?action=TplsetList");
 	}
 
 	function executeViewError(&$controller, &$xoopsUser, &$render)


xoops-cvslog メーリングリストの案内
Zurück zum Archiv-Index