[xoops-cvslog 1854] CVS update: xoops2jp/html/modules/user/admin/forms

Back to archive index

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


Index: xoops2jp/html/modules/user/admin/forms/RanksAdminDeleteForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/admin/forms/RanksAdminDeleteForm.class.php:1.1.2.1
--- /dev/null	Thu Jan 19 21:07:36 2006
+++ xoops2jp/html/modules/user/admin/forms/RanksAdminDeleteForm.class.php	Thu Jan 19 21:07:36 2006
@@ -0,0 +1,41 @@
+<?php
+
+require_once XOOPS_ROOT_PATH . "/class/XCube_ActionForm.class.php";
+
+/**
+ * This class is generated by makeActionForm tool.
+ */
+class RanksAdminDeleteForm extends XCube_ActionForm
+{
+	function getTokenName()
+	{
+		return "module.user.RanksAdminDeleteForm.TOKEN";
+	}
+
+	function prepare()
+	{
+		//
+		// Set form properties
+		//
+		$this->mFormProperties['rank_id'] =& new XCube_IntProperty('rank_id');
+
+		//
+		// Set field properties
+		//
+		$this->mFieldProperties['rank_id'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['rank_id']->setDependsByArray(array('required'));
+		$this->mFieldProperties['rank_id']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK_ID);
+	}
+
+	function load(&$obj)
+	{
+		$this->setVar('rank_id', $obj->get('rank_id'));
+	}
+
+	function update(&$obj)
+	{
+		$obj->setVar('rank_id', $this->get('rank_id'));
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/admin/forms/RanksAdminEditForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/admin/forms/RanksAdminEditForm.class.php:1.1.2.1
--- /dev/null	Thu Jan 19 21:07:36 2006
+++ xoops2jp/html/modules/user/admin/forms/RanksAdminEditForm.class.php	Thu Jan 19 21:07:36 2006
@@ -0,0 +1,88 @@
+<?php
+
+require_once XOOPS_ROOT_PATH . "/class/XCube_ActionForm.class.php";
+
+/**
+ * This class is generated by makeActionForm tool.
+ */
+class RanksAdminEditForm extends XCube_ActionForm
+{
+	var $mOldFileName = null;
+	var $_mIsNew = false;
+	var $mFormFile = null;
+	
+	function getTokenName()
+	{
+		return "module.user.RanksAdminEditForm.TOKEN";
+	}
+
+	function prepare()
+	{
+		//
+		// Set form properties
+		//
+		$this->mFormProperties['rank_id'] =& new XCube_IntProperty('rank_id');
+		$this->mFormProperties['rank_title'] =& new XCube_StringProperty('rank_title');
+		$this->mFormProperties['rank_min'] =& new XCube_IntProperty('rank_min');
+		$this->mFormProperties['rank_max'] =& new XCube_IntProperty('rank_max');
+		$this->mFormProperties['rank_special'] =& new XCube_BoolProperty('rank_special');
+		$this->mFormProperties['rank_image'] =& new XCube_FileProperty('rank_image');
+
+		//
+		// Set field properties
+		//
+		$this->mFieldProperties['rank_id'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['rank_id']->setDependsByArray(array('required'));
+		$this->mFieldProperties['rank_id']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK_ID);
+
+		$this->mFieldProperties['rank_title'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['rank_title']->setDependsByArray(array('required','maxlength'));
+		$this->mFieldProperties['rank_title']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK_TITLE, '50');
+		$this->mFieldProperties['rank_title']->addMessage('maxlength', _AD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_RANK_TITLE, '50');
+		$this->mFieldProperties['rank_title']->addVar('maxlength', 50);
+
+		$this->mFieldProperties['rank_min'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['rank_min']->setDependsByArray(array('required'));
+		$this->mFieldProperties['rank_min']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK_MIN);
+
+		$this->mFieldProperties['rank_max'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['rank_max']->setDependsByArray(array('required'));
+		$this->mFieldProperties['rank_max']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK_MAX);
+	}
+
+	function validateRank_image()
+	{
+		if ($this->_mIsNew && $this->get('rank_image') == null) {
+			$this->addErrorMessage(_AD_USER_ERROR_IMAGE_REQUIRED);
+		}
+	}
+	
+	function load(&$obj)
+	{
+		$this->set('rank_id', $obj->get('rank_id'));
+		$this->set('rank_title', $obj->get('rank_title'));
+		$this->set('rank_min', $obj->get('rank_min'));
+		$this->set('rank_max', $obj->get('rank_max'));
+		$this->set('rank_special', $obj->get('rank_special'));
+
+		$this->_mIsNew = $obj->isNew();
+		$this->mOldFileName = $obj->get('rank_image');
+	}
+
+	function update(&$obj)
+	{
+		$obj->set('rank_id', $this->get('rank_id'));
+		$obj->set('rank_title', $this->get('rank_title'));
+		$obj->set('rank_min', $this->get('rank_min'));
+		$obj->set('rank_max', $this->get('rank_max'));
+		$obj->set('rank_special', $this->get('rank_special'));
+
+		$this->mFormFile = $this->get('rank_image');
+		if ($this->mFormFile != null) {
+			$this->mFormFile->setRandomToBodyName('rank');
+			$obj->set('rank_image', $this->mFormFile->getFileName());
+		}
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/admin/forms/RanksFilterForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/admin/forms/RanksFilterForm.class.php:1.1.2.1
--- /dev/null	Thu Jan 19 21:07:36 2006
+++ xoops2jp/html/modules/user/admin/forms/RanksFilterForm.class.php	Thu Jan 19 21:07:36 2006
@@ -0,0 +1,62 @@
+<?php
+
+require_once XOOPS_MODULE_PATH . "/user/class/AbstractFilterForm.class.php";
+
+define('RANKS_SORT_KEY_DEFAULT', 0);
+define('RANKS_SORT_KEY_RANK_ID', 1);
+define('RANKS_SORT_KEY_RANK_TITLE', 2);
+define('RANKS_SORT_KEY_RANK_MIN', 3);
+define('RANKS_SORT_KEY_RANK_MAX', 4);
+define('RANKS_SORT_KEY_RANK_SPECIAL', 5);
+define('RANKS_SORT_KEY_RANK_IMAGE', 6);
+define('RANKS_SORT_KEY_MAXVALUE', 6);
+
+class User_RanksFilterForm extends User_AbstractFilterForm
+{
+	var $mSort = 0;
+	var $_mSortKeys = array(
+		RANKS_SORT_KEY_DEFAULT => 'rank_id',
+		RANKS_SORT_KEY_RANK_ID => 'rank_id',
+		RANKS_SORT_KEY_RANK_TITLE => 'rank_title',
+		RANKS_SORT_KEY_RANK_MIN => 'rank_min',
+		RANKS_SORT_KEY_RANK_MAX => 'rank_max',
+		RANKS_SORT_KEY_RANK_SPECIAL => 'rank_special',
+		RANKS_SORT_KEY_RANK_IMAGE => 'rank_image'
+	);
+	var $_mCriteria = null;
+
+	function fetch()
+	{
+		$this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : 0;
+	
+		if ($this->mSort > RANKS_SORT_KEY_MAXVALUE) {
+			$this->mSort = RANKS_SORT_KEY_DEFAULT;
+		}
+	
+		if (isset($_REQUEST['rank_id'])) {
+			$this->_mCriteria->add(new Criteria('rank_id', array(XOBJ_DTYPE_INT, xoops_getrequest('rank_id'))));
+		}
+	
+		if (isset($_REQUEST['rank_title'])) {
+			$this->_mCriteria->add(new Criteria('rank_title', array(XOBJ_DTYPE_STRING, xoops_getrequest('rank_title'))));
+		}
+	
+		if (isset($_REQUEST['rank_min'])) {
+			$this->_mCriteria->add(new Criteria('rank_min', array(XOBJ_DTYPE_INT, xoops_getrequest('rank_min'))));
+		}
+	
+		if (isset($_REQUEST['rank_max'])) {
+			$this->_mCriteria->add(new Criteria('rank_max', array(XOBJ_DTYPE_INT, xoops_getrequest('rank_max'))));
+		}
+	
+		if (isset($_REQUEST['rank_special'])) {
+			$this->_mCriteria->add(new Criteria('rank_special', array(XOBJ_DTYPE_BOOL, xoops_getrequest('rank_special'))));
+		}
+	
+		if (isset($_REQUEST['rank_image'])) {
+			$this->_mCriteria->add(new Criteria('rank_image', array(XOBJ_DTYPE_STRING, xoops_getrequest('rank_image'))));
+		}
+	}
+}
+
+?>


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