doc->setHeader(''); return parent::_doNew(); } protected function _redirect() { $this->redirect($this->url() . Qs_SiteMap::findFirst('(id=150)', 'fullAlias')); } protected function _bindFormFields(Qs_Form $form) { $form->addElement('text', 'name', array('label' => 'Your Name', 'required' => true)); $form->name->removeDecorator('Label'); $form->addElement('emailOrPhone', 'emailOrPhone', array('label' => 'Email or Phone Number', 'required' => true)); $form->emailOrPhone->removeDecorator('Label'); $form->addElement('text', 'zip', array('label' => 'You Zip Code', 'required' => true)); $form->zip->removeDecorator('Label'); $form->addElement('textarea', 'comments', array('label' => 'Comments', 'required' => true, 'rows' => 10)); $form->comments->removeDecorator('Label'); $form->prependId(); return $this; } protected function _bindFormButtons(Qs_Form $form) { $form->addElement('submit', 'btnSubmit', array( 'label' => 'Sign up now', 'attribs' => array('class' => 'btn'), 'decorators' => array('ViewHelper') ) ); $decorators = array('FormElements'); $decorators[] = array('decorator' => 'HtmlTag', 'options' => array('tag' => 'div')); $decorators[] = 'Fieldset'; $decorators[] = 'DtDdWrapper'; $form->addDisplayGroup(array('btnSubmit'), 'submitGroup', array('decorators' => $decorators)); return $this; } protected function _getMailData(array $data) { $mailData = array( 'name' => htmlspecialchars($data['name']), 'emailOrPhone' => htmlspecialchars($data['emailOrPhone']), 'zip' => htmlspecialchars($data['zip']), 'comments' => nl2br(htmlspecialchars($data['comments'])), 'link' => BASE_URL . '/' . Qs_SiteMap::findFirst(null, array('type' => 'Form_MapSignup_Admin'), null, 'fullAlias') . '?action=view&id=' . $data['id'], ); return $mailData; } public function getSideBlockItem() { $item = array(); $action = Qs_SiteMap::find(null, array('type' => 'Form_MapSignup_'), null, 'url'); $form = $this->_getNewForm(); $form->initRender(); $form->setAction($action); $item['form'] = $form; $item['tpl'] = $this->getTemplate('side-form.tpl'); return $item; } protected function _getNewForm() { $this->doc->addScript('js/defaultHint.js', array(), 'defaultHint'); $params = array( 'elements' => array( array('selector' => '#form_mapsignup-form-name', 'hint' => 'Your Name'), array('selector' => '#form_mapsignup-form-emailOrPhone', 'hint' => 'Your Email or Phone #'), array('selector' => '#form_mapsignup-form-zip', 'hint' => 'Your Zip Code'), array('selector' => '#form_mapsignup-form-comments', 'hint' => 'Comments') ) ); $this->doc->addInitFunction ('$().defaultHint', array($params)); return parent::_getNewForm(); } }