From: <pan...@us...> - 2008-09-25 11:11:40
|
Revision: 383 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=383&view=rev Author: panzaboi Date: 2008-09-25 11:11:35 +0000 (Thu, 25 Sep 2008) Log Message: ----------- New Login Form: Dojo small fix Modified Paths: -------------- website/application/default/models/Index.php website/application/default/models/LoginForm.php Modified: website/application/default/models/Index.php =================================================================== --- website/application/default/models/Index.php 2008-09-25 11:10:50 UTC (rev 382) +++ website/application/default/models/Index.php 2008-09-25 11:11:35 UTC (rev 383) @@ -33,6 +33,4 @@ { return $this->select()->setIntegrityCheck(false)->from($this)->joinLeft('cards_x_users', 'cards_x_users.card_id=cards.id') ->where('cards_x_users.user_id = ?', $userid)->query()->fetchAll(); } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: website/application/default/models/LoginForm.php =================================================================== --- website/application/default/models/LoginForm.php 2008-09-25 11:10:50 UTC (rev 382) +++ website/application/default/models/LoginForm.php 2008-09-25 11:11:35 UTC (rev 383) @@ -1,64 +1,80 @@ <?php -class LoginForm extends Zend_Form +class LoginForm extends Zend_Dojo_Form { public $elementDecorators = array( - 'ViewHelper', + 'DijitElement', 'Errors', array('Label', array('class' => 'overlabel')), array('HtmlTag', array('tag' => 'div', 'class' => 'elcontainer')) ); public $buttonDecorators = array( - 'ViewHelper', + 'DijitElement', ); public function init() { - $this->addElementPrefixPath('Ostacium_Form', 'Ostacium/Form/'); + $translate = Zend_Registry::get('Zend_Translate'); + //$this->addElementPrefixPath('Ostacium_Form', 'Ostacium/Form/'); - $this->addElement('text', 'username', array( - 'decorators' => $this->elementDecorators, - 'filters' => array('StringTrim', 'StringToLower'), - 'validators' => array( + $this->addElement('ValidationTextBox', 'username', array( + 'decorators' => $this->elementDecorators, + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( array('StringLength', false, array(5, 50)), ), - 'required' => true, - 'title' => 'Username', - 'label' => 'Username:', + 'required' => true, + 'maxlength' => 50, + 'trim' => true, + 'lowercase' => true, + 'style' => 'height: 18px; width: 100px;', + 'regExp' => '[\S]{5,50}', + 'invalidMessage' => sprintf($translate->_('errorBetween'), 5, 50), + 'title' => 'Username', + 'label' => 'Username:', )); - - $this->addElement('password', 'password', array( - 'decorators' => $this->elementDecorators, - 'filters' => array('StringTrim'), - 'validators' => array( + + + + $this->addElement('PasswordTextBox', 'password', array( + 'decorators' => $this->elementDecorators, + 'filters' => array('StringTrim'), + 'validators' => array( 'Alnum', array('StringLength', false, array(5, 32)), ), - 'required' => true, - 'title' => 'Password', - 'label' => 'Password:', + 'required' => true, + 'trim' => true, + 'style' => 'height: 18px; width: 100px;', + 'regExp' => '^[a-z0-9]{5,32}$', + 'invalidMessage' => sprintf($translate->_('errorBetween'), 5, 32), + 'title' => 'Password', + 'label' => 'Password:', )); + + - $this->addElement('submit', 'loginbutton', array( - //array(array('HtmlTag', array('tag' => 'a', 'class' => 'loginR', 'placement' => 'prepend', 'href' => $this->getView()->url(array('module' => 'default', 'controller' => 'index', 'action' => 'register'), null, true), 'markup' => 'Реєстрація'))) - 'decorators' => array_merge($this->buttonDecorators), - 'required' => false, - 'ignore' => true, - 'class' => 'LoginL', - 'label' => 'Login', + $this->addElement('SubmitButton', 'loginbutton', array( + 'decorators' => $this->buttonDecorators, + 'required' => false, + 'ignore' => true, + 'label' => 'Login', )); - } public function loadDefaultDecorators() { +// $this->setDecorators(array( +// 'FormElements', +// 'Form', +// array('Description', array('placement' => 'prepend', 'tag' => 'div', 'class' => 'error')), +// )); + $this->setDecorators(array( - 'FormElements', - 'Form', - array('Description', array('placement' => 'prepend', 'tag' => 'div', 'class' => 'error')), - )); + 'FormElements', + 'DijitForm', + array('Description', array('placement' => 'prepend', 'tag' => 'div', 'class' => 'error')), + )); } -} - -?> \ No newline at end of file +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |