Minahito
minah****@users*****
2006年 1月 8日 (日) 23:02:10 JST
Index: xoops2jp/html/modules/user/admin/actions/UserRankEditAction.class.php diff -u xoops2jp/html/modules/user/admin/actions/UserRankEditAction.class.php:1.1.2.2 xoops2jp/html/modules/user/admin/actions/UserRankEditAction.class.php:1.1.2.3 --- xoops2jp/html/modules/user/admin/actions/UserRankEditAction.class.php:1.1.2.2 Tue Nov 22 23:34:24 2005 +++ xoops2jp/html/modules/user/admin/actions/UserRankEditAction.class.php Sun Jan 8 23:02:10 2006 @@ -1,61 +1,22 @@ <?php -require_once XOOPS_ROOT_PATH."/modules/user/class/RankObject.class.php"; -require_once XOOPS_ROOT_PATH."/modules/user/admin/forms/RankEditForm.class.php"; +require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php"; +require_once XOOPS_MODULE_PATH . "/user/admin/forms/RankEditForm.class.php"; -class UserRankEditAction extends UserAction +class UserRankEditAction extends User_AbstractEditAction { - var $mRank=null; - var $mRankHandler=null; - var $mActionForm=null; - - function isSecure() + function _getId() { - return true; - } - - function getDefaultView(&$controller,&$xoopsUser) - { - $this->_proccessActionForm(); - $this->_proccessObject($controller); - - $this->mActionForm->load($this->mRank); - - return USER_FRAME_VIEW_INPUT; + return isset($_REQUEST['rank_id']) ? intval($_REQUEST['rank_id']) : 0; } - function execute(&$controller,&$xoopsUser) - { - $this->_proccessActionForm(); - $this->_proccessObject($controller); - - // - // If image is no, the data has to continue to keep his value. - // - $this->mActionForm->load($this->mRank); - - $this->mActionForm->fetch(); - $this->mActionForm->validate(); - - if($this->mActionForm->hasError()) - return USER_FRAME_VIEW_INPUT; - - $this->mActionForm->update($this->mRank); - - return $this->mRankHandler->insert($this->mRank) ? USER_FRAME_VIEW_SUCCESS - : USER_FRAME_VIEW_ERROR; - } - - function _proccessObject(&$controller) + function &_getHandler() { - $rank_id=isset($_REQUEST['rank_id']) ? intval($_REQUEST['rank_id']) : 0; - $this->mRankHandler=new UserRankObjectHandler($controller->mDB); - $this->mRank=&$this->mRankHandler->get($rank_id); - if(!is_object($this->mRank)) - $this->mRank=&$this->mRankHandler->create(); + $handler =& xoops_getmodulehandler('rank'); + return $handler; } - function _proccessActionForm() + function _setupActionForm() { $this->mActionForm=new RankEditForm(); $this->mActionForm->prepare(); Index: xoops2jp/html/modules/user/admin/actions/UserUserEditAction.class.php diff -u xoops2jp/html/modules/user/admin/actions/UserUserEditAction.class.php:1.1.2.1 xoops2jp/html/modules/user/admin/actions/UserUserEditAction.class.php:1.1.2.2 --- xoops2jp/html/modules/user/admin/actions/UserUserEditAction.class.php:1.1.2.1 Sun Jan 8 16:48:47 2006 +++ xoops2jp/html/modules/user/admin/actions/UserUserEditAction.class.php Sun Jan 8 23:02:10 2006 @@ -1,43 +1,26 @@ <?php -require_once XOOPS_ROOT_PATH."/modules/user/admin/forms/UserEditForm.class.php"; +require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php"; +require_once XOOPS_MODULE_PATH . "/user/admin/forms/UserEditForm.class.php"; -class UserUserEditAction extends UserAction +class UserUserEditAction extends User_AbstractEditAction { - var $mUser = null; - var $mUserHandler = null; - var $mActionForm=null; - - function isSecure() + function execute(&$controller,&$xoopsUser) { - return true; } - function getDefaultView(&$controller,&$xoopsUser) + function _getId() { - $this->_proccessActionForm(); - $this->_proccessObject($controller); - - $this->mActionForm->load($this->mUser); - - return USER_FRAME_VIEW_INPUT; + return isset($_REQUEST['uid']) ? intval($_REQUEST['uid']) : 0; } - function execute(&$controller,&$xoopsUser) + function &_getHandler() { + $handler =& xoops_gethandler('user'); + return $handler; } - function _proccessObject(&$controller) - { - $groupId=isset($_REQUEST['uid']) ? intval($_REQUEST['uid']) : 0; - $this->mUserHandler =& xoops_gethandler('user'); - $this->mUser =& $this->mUserHandler->get($groupId); - if (!is_object($this->mUser)) { - $this->mUser =& $this->mUserHandler->create(); - } - } - - function _proccessActionForm() + function _setupActionForm() { $this->mActionForm =& new User_UserAdminEditForm(); $this->mActionForm->prepare(); @@ -98,12 +81,12 @@ function executeViewSuccess(&$controller,&$xoopsUser,&$renderSystem) { - XCube_Utils::redirectHeader("index.php?action=GroupList", 1, "*SUCCESS*"); + XCube_Utils::redirectHeader("index.php", 1, "*SUCCESS*"); } function executeViewError(&$controller,&$xoopsUser,&$renderSystem) { - XCube_Utils::redirectHeader("index.php?action=GroupList", 1, "*ERROR*"); + XCube_Utils::redirectHeader("index.php", 1, "*ERROR*"); } } Index: xoops2jp/html/modules/user/admin/actions/UserGroupEditAction.class.php diff -u xoops2jp/html/modules/user/admin/actions/UserGroupEditAction.class.php:1.1.2.1 xoops2jp/html/modules/user/admin/actions/UserGroupEditAction.class.php:1.1.2.2 --- xoops2jp/html/modules/user/admin/actions/UserGroupEditAction.class.php:1.1.2.1 Thu Dec 22 20:24:47 2005 +++ xoops2jp/html/modules/user/admin/actions/UserGroupEditAction.class.php Sun Jan 8 23:02:10 2006 @@ -1,61 +1,22 @@ <?php -require_once XOOPS_ROOT_PATH."/modules/user/admin/forms/GroupEditForm.class.php"; +require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php"; +require_once XOOPS_MODULE_PATH . "/user/admin/forms/GroupEditForm.class.php"; -class UserGroupEditAction extends UserAction +class UserGroupEditAction extends User_AbstractEditAction { - var $mGroup = null; - var $mGroupHandler = null; - var $mActionForm=null; - - function isSecure() + function _getId() { - return true; - } - - function getDefaultView(&$controller,&$xoopsUser) - { - $this->_proccessActionForm(); - $this->_proccessObject($controller); - - $this->mActionForm->load($this->mGroup); - - return USER_FRAME_VIEW_INPUT; + return isset($_REQUEST['groupid']) ? intval($_REQUEST['groupid']) : 0; } - function execute(&$controller,&$xoopsUser) + function &_getHandler() { - $this->_proccessActionForm(); - $this->_proccessObject($controller); - - // - // If image is no, the data has to continue to keep his value. - // - $this->mActionForm->load($this->mGroup); - - $this->mActionForm->fetch(); - $this->mActionForm->validate(); - - if($this->mActionForm->hasError()) - return USER_FRAME_VIEW_INPUT; - - $this->mActionForm->update($this->mGroup); - - return $this->mGroupHandler->insert($this->mGroup) ? USER_FRAME_VIEW_SUCCESS - : USER_FRAME_VIEW_ERROR; + $handler =& xoops_gethandler('group'); + return $handler; } - function _proccessObject(&$controller) - { - $groupId=isset($_REQUEST['groupid']) ? intval($_REQUEST['groupid']) : 0; - $this->mGroupHandler =& xoops_gethandler('group'); - $this->mGroup =& $this->mGroupHandler->get($groupId); - if (!is_object($this->mGroup)) { - $this->mGroup =& $this->mGroupHandler->create(); - } - } - - function _proccessActionForm() + function _setupActionForm() { $this->mActionForm =& new User_GroupEditForm(); $this->mActionForm->prepare();