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

Back to archive index

Minahito minah****@users*****
2006年 1月 26日 (木) 20:14:04 JST


Index: xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php:1.1.2.1
--- /dev/null	Thu Jan 26 20:14:04 2006
+++ xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php	Thu Jan 26 20:14:04 2006
@@ -0,0 +1,57 @@
+<?php
+
+require_once XOOPS_ROOT_PATH . "/class/XCube_ActionForm.class.php";
+
+class User_AvatarSelectForm extends XCube_ActionForm
+{
+	var $mSelectedId = null;
+	
+	function getTokenName()
+	{
+		return "module.user.AvatarSelectForm.TOKEN";
+	}
+
+	function prepare()
+	{
+		$this->mFormProperties['uid'] =& new XCube_IntProperty('uid');
+		$this->mFormProperties['avatar_id'] =& new XCube_IntArrayProperty('avatar_id');
+	}
+	
+	function validateAvatar_id()
+	{
+		$ids = $this->get('avatar_id');
+		
+		if (count($ids) != 1) {
+			$this->addErrorMessage(_MD_USER_ERROR_AVATAR_SELECT);
+		}
+		
+		foreach ($ids as $avatar_id => $dmy_value) {
+			$this->mSelectedId = $avatar_id;
+		}
+		
+		//
+		// Check whether specified avatar_id exists. 
+		//
+		$handler =& xoops_getmodulehandler('avatar');
+		$obj =& $handler->get($this->mSelectedId);
+		
+		if (!is_object($obj)) {
+			$this->addErrorMessage(_MD_USER_ERROR_AVATAR_SELECT);
+		}
+	}
+	
+	function load(&$obj)
+	{
+		$this->set('uid', $obj->get('uid'));
+	}
+	
+	function update(&$obj)
+	{
+		$handler =& xoops_getmodulehandler('avatar');
+		$avatar =& $handler->get($this->mSelectedId);
+		
+		$obj->set('user_avatar', $avatar->get('avatar_file'));
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/PageNavigator.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/PageNavigator.class.php:1.1.2.1
--- /dev/null	Thu Jan 26 20:14:04 2006
+++ xoops2jp/html/modules/user/forms/PageNavigator.class.php	Thu Jan 26 20:14:04 2006
@@ -0,0 +1,35 @@
+<?php
+
+require_once XOOPS_ROOT_PATH . "/class/XCube_PageNavigator.class.php";
+
+class User_PageNavigator extends XCube_PageNavigator
+{
+	function getRenderSortUrl()
+	{
+		return parent::renderSortUrl('sort');
+	}
+
+	function renderHidden($sort = null)
+	{
+		if ($mask == null) {
+			$mask = array();
+		}
+		elseif (!is_array($mask)) {
+			$mask = array($mask);
+		}
+	
+		$ret = null;
+	
+		foreach ($this->mExtra as $key => $value) {
+		}
+	
+		if (!isset($mask[$key])) {
+			$value = htmlspecialchars($value, ENT_QUOTES);
+			$ret .= "<input type=\"hidden\" name=\"${key}\" value=\"${value}\" />";
+		}
+	
+		return $ret;
+	}
+}
+
+?>


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