Ejemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->setName('loginForm');
     $this->setAttrib('id', 'login-form');
     $this->setAction('/account/login');
     $this->setMethod('post');
     $this->setDecorators(array('FormElements', 'DijitForm'));
     $this->addElement('ValidationTextBox', 'username', array('label' => 'Username', 'required' => true, 'trim' => true, 'filters' => array('StringToLower')));
     $this->addElement('PasswordTextBox', 'password', array('label' => 'Password', 'required' => true, 'trim' => false));
     $this->addElement('SubmitButton', 'submit', array('ignore' => true, 'label' => 'Log Me In'));
 }
Ejemplo n.º 2
0
    public function init()
    {
        parent::init();
        $this->setName('releaseForm');
        $this->setAttrib('id', 'release-form');
        $this->setMethod('post');
        $this->setDecorators(array('FormElements', 'DijitForm'));
        $this->addElement('ValidationTextBox', 'title', array('label' => 'Release Title', 'required' => true, 'trim' => true, 'validators' => array(array('Alnum', true, array('allowWhiteSpace' => true)))));
        $this->addElement('DateTextBox', 'publishDate', array('label' => 'Publish Date', 'description' => 'The date which this release will be available
		        	for purchase.  Note: tracks may be available as singles
		        	before this date.', 'default' => date('m/d/Y')));
        $this->addElement('SubmitButton', 'submit', array('ignore' => true, 'label' => 'Save Release'));
    }
Ejemplo n.º 3
0
 public function init()
 {
     parent::init();
     $this->setName('confirmRegisterForm');
     $this->setAttrib('id', 'confirm-register-form');
     $this->addElementPrefixPath('App_Validate', 'App/Validate/', 'validate');
     $this->setDecorators(array('FormElements', 'DijitForm'));
     $config = Initializer::getConfig();
     //--------------------------------------
     // Elements
     //--------------------------------------
     $this->addElement('ValidationTextBox', 'emailAddress', array('label' => 'Your E-Mail Address', 'description' => 'The E-mail address you wish you confirm', 'required' => true, 'trim' => true, 'filters' => array('StringToLower'), 'validators' => array(array('EmailAddress', false, array('validateMx' => true)))));
     $this->addElement('TextBox', 'code', array('label' => 'Confirmation Code', 'description' => 'This is the code you received from us.', 'required' => true, 'trim' => true, 'filters' => array('StringToUpper'), 'validators' => array('Alnum')));
     $this->addElement('SubmitButton', 'submit', array('ignore' => true, 'label' => 'Confirm My E-Mail Address'));
 }
Ejemplo n.º 4
0
 public function init()
 {
     parent::init();
     $config = Initializer::getConfig();
     $userId = Zend_Auth::getInstance()->getIdentity()->id;
     $this->setAttrib('id', 'new-track-form');
     $this->setDecorators(array('FormElements', 'DijitForm'));
     $this->addElement('FilteringSelect', 'releaseId', array('label' => 'Release', 'storeId' => 'artistReleasesDataStore', 'storeType' => 'dojo.data.ItemFileReadStore', 'description' => 'The release to attach this track to.  The track will still be downloadable as a single track, but will be grouped under the release', 'autocomplete' => true, 'storeParams' => array('url' => '/data/artists/releases/' . $userId . '?published=0', 'requestMethod' => 'get'), 'dijitParams' => array('searchAttr' => 'title')));
     $this->addElement('ValidationTextBox', 'title', array('label' => 'Track Title', 'required' => true, 'trim' => true, 'description' => 'The display title, appears in store', 'validators' => array(array('Alnum', false, array('allowWhiteSpace' => true)))));
     $this->addElement('DateTextBox', 'publishDate', array('label' => 'Publish Date', 'description' => 'The date which this track will be available for purchase', 'default' => date('m/d/Y')));
     $audioFile = new Zend_Form_Element_File('audioFile');
     $audioFile->setLabel('Master Audio File')->addDecorators(array('Description'))->setRequired(true)->setDescription('The original (master) track.  Must be a .WAV file')->setDestination($config->injestion->workDir)->addValidator('Extension', false, explode(',', $config->injestion->allowedExtensions))->addValidator('MimeType', false, explode(',', $config->injestion->allowedMimeTypes))->addFilter('Rename', array('target' => $config->injestion->workDir . '/track_' . str_pad($userId, 8, '0') . '_' . date('Ymdhs') . '.wav', 'overwrite' => true));
     $this->addElement($audioFile);
     $this->setEnctype('multipart/form-data');
     $this->addElement('SubmitButton', 'submit', array('ignore' => true, 'label' => 'Upload Track'));
 }
Ejemplo n.º 5
0
 public function init()
 {
     parent::init();
     $this->setName('registerForm');
     $this->setAttrib('id', 'register-form');
     $this->setMethod('post');
     $this->addElementPrefixPath('App_Validate', 'App/Validate/', 'validate');
     $this->setDecorators(array('FormElements', 'DijitForm'));
     $config = Initializer::getConfig();
     //--------------------------------------
     // Elements
     //--------------------------------------
     $this->addElement('ValidationTextBox', 'emailAddress', array('label' => 'Your E-Mail Address', 'description' => 'Give us your valid E-mail address.  We check this, so make sure its valid and you can access it.', 'required' => true, 'trim' => true, 'filters' => array('StringToLower'), 'validators' => array(array('EmailAddress', false, array('validateMx' => true)), array('UniqueAccountDetail', false, array('field' => 'emailAddress')))));
     $this->addElement('PasswordTextBox', 'password', array('label' => 'Choose a Password', 'description' => 'Make it a good one. It must be at least 6 characters', 'required' => true, 'trim' => false, 'validators' => array(array('StringLength', false, array(6)), array('PasswordConfirmation', true, array('field' => 'confirm_password')))));
     $this->addElement('PasswordTextBox', 'confirm_password', array('label' => 'Retype Your Password', 'description' => 'Just to make sure you didn\'t mess up', 'required' => true, 'trim' => false));
     $this->addElement('CheckBox', 'sellerAccount', array('label' => 'I want to sell music, too.', 'description' => 'Check this box if you want to sell music on BitNotion.  You will still be able to purchase music using this account.'));
     $this->addElement('Captcha', 'captcha', array('label' => 'Are you human?', 'descripton' => 'Type the letters shown, and prove you\'re smarter than the average robot.', 'captcha' => array('captcha' => 'ReCaptcha', 'privkey' => $config->recaptcha->privateKey, 'pubkey' => $config->recaptcha->publicKey)));
     $this->addElement('SubmitButton', 'submit', array('ignore' => true, 'label' => 'Create My Account'));
 }