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

Back to archive index

Minahito minah****@users*****
2006年 1月 14日 (土) 02:29:01 JST


Index: xoops2jp/html/modules/legacyRender/admin/actions/TplsetEditAction.class.php
diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/actions/TplsetEditAction.class.php:1.1.2.1
--- /dev/null	Sat Jan 14 02:29:01 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplsetEditAction.class.php	Sat Jan 14 02:29:01 2006
@@ -0,0 +1,99 @@
+<?php
+
+require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetEditForm.class.php";
+
+class LegacyRender_TplsetEditAction extends LegacyRender_Action
+{
+	var $mObject = null;
+	var $mObjectHandler = null;
+	var $mActionForm=null;
+	
+	function getDefaultView(&$controller,&$xoopsUser)
+	{
+		$this->_setupActionForm();
+		$this->_setupObject($controller);
+		
+		if ($this->mObject == null) {
+			return LEGACYRENDER_FRAME_VIEW_ERROR;
+		}
+
+		$this->mActionForm->load($this->mObject);
+
+		return LEGACYRENDER_FRAME_VIEW_INPUT;
+	}
+	
+	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->insert($this->mObject) ? LEGACYRENDER_FRAME_VIEW_SUCCESS
+		                                                     : LEGACYRENDER_FRAME_VIEW_ERROR;
+	}
+
+	function _setupObject(&$controller)
+	{
+		$id = $this->_getId();
+		
+		$this->mObjectHandler = $this->_getHandler();
+		
+		$this->mObject =& $this->mObjectHandler->get($id);
+		if (is_object($this->mObject) && $this->mObject->get('tplset_name') == 'default') {
+			$this->mObject = null;
+		}
+	}
+	
+	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 TplsetEditForm();
+		$this->mActionForm->prepare();
+	}
+
+	function executeViewInput(&$controller, &$xoopsUser, &$render)
+	{
+		$render->setTemplateName("tplset_edit.html");
+		$render->setAttribute('actionForm', $this->mActionForm);
+		$render->setAttribute('object', $this->mObject);
+	}
+
+	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
+	{
+		header("location: ./index.php?action=TplsetList");
+		exit();
+	}
+
+	function executeViewError(&$controller, &$xoopsUser, &$render)
+	{
+		redirect_header("./index.php?action=TplsetList", 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
+	}
+}
+
+?>
Index: xoops2jp/html/modules/legacyRender/admin/actions/TplsetListAction.class.php
diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/actions/TplsetListAction.class.php:1.1.2.1
--- /dev/null	Sat Jan 14 02:29:01 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplsetListAction.class.php	Sat Jan 14 02:29:01 2006
@@ -0,0 +1,39 @@
+<?php
+
+require_once XOOPS_ROOT_PATH . "/class/XCube_PageNavigator.class.php";
+require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetFilterForm.class.php";
+
+class LegacyRender_TplsetListAction extends LegacyRender_Action
+{
+	var $mObjects = array();
+	var $mFilter = null;
+	var $mPageNavi = null;
+
+	function getDefaultView(&$controller, &$xoopsUser)
+	{
+		$this->mFilter =& new LegacyRender_TplsetFilterForm();
+		$this->mFilter->fetch();
+	
+		$handler =& xoops_getmodulehandler('tplset');
+	
+		$total = $handler->getCount($this->mFilter->getCriteria());
+	
+		$this->mPageNavi =& new XCube_PageNavigator("./index.php?action=TplsetList", $total, XCUBE_PAGENAVI_START | XCUBE_PAGENAVI_PERPAGE);
+		$this->mPageNavi->fetch();
+	
+		$criteria = $this->mFilter->getCriteria($this->mPageNavi->getStart(), $this->mPageNavi->getPerpage());
+		$this->mObjects =& $handler->getObjects($criteria);
+	
+		return LEGACYRENDER_FRAME_VIEW_INDEX;
+	}
+
+	function executeViewIndex(&$controller, &$xoopsUser, &$render)
+	{
+		$render->setTemplateName("tplset_list.html");
+		$render->setAttribute('objects', $this->mObjects);
+		$render->setAttribute('pageNavi', $this->mPageNavi);
+		$render->setAttribute('activeTemplateSet', $controller->getConfig('template_set'));
+	}
+}
+
+?>
Index: xoops2jp/html/modules/legacyRender/admin/actions/TplsetDeleteAction.class.php
diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/actions/TplsetDeleteAction.class.php:1.1.2.1
--- /dev/null	Sat Jan 14 02:29:01 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplsetDeleteAction.class.php	Sat Jan 14 02:29:01 2006
@@ -0,0 +1,99 @@
+<?php
+
+require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetDeleteForm.class.php";
+
+class LegacyRender_TplsetDeleteAction extends LegacyRender_Action
+{
+	var $mObject = null;
+	var $mObjectHandler = null;
+	var $mActionForm=null;
+	
+	function getDefaultView(&$controller,&$xoopsUser)
+	{
+		$this->_setupActionForm();
+		$this->_setupObject($controller);
+
+		if ($this->mObject == null) {
+			return LEGACYRENDER_FRAME_VIEW_ERROR;
+		}
+
+		$this->mActionForm->load($this->mObject);
+
+		return LEGACYRENDER_FRAME_VIEW_INPUT;
+	}
+	
+	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 _setupObject(&$controller)
+	{
+		$id = $this->_getId();
+		
+		$this->mObjectHandler = $this->_getHandler();
+		
+		$this->mObject =& $this->mObjectHandler->get($id);
+		if (is_object($this->mObject) && $this->mObject->get('tplset_name') == 'default') {
+			$this->mObject = null;
+		}
+	}
+	
+	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->prepare();
+	}
+
+	function executeViewInput(&$controller, &$xoopsUser, &$render)
+	{
+		$render->setTemplateName("tplset_delete.html");
+		$render->setAttribute('actionForm', $this->mActionForm);
+		$render->setAttribute('object', $this->mObject);
+	}
+
+	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
+	{
+		header("location: ./index.php?action=TplsetList");
+		exit();
+	}
+
+	function executeViewError(&$controller, &$xoopsUser, &$render)
+	{
+		redirect_header("./index.php?action=TplsetList", 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
+	}
+}
+
+?>
\ No newline at end of file
Index: xoops2jp/html/modules/legacyRender/admin/actions/TplfileEditAction.class.php
diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/actions/TplfileEditAction.class.php:1.1.2.1
--- /dev/null	Sat Jan 14 02:29:01 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplfileEditAction.class.php	Sat Jan 14 02:29:01 2006
@@ -0,0 +1,102 @@
+<?php
+
+require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplfileEditForm.class.php";
+
+class LegacyRender_TplfileEditAction extends LegacyRender_Action
+{
+	var $mObject = null;
+	var $mObjectHandler = null;
+	var $mActionForm=null;
+	
+	function getDefaultView(&$controller,&$xoopsUser)
+	{
+		$this->_setupActionForm();
+		$this->_setupObject($controller);
+		
+		if ($this->mObject == null)
+			return LEGACYRENDER_FRAME_VIEW_ERROR;
+
+		$this->mActionForm->load($this->mObject);
+
+		return LEGACYRENDER_FRAME_VIEW_INPUT;
+	}
+	
+	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->insert($this->mObject) ? LEGACYRENDER_FRAME_VIEW_SUCCESS
+		                                                     : LEGACYRENDER_FRAME_VIEW_ERROR;
+	}
+
+	function _setupObject(&$controller)
+	{
+		$id = $this->_getId();
+		
+		$this->mObjectHandler = $this->_getHandler();
+		
+		$this->mObject =& $this->mObjectHandler->get($id);
+		if (is_object($this->mObject) && $this->mObject->get('tplset_name') == 'default') {
+			$this->mObject = null;
+			die();
+		}
+		else {
+			print_r($this->mObject);
+			die();
+		}
+	}
+	
+	function &_getHandler()
+	{
+		$handler = xoops_getmodulehandler('tplfile');
+		return $handler;
+	}
+	
+	function _getId()
+	{
+		return isset($_REQUEST['tpl_id']) ? intval($_REQUEST['tpl_id']) : 0;
+	}
+	
+	function _setupActionForm()
+	{
+		$this->mActionForm =& new TplfileEditForm();
+		$this->mActionForm->prepare();
+	}
+
+	function executeViewInput(&$controller, &$xoopsUser, &$render)
+	{
+		$render->setTemplateName("tplfile_edit.html");
+		$render->setAttribute('actionForm', $this->mActionForm);
+		$render->setAttribute('object', $this->mObject);
+	}
+
+	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
+	{
+		header("location: ./index.php?action=TplfileList&amp;module=" . $this->mObject->get('module'));
+		exit();
+	}
+
+	function executeViewError(&$controller, &$xoopsUser, &$render)
+	{
+		redirect_header("./index.php?action=TplsetList", 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
+	}
+}
+
+?>
Index: xoops2jp/html/modules/legacyRender/admin/actions/TplfileListAction.class.php
diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/actions/TplfileListAction.class.php:1.1.2.1
--- /dev/null	Sat Jan 14 02:29:01 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplfileListAction.class.php	Sat Jan 14 02:29:01 2006
@@ -0,0 +1,38 @@
+<?php
+
+require_once XOOPS_ROOT_PATH . "/class/XCube_PageNavigator.class.php";
+require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplfileFilterForm.class.php";
+
+class LegacyRender_TplfileListAction extends LegacyRender_Action
+{
+	var $mObjects = array();
+	var $mFilter = null;
+	var $mPageNavi = null;
+
+	function getDefaultView(&$controller, &$xoopsUser)
+	{
+		$this->mFilter =& new LegacyRender_TplfileFilterForm();
+		$this->mFilter->fetch();
+	
+		$handler =& xoops_getmodulehandler('tplfile');
+	
+		$total = $handler->getCount($this->mFilter->getCriteria());
+	
+		$this->mPageNavi =& new XCube_PageNavigator("./index.php?action=TplfileList", $total, XCUBE_PAGENAVI_START | XCUBE_PAGENAVI_PERPAGE);
+		$this->mPageNavi->fetch();
+	
+		$criteria = $this->mFilter->getCriteria($this->mPageNavi->getStart(), $this->mPageNavi->getPerpage());
+		$this->mObjects =& $handler->getObjects($criteria);
+	
+		return LEGACYRENDER_FRAME_VIEW_INDEX;
+	}
+
+	function executeViewIndex(&$controller, &$xoopsUser, &$render)
+	{
+		$render->setTemplateName("tplfile_list.html");
+		$render->setAttribute('objects', $this->mObjects);
+		$render->setAttribute('pageNavi', $this->mPageNavi);
+	}
+}
+
+?>
Index: xoops2jp/html/modules/legacyRender/admin/actions/TplsetCloneAction.class.php
diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/actions/TplsetCloneAction.class.php:1.1.2.1
--- /dev/null	Sat Jan 14 02:29:01 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplsetCloneAction.class.php	Sat Jan 14 02:29:01 2006
@@ -0,0 +1,99 @@
+<?php
+
+require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetCloneForm.class.php";
+
+class LegacyRender_TplsetCloneAction extends LegacyRender_Action
+{
+	var $mObject = null;
+	var $mCloneObject = null;
+	var $mObjectHandler = null;
+	var $mActionForm=null;
+	
+	function getDefaultView(&$controller,&$xoopsUser)
+	{
+		$this->_setupActionForm();
+		$this->_setupObject($controller);
+		
+		if ($this->mObject == null) {
+			return LEGACYRENDER_FRAME_VIEW_ERROR;
+		}
+
+		$this->mActionForm->load($this->mObject);
+
+		return LEGACYRENDER_FRAME_VIEW_INPUT;
+	}
+	
+	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->mCloneObject);
+
+		$this->mActionForm->fetch();
+		$this->mActionForm->validate();
+
+		if($this->mActionForm->hasError())
+			return LEGACYRENDER_FRAME_VIEW_INPUT;
+			
+		$this->mActionForm->update($this->mCloneObject);
+		
+		return $this->mObjectHandler->insertClone($this->mObject, $this->mCloneObject) ? LEGACYRENDER_FRAME_VIEW_SUCCESS
+		                                                     : 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");
+		$render->setAttribute('actionForm', $this->mActionForm);
+		$render->setAttribute('object', $this->mObject);
+	}
+
+	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
+	{
+		header("location: ./index.php?action=TplsetList");
+		exit();
+	}
+
+	function executeViewError(&$controller, &$xoopsUser, &$render)
+	{
+		redirect_header("./index.php?action=TplsetList", 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
+	}
+}
+
+?>


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