Minahito
minah****@users*****
2006年 1月 8日 (日) 16:48:47 JST
Index: xoops2jp/html/modules/user/admin/actions/UserUserEditAction.class.php diff -u /dev/null xoops2jp/html/modules/user/admin/actions/UserUserEditAction.class.php:1.1.2.1 --- /dev/null Sun Jan 8 16:48:47 2006 +++ xoops2jp/html/modules/user/admin/actions/UserUserEditAction.class.php Sun Jan 8 16:48:47 2006 @@ -0,0 +1,110 @@ +<?php + +require_once XOOPS_ROOT_PATH."/modules/user/admin/forms/UserEditForm.class.php"; + +class UserUserEditAction extends UserAction +{ + var $mUser = null; + var $mUserHandler = null; + var $mActionForm=null; + + function isSecure() + { + return true; + } + + function getDefaultView(&$controller,&$xoopsUser) + { + $this->_proccessActionForm(); + $this->_proccessObject($controller); + + $this->mActionForm->load($this->mUser); + + return USER_FRAME_VIEW_INPUT; + } + + function execute(&$controller,&$xoopsUser) + { + } + + 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() + { + $this->mActionForm =& new User_UserAdminEditForm(); + $this->mActionForm->prepare(); + } + + function executeViewInput(&$controller,&$xoopsUser,&$render) + { + $render->setTemplateName("user_edit.html"); + $render->setAttribute("actionForm",$this->mActionForm); + + // + // Get some objects for input form. + // + $tzoneHandler =& xoops_gethandler('timezone'); + $timezones =& $tzoneHandler->getObjects(); + + $render->setAttribute('timezones', $timezones); + + $rankHandler =& xoops_getmodulehandler('rank'); + $ranks =& $rankHandler->getObjects(); + + $render->setAttribute('ranks', $ranks); + + // + // umode option + // + $umodeOptions = array("nest" => _NESTED, "flat" => _FLAT, "thread" => _THREADED); + $render->setAttribute('umodeOptions', $umodeOptions); + + // + // uorder option + // + $uorderOptions = array(0 => _OLDESTFIRST, 1 => _NEWESTFIRST); + $render->setAttribute('uorderOptions', $uorderOptions); + + + // + // notify option + // + + // Because abstract message catalog style is not decided, we load directly. + $root =& XCube_Root::getSingleton(); + require_once XOOPS_ROOT_PATH. "/language/" . $root->mController->getConfig('language') . "/notification.php"; + require_once XOOPS_ROOT_PATH . "/include/notification_constants.php"; + + $methodOptions = array(XOOPS_NOTIFICATION_METHOD_DISABLE => _NOT_METHOD_DISABLE, + XOOPS_NOTIFICATION_METHOD_PM => _NOT_METHOD_PM, + XOOPS_NOTIFICATION_METHOD_EMAIL => _NOT_METHOD_EMAIL + ); + $render->setAttribute('notify_methodOptions', $methodOptions); + + $modeOptions = array(XOOPS_NOTIFICATION_MODE_SENDALWAYS => _NOT_MODE_SENDALWAYS, + XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE => _NOT_MODE_SENDONCE, + XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT => _NOT_MODE_SENDONCEPERLOGIN + ); + $render->setAttribute('notify_modeOptions', $modeOptions); + } + + function executeViewSuccess(&$controller,&$xoopsUser,&$renderSystem) + { + XCube_Utils::redirectHeader("index.php?action=GroupList", 1, "*SUCCESS*"); + } + + function executeViewError(&$controller,&$xoopsUser,&$renderSystem) + { + XCube_Utils::redirectHeader("index.php?action=GroupList", 1, "*ERROR*"); + } +} + +?> \ No newline at end of file