import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -4,8 +4,8 @@
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkeys Ltd.
|
||||
* @since Textroller 0.9
|
||||
* @package TextRoller
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
* This class is never called. It's only a placeholder for form error messages wrapped in translate(),
|
||||
* so that Poedit (or any other message catalogs editor) can catalog these messages for translation
|
||||
*/
|
||||
class ErrorMessages
|
||||
class Form_ErrorMessages
|
||||
{
|
||||
private function _messages()
|
||||
{
|
||||
@ -24,5 +24,6 @@ class ErrorMessages
|
||||
translate('\'%value%\' appears to be a local network name but local network names are not allowed');
|
||||
translate('Captcha value is wrong');
|
||||
translate('Password confirmation does not match');
|
||||
translate('Username can only contain US-ASCII alphanumeric characters, plus any of the symbols $-_.+!*\'(), and "');
|
||||
}
|
||||
}
|
||||
|
61
modules/default/forms/Feedback.php
Normal file
61
modules/default/forms/Feedback.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkey Ltd
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Form_Feedback extends Zend_Form
|
||||
{
|
||||
private $_baseWebDir;
|
||||
|
||||
public function __construct($options = null, $baseWebDir = null)
|
||||
{
|
||||
$this->_baseWebDir = $baseWebDir;
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$name = new Monkeys_Form_Element_Text('name');
|
||||
translate('Enter your name');
|
||||
$name->setLabel('Enter your name')
|
||||
->setRequired(true);
|
||||
|
||||
$email = new Monkeys_Form_Element_Text('email');
|
||||
translate('Enter your E-mail');
|
||||
$email->setLabel('Enter your E-mail')
|
||||
->addFilter('StringToLower')
|
||||
->setRequired(true)
|
||||
->addValidator('EmailAddress');
|
||||
|
||||
$feedback = new Monkeys_Form_Element_Textarea('feedback');
|
||||
translate('Enter your questions or comments');
|
||||
$feedback->setLabel('Enter your questions or comments')
|
||||
->setRequired(true)
|
||||
->setAttrib('cols', 60)
|
||||
->setAttrib('rows', 4);
|
||||
|
||||
// ZF has some bugs when using mutators here, so I have to use the config array
|
||||
translate('Please enter the text below');
|
||||
$captcha = new Monkeys_Form_Element_Captcha('captcha', array(
|
||||
'label' => 'Please enter the text below',
|
||||
'captcha' => array(
|
||||
'captcha' => 'Image',
|
||||
'sessionClass' => get_class(Zend_Registry::get('appSession')),
|
||||
'font' => APP_DIR . '/libs/Monkeys/fonts/Verdana.ttf',
|
||||
'imgDir' => APP_DIR . '/webdir/captchas',
|
||||
'imgUrl' => $this->_baseWebDir . '/captchas',
|
||||
'wordLen' => 4,
|
||||
'fontSize' => 30,
|
||||
'timeout' => 300,
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElements(array($name, $email, $feedback, $captcha));
|
||||
}
|
||||
}
|
34
modules/default/forms/MessageUsers.php
Normal file
34
modules/default/forms/MessageUsers.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkey Ltd
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Form_MessageUsers extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$subject = new Monkeys_Form_Element_Text('subject');
|
||||
translate('Subject:');
|
||||
$subject->setLabel('Subject')
|
||||
->setRequired(true);
|
||||
|
||||
$cc = new Monkeys_Form_Element_Text('cc');
|
||||
translate('CC:');
|
||||
$cc->setLabel('CC');
|
||||
|
||||
$bodyPlain = new Monkeys_Form_Element_Textarea('bodyPlain');
|
||||
$bodyPlain->setDecoratorOptions(array('separateLine' => true));
|
||||
|
||||
$bodyHTML= new Monkeys_Form_Element_Richtextarea('bodyHTML');
|
||||
$bodyHTML->setDecoratorOptions(array('separateLine' => true))
|
||||
->setAttrib('width', '510px');
|
||||
|
||||
$this->addElements(array($subject, $cc, $bodyPlain, $bodyHTML));
|
||||
}
|
||||
}
|
63
modules/default/forms/OpenidLogin.php
Normal file
63
modules/default/forms/OpenidLogin.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkey Ltd
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Form_OpenIdLogin extends Zend_Form
|
||||
{
|
||||
private $_baseWebDir;
|
||||
private $_useCaptcha;
|
||||
|
||||
public function __construct($options = null, $baseWebDir = null, $useCaptcha= false)
|
||||
{
|
||||
$this->_baseWebDir = $baseWebDir;
|
||||
$this->_useCaptcha = $useCaptcha;
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$openIdIdentity = new Monkeys_Form_Element_Text('openIdIdentity');
|
||||
translate('OpenID URL');
|
||||
$openIdIdentity->setLabel('OpenID URL')
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true))
|
||||
->setAttrib('style', 'width:300px')
|
||||
->setRequired(true);
|
||||
|
||||
$password = new Monkeys_Form_Element_Password('password');
|
||||
translate('Password');
|
||||
$password->setLabel('Password')
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true))
|
||||
->setAttrib('style', 'width:300px')
|
||||
->setRequired(true);
|
||||
|
||||
$this->addElements(array($openIdIdentity, $password));
|
||||
|
||||
if ($this->_useCaptcha) {
|
||||
$captcha = new Monkeys_Form_Element_Captcha('captcha', array(
|
||||
'label' => 'Please enter the text below',
|
||||
'captcha' => array(
|
||||
'captcha' => 'Image',
|
||||
'sessionClass' => get_class(Zend_Registry::get('appSession')),
|
||||
'font' => APP_DIR . '/libs/Monkeys/fonts/Verdana.ttf',
|
||||
'imgDir' => WEB_DIR. '/captchas',
|
||||
'imgUrl' => $this->_baseWebDir . '/captchas',
|
||||
'wordLen' => 4,
|
||||
'fontSize' => 30,
|
||||
'timeout' => 300,
|
||||
)
|
||||
));
|
||||
$captcha->setDecoratorOptions(array(
|
||||
'dontMarkRequired' => true,
|
||||
));
|
||||
|
||||
$this->addElement($captcha);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user