Minahito
minah****@users*****
2006年 1月 29日 (日) 00:53:43 JST
Index: xoops2jp/html/modules/base/admin/class/LegacyAdminActionFrame.class.php diff -u xoops2jp/html/modules/base/admin/class/LegacyAdminActionFrame.class.php:1.1.2.2 xoops2jp/html/modules/base/admin/class/LegacyAdminActionFrame.class.php:removed --- xoops2jp/html/modules/base/admin/class/LegacyAdminActionFrame.class.php:1.1.2.2 Thu Dec 1 01:18:22 2005 +++ xoops2jp/html/modules/base/admin/class/LegacyAdminActionFrame.class.php Sun Jan 29 00:53:43 2006 @@ -1,178 +0,0 @@ -<?php -// $Id: LegacyAdminActionFrame.class.php,v 1.1.2.2 2005/11/30 16:18:22 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 // -// ------------------------------------------------------------------------ // - -require_once XOOPS_ROOT_PATH."/class/XCube_ActionStrategy.class.php"; - -define ("LEGACY_ADMIN_FRAME_PERFORM_SUCCESS",1); -define ("LEGACY_ADMIN_FRAME_PERFORM_FAIL",2); -define ("LEGACY_ADMIN_FRAME_INIT_SUCCESS",3); - -define ("LEGACY_ADMIN_FRAME_VIEW_NONE",0); -define ("LEGACY_ADMIN_FRAME_VIEW_SUCCESS",1); -define ("LEGACY_ADMIN_FRAME_VIEW_ERROR",2); -define ("LEGACY_ADMIN_FRAME_VIEW_INDEX",3); -define ("LEGACY_ADMIN_FRAME_VIEW_INPUT",4); - -/** - * This is simple frame work for misc page controller. - * @package legacy - */ -class LegacyAdminActionFrame extends XCube_ActionStrategy -{ - var $mActionName=""; - var $mAction=null; - - function LegacyAdminActionFrame() - { - } - - function setActionName($actionName) - { - $this->mActionName=$actionName; - } - - function execute(&$controller) - { - if($this->mActionName==null) - $this->mActionName=isset($_REQUEST['action']) ? trim($_REQUEST['action']) : "default"; - - if(!preg_match("/^\w+$/",$this->mActionName)) - die(); - - - // - // Create action object by mActionName - // - $className="Legacy".ucfirst($this->mActionName)."Action"; - $fileName=XOOPS_ROOT_PATH."/modules/base/admin/actions/${className}.class.php"; - if(!file_exists($fileName)) - die(); // TODO - - require_once $fileName; - if(class_exists($className)) - $this->mAction=new $className(); - - $this->mAction->prepare($controller,$controller->getXoopsUser()); - - if(!is_object($this->mAction)) - die(); // TODO - - // - // Simple Permission check - // - if($this->mAction->isSecure()&&!is_object($controller->getXoopsUser())) { - $errorMessages= array(_PM_SORRY,_PM_PLZREG); - XCube_Utils::redirectHeader(XOOPS_URL,2,$errorMessages); - } - - // - // 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 LEGACY_ADMIN_FRAME_VIEW_SUCCESS: - $this->mAction->executeViewSuccess($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case LEGACY_ADMIN_FRAME_VIEW_ERROR: - $this->mAction->executeViewError($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case LEGACY_ADMIN_FRAME_VIEW_INDEX: - $this->mAction->executeViewIndex($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - - case LEGACY_ADMIN_FRAME_VIEW_INPUT: - $this->mAction->executeViewInput($controller,$controller->getXoopsUser(),$controller->mRenderSystem); - break; - } - } -} - -class LegacyAdminAction -{ - var $mConfig; - - function LegacyAdminAction() - { - } - - function prepare(&$controller,&$xoopsUser) - { - $this->mConfig=$controller->mModuleController->getConfig(); - } - - /** - * @return bool - */ - function isSecure() - { - return false; - } - - /** - * @param $controller Base_Controller - * @param $xoopsUser XoopsUserObject - */ - function getDefaultView(&$controller,&$xoopsUser) - { - return LEGACY_ADMIN_FRAME_VIEW_NONE; - } - - function execute(&$controller,&$xoopsUser) - { - return LEGACY_ADMIN_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