import v2.0.0.0_RC3 | 2012-07-01
https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
30
modules/users/forms/SigninImage.php
Normal file
30
modules/users/forms/SigninImage.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2010 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkeys Ltd.
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
|
||||
class Users_Form_SigninImage extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$image = new Monkeys_Form_Element_File('image');
|
||||
$image->setLabel('')
|
||||
->setRequired(true)
|
||||
->setDescription('Only files of type jpg, jpeg, png and gif are allowed.<br />Maximum size is 2 MB.')
|
||||
->addValidator('Count', false, 1)
|
||||
->addValidator('Size', false, 2097152) // 2 MB
|
||||
->addValidator('Extension', false, 'jpg, jpeg, png, gif')
|
||||
->addFilter('StripNewlines'); // just a hack to circumvent ZF bug
|
||||
translate('Only files of type jpg, jpeg, png and gif are allowed.<br />Maximum size is 2 MB.');
|
||||
|
||||
$this->addElements(array($image));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user