[xoops-cvslog 3973] CVS update: xoops2jp/html/modules/base/forms

Back to archive index

Minahito minah****@users*****
2006年 8月 5日 (土) 22:21:18 JST


Index: xoops2jp/html/modules/base/forms/MiscFriendForm.class.php
diff -u /dev/null xoops2jp/html/modules/base/forms/MiscFriendForm.class.php:1.1.2.1
--- /dev/null	Sat Aug  5 22:21:18 2006
+++ xoops2jp/html/modules/base/forms/MiscFriendForm.class.php	Sat Aug  5 22:21:18 2006
@@ -0,0 +1,64 @@
+<?php
+
+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 Legacy_MiscFriendForm extends XCube_ActionForm
+{
+	function getTokenName()
+	{
+		return "module.base.MiscFriendForm.TOKEN";
+	}
+
+	function prepare()
+	{
+		//
+		// Set form properties
+		//
+		$this->mFormProperties['yname'] =& new XCube_StringProperty('yname');
+		$this->mFormProperties['ymail'] =& new XCube_StringProperty('ymail');
+		$this->mFormProperties['fname'] =& new XCube_StringProperty('fname');
+		$this->mFormProperties['fmail'] =& new XCube_StringProperty('fmail');
+	
+		//
+		// Set field properties
+		//
+	
+		$this->mFieldProperties['yname'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['yname']->setDependsByArray(array('required'));
+		$this->mFieldProperties['yname']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_YNAME);
+	
+		$this->mFieldProperties['ymail'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['ymail']->setDependsByArray(array('required','email'));
+		$this->mFieldProperties['ymail']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_YMAIL);
+		$this->mFieldProperties['ymail']->addMessage('required', _MD_BASE_ERROR_EMAIL, _MD_BASE_LANG_YMAIL);
+	
+		$this->mFieldProperties['fname'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['fname']->setDependsByArray(array('required'));
+		$this->mFieldProperties['fname']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_FNAME);
+	
+		$this->mFieldProperties['fmail'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['fmail']->setDependsByArray(array('required','email'));
+		$this->mFieldProperties['fmail']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_FMAIL);
+		$this->mFieldProperties['fmail']->addMessage('email', _MD_BASE_ERROR_EMAIL, _MD_BASE_LANG_FMAIL);
+	}
+	
+	function load(&$user)
+	{
+		$this->set('yname', $user->get('uname'));
+		$this->set('ymail', $user->get('email'));
+	}
+	
+	function update(&$mailer)
+	{
+		$mailer->assign("YOUR_NAME", $this->get('yname'));
+		$mailer->assign("FRIEND_NAME", $this->get('fname'));
+		$mailer->setToEmails($this->get('fmail'));
+		$mailer->setFromEmail($this->get('ymail'));
+		$mailer->setFromName($this->get('yname'));
+	}
+}
+
+?>


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