Minahito
minah****@users*****
2006年 7月 10日 (月) 19:57:57 JST
Index: xoops2jp/html/modules/legacyRender/admin/class/LegacyRenderActionFrame.class.php diff -u xoops2jp/html/modules/legacyRender/admin/class/LegacyRenderActionFrame.class.php:1.1.2.5 xoops2jp/html/modules/legacyRender/admin/class/LegacyRenderActionFrame.class.php:removed --- xoops2jp/html/modules/legacyRender/admin/class/LegacyRenderActionFrame.class.php:1.1.2.5 Tue Mar 28 22:30:48 2006 +++ xoops2jp/html/modules/legacyRender/admin/class/LegacyRenderActionFrame.class.php Mon Jul 10 19:57:57 2006 @@ -1,165 +0,0 @@ -<?php -// $Id: LegacyRenderActionFrame.class.php,v 1.1.2.5 2006/03/28 13:30:48 minahito Exp $ -// ------------------------------------------------------------------------ // -// XOOPS - PHP Content Management System // -// Copyright (c) 2005 XOOPS Cube.org // -// <http://www.xoopscube.org/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // - -if (!defined('XOOPS_ROOT_PATH')) exit(); - -require_once XOOPS_ROOT_PATH."/class/XCube_ActionStrategy.class.php"; - -define ("LEGACYRENDER_FRAME_PERFORM_SUCCESS",1); -define ("LEGACYRENDER_FRAME_PERFORM_FAIL",2); -define ("LEGACYRENDER_FRAME_INIT_SUCCESS",3); - -define ("LEGACYRENDER_FRAME_VIEW_NONE",0); -define ("LEGACYRENDER_FRAME_VIEW_SUCCESS",1); -define ("LEGACYRENDER_FRAME_VIEW_ERROR",2); -define ("LEGACYRENDER_FRAME_VIEW_INDEX",3); -define ("LEGACYRENDER_FRAME_VIEW_INPUT",4); - -/** - * This is simple frame work for misc page controller. - * @package legacy - */ -class LegacyRenderActionFrame extends XCube_ActionStrategy -{ - var $mActionName=""; - var $mAction=null; - - function LegacyRenderActionFrame() - { - } - - function setActionName($actionName) - { - $this->mActionName=$actionName; - } - - function execute(&$controller) - { - if($this->mActionName==null) - $this->mActionName=isset($_REQUEST['action']) ? trim($_REQUEST['action']) : "ThemeList"; - - if(!preg_match("/^\w+$/",$this->mActionName)) - die(); - - - // - // Create action object by mActionName - // - $className="LegacyRender_".ucfirst($this->mActionName)."Action"; - $fileName=XOOPS_ROOT_PATH."/modules/legacyRender/admin/actions/".ucfirst($this->mActionName)."Action.class.php"; - if(!file_exists($fileName)) - die(); // TODO - - require_once $fileName; - if(class_exists($className)) - $this->mAction=new $className($controller,$controller->getXoopsUser()); - - if(!is_object($this->mAction)) - die(); // TODO - - $this->mAction->prepare($controller,$controller->getXoopsUser()); - - // - // Simple execute action switch. - // - if(xoops_getenv("REQUEST_METHOD")=="POST") { - $viewStatus=$this->mAction->execute($controller,$controller->getXoopsUser()); - } - else { - $viewStatus=$this->mAction->getDefaultView($controller,$controller->getXoopsUser()); - } - - - // - // Call the view stab method of action by $viewStatus - // - switch($viewStatus) { - case LEGACYRENDER_FRAME_VIEW_SUCCESS: - $this->mAction->executeViewSuccess($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case LEGACYRENDER_FRAME_VIEW_ERROR: - $this->mAction->executeViewError($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case LEGACYRENDER_FRAME_VIEW_INDEX: - $this->mAction->executeViewIndex($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case LEGACYRENDER_FRAME_VIEW_INPUT: - $this->mAction->executeViewInput($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - } - } -} - -class LegacyRender_Action -{ - var $mConfig; - - function LegacyRenderAction(&$controller,&$xoopsUser) - { - $this->mConfig=$controller->mModuleController->getConfig(); - } - - function prepare(&$controller,&$xoopsUser) - { - return LEGACYRENDER_FRAME_VIEW_NONE; - } - - /** - * @param $controller Base_Controller - * @param $xoopsUser XoopsUserObject - */ - function getDefaultView(&$controller,&$xoopsUser) - { - return LEGACYRENDER_FRAME_VIEW_NONE; - } - - function execute(&$controller,&$xoopsUser) - { - return LEGACYRENDER_FRAME_VIEW_NONE; - } - - function executeViewSuccess(&$controller,&$xoopsUser,&$renderSystem) - { - } - - function executeViewError(&$controller,&$xoopsUser,&$renderSystem) - { - } - - function executeViewIndex(&$controller,&$xoopsUser,&$renderSystem) - { - } - - function executeViewInput(&$controller,&$xoopsUser,&$renderSystem) - { - } -} - -?> \ No newline at end of file Index: xoops2jp/html/modules/legacyRender/admin/class/AbstractListAction.class.php diff -u xoops2jp/html/modules/legacyRender/admin/class/AbstractListAction.class.php:1.1.2.5 xoops2jp/html/modules/legacyRender/admin/class/AbstractListAction.class.php:removed --- xoops2jp/html/modules/legacyRender/admin/class/AbstractListAction.class.php:1.1.2.5 Tue Mar 28 22:30:48 2006 +++ xoops2jp/html/modules/legacyRender/admin/class/AbstractListAction.class.php Mon Jul 10 19:57:57 2006 @@ -1,47 +0,0 @@ -<?php - -if (!defined('XOOPS_ROOT_PATH')) exit(); - -require_once XOOPS_MODULE_PATH . "/legacyRender/admin/class/PageNavigator.class.php"; - -class LegacyRender_AbstractListAction extends LegacyRender_Action -{ - var $mObjects = array(); - var $mFilter = null; - var $mActionForm = null; - var $mPageNavi = null; - - function &_getHandler() - { - } - - function &_getFilterForm() - { - } - - function _getBaseUrl() - { - } - - function getDefaultView(&$controller, &$xoopsUser) - { - $this->mPageNavi =& new LegacyRender_PageNavigator($this->_getBaseUrl(), 0, XCUBE_PAGENAVI_START | XCUBE_PAGENAVI_PERPAGE); - - $this->mFilter =& $this->_getFilterForm(); - $this->mFilter->fetch(); - - $handler =& $this->_getHandler(); - - $total = $handler->getCount($this->mFilter->getCriteria()); - - $this->mPageNavi->setTotal($total); - $this->mPageNavi->fetch(); - - $criteria = $this->mFilter->getCriteria($this->mPageNavi->getStart(), $this->mPageNavi->getPerpage()); - $this->mObjects =& $handler->getObjects($criteria); - - return LEGACYRENDER_FRAME_VIEW_INDEX; - } -} - -?> \ No newline at end of file Index: xoops2jp/html/modules/legacyRender/admin/class/AbstractEditAction.class.php diff -u xoops2jp/html/modules/legacyRender/admin/class/AbstractEditAction.class.php:1.1.2.2 xoops2jp/html/modules/legacyRender/admin/class/AbstractEditAction.class.php:removed --- xoops2jp/html/modules/legacyRender/admin/class/AbstractEditAction.class.php:1.1.2.2 Tue Mar 28 22:30:48 2006 +++ xoops2jp/html/modules/legacyRender/admin/class/AbstractEditAction.class.php Mon Jul 10 19:57:57 2006 @@ -1,85 +0,0 @@ -<?php - -if (!defined('XOOPS_ROOT_PATH')) exit(); - -class LegacyRender_AbstractEditAction extends LegacyRender_Action -{ - var $mObject = null; - var $mObjectHandler = null; - var $mActionForm = null; - - function _getId() - { - } - - function &_getHandler() - { - } - - function _setupObject() - { - $id = $this->_getId(); - - $this->mObjectHandler = $this->_getHandler(); - - $this->mObject =& $this->mObjectHandler->get($id); - if ($this->mObject == null && $this->isEnableCreate()) { - $this->mObject =& $this->mObjectHandler->create(); - } - } - - function _setupActionForm() - { - } - - /** - * @return bool - */ - function isEnableCreate() - { - return true; - } - - function prepare(&$controller, &$xoopsUser) - { - $this->_setupActionForm(); - $this->_setupObject(); - } - - function getDefaultView(&$controller,&$xoopsUser) - { - if ($this->mObject == null) { - return LEGACYRENDER_FRAME_VIEW_ERROR; - } - - $this->mActionForm->load($this->mObject); - - return LEGACYRENDER_FRAME_VIEW_INPUT; - } - - 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. - // - $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; - } -} - -?> \ No newline at end of file