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

Zurück zum Archiv-Index

Minahito minah****@users*****
2006年 7月 11日 (火) 12:05:26 JST


Index: xoops2jp/html/modules/legacyRender/admin/actions/TplsetDeleteAction.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/actions/TplsetDeleteAction.class.php:1.1.2.2 xoops2jp/html/modules/legacyRender/admin/actions/TplsetDeleteAction.class.php:1.1.2.3
--- xoops2jp/html/modules/legacyRender/admin/actions/TplsetDeleteAction.class.php:1.1.2.2	Tue Mar 28 22:30:49 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplsetDeleteAction.class.php	Tue Jul 11 12:05:26 2006
@@ -1,53 +1,25 @@
 <?php
+/**
+ * @package legacyRender
+ * @version $Id: TplsetDeleteAction.class.php,v 1.1.2.3 2006/07/11 03:05:26 minahito Exp $
+ */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
+require_once XOOPS_MODULE_PATH . "/legacyRender/class/AbstractDeleteAction.class.php";
 require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetDeleteForm.class.php";
 
-class LegacyRender_TplsetDeleteAction extends LegacyRender_Action
+class LegacyRender_TplsetDeleteAction extends LegacyRender_AbstractDeleteAction
 {
-	var $mObject = null;
-	var $mObjectHandler = null;
-	var $mActionForm=null;
-	
-	function getDefaultView(&$controller,&$xoopsUser)
+	function _getId()
 	{
-		$this->_setupActionForm();
-		$this->_setupObject($controller);
-
-		if ($this->mObject == null) {
-			return LEGACYRENDER_FRAME_VIEW_ERROR;
-		}
-
-		$this->mActionForm->load($this->mObject);
-
-		return LEGACYRENDER_FRAME_VIEW_INPUT;
+		return xoops_getrequest('tplset_id');
 	}
-	
-	function execute(&$controller,&$xoopsUser)
-	{
-		$this->_setupActionForm();
-		$this->_setupObject($controller);
-
-		if ($this->mObject == null) {
-			return LEGACYRENDER_FRAME_VIEW_ERROR;
-		}
-
-		//
-		// If image is no, the data has to continue to keep his value.
-		//
-		$this->mActionForm->load($this->mObject);
-
-		$this->mActionForm->fetch();
-		$this->mActionForm->validate();
-
-		if($this->mActionForm->hasError())
-			return LEGACYRENDER_FRAME_VIEW_INPUT;
-			
-		$this->mActionForm->update($this->mObject);
 
-		return $this->mObjectHandler->delete($this->mObject) ? LEGACYRENDER_FRAME_VIEW_SUCCESS
-		                                                       : LEGACYRENDER_FRAME_VIEW_ERROR;
+	function &_getHandler()
+	{
+		$handler = xoops_getmodulehandler('tplset');
+		return $handler;
 	}
 
 	function _setupObject(&$controller)
@@ -62,20 +34,9 @@
 		}
 	}
 	
-	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 TplsetDeleteForm();
+		$this->mActionForm =& new LegacyRender_TplsetDeleteForm();
 		$this->mActionForm->prepare();
 	}
 
@@ -88,13 +49,17 @@
 
 	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
 	{
-		header("location: ./index.php?action=TplsetList");
-		exit();
+		$controller->executeForward("./index.php?action=TplsetList");
 	}
 
 	function executeViewError(&$controller, &$xoopsUser, &$render)
 	{
-		redirect_header("./index.php?action=TplsetList", 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
+		$controller->executeRedirect("./index.php?action=TplsetList", 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
+	}
+
+	function executeViewCancel(&$controller, &$xoopsUser, &$render)
+	{
+		$controller->executeForward("./index.php?action=TplsetList");
 	}
 }
 


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