[xoops-cvslog 1851] CVS update: xoops2jp/html/modules/user/admin/actions

Back to archive index

Minahito minah****@users*****
2006年 1月 19日 (木) 21:06:54 JST


Index: xoops2jp/html/modules/user/admin/actions/UserListAction.class.php
diff -u /dev/null xoops2jp/html/modules/user/admin/actions/UserListAction.class.php:1.1.2.1
--- /dev/null	Thu Jan 19 21:06:54 2006
+++ xoops2jp/html/modules/user/admin/actions/UserListAction.class.php	Thu Jan 19 21:06:54 2006
@@ -0,0 +1,34 @@
+<?php
+
+require_once XOOPS_MODULE_PATH . "/user/class/PageNavigator.class.php";
+require_once XOOPS_MODULE_PATH . "/user/class/AbstractListAction.class.php";
+require_once XOOPS_MODULE_PATH . "/user/admin/forms/UserFilterForm.class.php";
+
+class User_UserListAction extends User_AbstractListAction
+{
+	function &_getHandler()
+	{
+		$handler =& xoops_gethandler('user');
+		return $handler;
+	}
+
+	function &_getFilterForm(&$navi)
+	{
+		$filter =& new User_UserFilterForm($navi);
+		return $filter;
+	}
+
+	function _getBaseUrl()
+	{
+		return "./index.php?action=UsersList";
+	}
+
+	function executeViewIndex(&$controller, &$xoopsUser, &$render)
+	{
+		$render->setTemplateName("user_list.html");
+		$render->setAttribute("objects", $this->mObjects);
+		$render->setAttribute("pageNavi", $this->mNavi);
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/admin/actions/UserDeleteAction.class.php
diff -u /dev/null xoops2jp/html/modules/user/admin/actions/UserDeleteAction.class.php:1.1.2.1
--- /dev/null	Thu Jan 19 21:06:54 2006
+++ xoops2jp/html/modules/user/admin/actions/UserDeleteAction.class.php	Thu Jan 19 21:06:54 2006
@@ -0,0 +1,50 @@
+<?php
+
+require_once XOOPS_MODULE_PATH . "/user/class/AbstractDeleteAction.class.php";
+require_once XOOPS_MODULE_PATH . "/user/admin/forms/UserAdminDeleteForm.class.php";
+
+class User_UserDeleteAction extends User_AbstractDeleteAction
+{
+	function _getId()
+	{
+		return isset($_REQUEST['uid']) ? $_REQUEST['uid'] : 0;
+	}
+
+	function &_getHandler()
+	{
+		$handler =& xoops_gethandler('user');
+		return $handler;
+	}
+
+	function _setupActionForm()
+	{
+		$this->mActionForm =& new UserAdminDeleteForm();
+		$this->mActionForm->prepare();
+	}
+	
+	function _doExecute()
+	{
+		$handler =& xoops_gethandler('member');
+		return $handler->delete($this->mObject) ? USER_FRAME_VIEW_SUCCESS
+		                                        : USER_FRAME_VIEW_ERROR;
+	}
+
+	function executeViewInput(&$controller, &$xoopsUser, &$render)
+	{
+		$render->setTemplateName("user_delete.html");
+		$render->setAttribute('actionForm', $this->mActionForm);
+		$render->setAttribute('object', $this->mObject);
+	}
+
+	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
+	{
+		$controller->executeForward("./index.php?action=UserList");
+	}
+
+	function executeViewError(&$controller, &$xoopsUser, &$render)
+	{
+		redirect_header("./index.php?action=UserList", 1, _AD_USER_ERROR_DBUPDATE_FAILED);
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/admin/actions/UserEditAction.class.php
diff -u /dev/null xoops2jp/html/modules/user/admin/actions/UserEditAction.class.php:1.1.2.1
--- /dev/null	Thu Jan 19 21:06:54 2006
+++ xoops2jp/html/modules/user/admin/actions/UserEditAction.class.php	Thu Jan 19 21:06:54 2006
@@ -0,0 +1,99 @@
+<?php
+
+require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php";
+require_once XOOPS_MODULE_PATH . "/user/admin/forms/UserAdminEditForm.class.php";
+
+class User_UserEditAction extends User_AbstractEditAction
+{
+	function _getId()
+	{
+		return isset($_REQUEST['uid']) ? intval($_REQUEST['uid']) : 0;
+	}
+	
+	function &_getHandler()
+	{
+		$handler =& xoops_getmodulehandler('users');
+		return $handler;
+	}
+
+	function _setupActionForm()
+	{
+		$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(new Criteria('rank_special',1));
+
+		$render->setAttribute('ranks', $ranks);
+		
+		$groupHandler =& xoops_gethandler('group');
+		$groups =& $groupHandler->getObjects(null, true);
+		
+		$groupOptions = array();
+		foreach ($groups as $gid => $group) {
+			$groupOptions[$gid] = $group->getVar('name');
+		}
+
+		$render->setAttribute('groupOptions', $groupOptions);
+
+		//
+		// 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)
+	{
+		$controller->executeForward("./index.php?action=UserList");
+	}
+
+	function executeViewError(&$controller,&$xoopsUser,&$renderSystem)
+	{
+		XCube_Utils::redirectHeader("index.php", 1, "*ERROR*");
+	}
+}
+
+?>
\ No newline at end of file


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