Minahito
minah****@users*****
2006年 7月 13日 (木) 19:49:15 JST
Index: xoops2jp/html/modules/user/admin/forms/GroupAdminEditForm.class.php diff -u /dev/null xoops2jp/html/modules/user/admin/forms/GroupAdminEditForm.class.php:1.1.2.1 --- /dev/null Thu Jul 13 19:49:15 2006 +++ xoops2jp/html/modules/user/admin/forms/GroupAdminEditForm.class.php Thu Jul 13 19:49:15 2006 @@ -0,0 +1,57 @@ +<?php +/** + * @package user + * @version $Id: GroupAdminEditForm.class.php,v 1.1.2.1 2006/07/13 10:49:15 minahito Exp $ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/class/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; + +class User_GroupAdminEditForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.user.GroupAdminEditForm.TOKEN" . $this->get('groupid'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['groupid'] =& new XCube_IntProperty('groupid'); + $this->mFormProperties['name'] =& new XCube_StringProperty('name'); + $this->mFormProperties['description'] =& new XCube_TextProperty('description'); + + // + // Set field properties + // + $this->mFieldProperties['groupid'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['groupid']->setDependsByArray(array('required')); + $this->mFieldProperties['groupid']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_GROUPID); + + $this->mFieldProperties['name'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['name']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['name']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_GROUP_NAME, '50'); + $this->mFieldProperties['name']->addMessage('maxlength', _AD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_GROUP_NAME, '50'); + $this->mFieldProperties['name']->addVar('maxlength', '50'); + } + + function load(&$obj) + { + $this->set('groupid', $obj->get('groupid')); + $this->set('name', $obj->get('name')); + $this->set('description', $obj->get('description')); + } + + function update(&$obj) + { + $obj->set('groupid', $this->get('groupid')); + $obj->set('name', $this->get('name')); + $obj->set('description', $this->get('description')); + } +} + +?>