[xoops-cvslog 2068] CVS update: xoops2jp/html/modules/pm/forms

アーカイブの一覧に戻る

Minahito minah****@users*****
2006年 2月 2日 (木) 18:06:47 JST


Index: xoops2jp/html/modules/pm/forms/PmliteEditForm.class.php
diff -u xoops2jp/html/modules/pm/forms/PmliteEditForm.class.php:1.1.2.4 xoops2jp/html/modules/pm/forms/PmliteEditForm.class.php:1.1.2.5
--- xoops2jp/html/modules/pm/forms/PmliteEditForm.class.php:1.1.2.4	Wed Nov 16 19:12:25 2005
+++ xoops2jp/html/modules/pm/forms/PmliteEditForm.class.php	Thu Feb  2 18:06:47 2006
@@ -4,6 +4,9 @@
 
 /**
  * This class is generated by makeActionForm tool.
+ * 
+ * This class was generated in the old days. We should to check it.
+ * 
  * @auchor makeActionForm
  * @abstract
  */
@@ -11,6 +14,11 @@
 {
 	var $mState=null;
 	
+	function getTokenName()
+	{
+		return "module.user.PmliteEditForm.TOKEN";
+	}
+
 	function prepare()
 	{
 		$this->mFormProperties['subject']=new XCube_StringProperty('subject');
@@ -64,12 +72,12 @@
 	 */
 	function validateTo_userid()
 	{
-		if($this->getVar('to_userid')) {
+		if($this->get('to_userid')) {
 			$userHandler=&xoops_gethandler('user');
-			$user=&$userHandler->get($this->getVar('to_userid'));
+			$user=&$userHandler->get($this->get('to_userid'));
 
 			if(!(is_object($user)&&$user->isActive())) {
-				$this->setVar('to_userid',0);
+				$this->set('to_userid',0);
 				$this->addErrorMessage(_PM_USERNOEXIST);
 			}
 		}
@@ -81,20 +89,20 @@
 	function update(&$pm)
 	{
 		$userHandler=&xoops_gethandler('user');
-		$toUser=&$userHandler->get($this->getVar('to_userid'));
+		$toUser=&$userHandler->get($this->get('to_userid'));
 		$pm->setToUsers($toUser);
-		$pm->setSubject($this->getVar("subject"));
-		$pm->setMessage($this->getVar("message"));
+		$pm->setSubject($this->get("subject"));
+		$pm->setMessage($this->get("message"));
 	}
 
 	function setToUser(&$user)
 	{
-		$this->setVar('to_userid',$user->getVar('uid'));
+		$this->set('to_userid',$user->get('uid'));
 	}
 	
 	function resetToUser()
 	{
-		$this->setVar('to_userid',0);
+		$this->set('to_userid',0);
 	}
 }
 
@@ -113,9 +121,9 @@
 	 */
 	function validateTo_uname()
 	{
-		if($this->getVar('to_uname')) {
+		if($this->get('to_uname')) {
 			$userHandler=&xoops_gethandler('user');
-			$criteria=new Criteria("uname",$this->getVar("to_uname"));
+			$criteria=new Criteria("uname",$this->get("to_uname"));
 			$users=&$userHandler->getObjects($criteria);
 
 			if(!(count($users)>0 && is_object($users[0]) && $users[0]->isActive())) {
@@ -132,18 +140,18 @@
 	function update(&$pm)
 	{
 		$pm->setToUsers($this->mToUser);
-		$pm->setSubject($this->getVar("subject"));
-		$pm->setMessage($this->getVar("message"));
+		$pm->setSubject($this->get("subject"));
+		$pm->setMessage($this->get("message"));
 	}
 
 	function setToUser(&$user)
 	{
-		$this->setVar('to_uname',$user->getVar('uname'));
+		$this->set('to_uname',$user->get('uname'));
 	}
 
 	function resetToUser()
 	{
-		$this->setVar('to_uname',"");
+		$this->set('to_uname',"");
 	}
 }
 
@@ -165,26 +173,26 @@
 	 */
 	function fetch(&$form)
 	{
-		if($form->getVar('msg_id')) {
+		if($form->get('msg_id')) {
 			$pmHandler=&xoops_gethandler('privmessage');
-			$pm=&$pmHandler->get($form->getVar('msg_id'));
+			$pm=&$pmHandler->get($form->get('msg_id'));
 			if(is_object($pm)) {
 				$root=XCube_Root::getSingleton();
 				$currentUser=&$root->mController->getXoopsUser();
-				if($pm->getVar('to_userid')==$currentUser->getVar('uid')) {
-					if(!preg_match("/^Re:/",$pm->getVar('subject')))
-						$form->setVar('subject',"Re: ".$pm->getVar('subject'));
+				if($pm->get('to_userid')==$currentUser->get('uid')) {
+					if(!preg_match("/^Re:/",$pm->get('subject')))
+						$form->set('subject',"Re: ".$pm->get('subject'));
 
 					// TODO Use Active Check
 					$userHandler=&xoops_gethandler('user');
-					$user=&$userHandler->get($pm->getVar('from_userid'));
+					$user=&$userHandler->get($pm->get('from_userid'));
 
 					$form->setToUser($user);
 					$message="[quote]\n";
-					$message.=sprintf(_PM_USERWROTE,$user->getVar('uname')) . "\n";
+					$message.=sprintf(_PM_USERWROTE,$user->get('uname')) . "\n";
 					$message.=$pm->getProperty("msg_text") . "\n";
 					$message.="[/quote]\n";
-					$form->setVar("message",$message);
+					$form->set("message",$message);
 					
 					return;
 				}
@@ -194,7 +202,7 @@
 		//
 		// Reset
 		//
-		$form->setVar('msg_id',0);
+		$form->set('msg_id',0);
 		$form->resetToUser();
 	}
 }


xoops-cvslog メーリングリストの案内
アーカイブの一覧に戻る