/** * * @param type $spec * @param type $options */ public function __construct($spec, $options = null) { parent::__construct($spec, $options); $this->setAttrib('urlDownload', ZendT_Url::getBaseUrl() . '/file/download'); $this->setAttrib('urlUpload', ZendT_Url::getBaseUrl() . '/file'); $this->setAttrib('urlDelete', ZendT_Url::getBaseUrl() . '/file/delete'); }
public function __construct($spec, $options = null) { parent::__construct($spec, $options); $_printer = new ZendT_Printer(); $printers = $_printer->getPrintersByFilial(); $this->setServerPrinters($printers); }
public function setRequired($value = true) { if ($value == true) { $this->addClass('plUploadValidator'); } return parent::setRequired($value); }
public function __construct($spec, $options = null) { $this->class = "dateNL"; parent::__construct($spec, $options); $decoratorDefault = new ZendT_Form_Decorator_Default(); $this->addDecorator($decoratorDefault); }
public function __construct($spec, $options = null) { parent::__construct($spec, $options); $this->setColHeaders(true); $this->setRowHeaders(true); $this->setContextMenu(true); $this->setManualColumnResize(true); }
public function __construct($spec, $options = null) { parent::__construct($spec, $options); $decoratorSubmitAjax = new ZendT_Form_Decorator_SubmitAjax(); $this->addDecorator($decoratorSubmitAjax); }
public function render() { $params = array(); $params['paramDate'] = $this->getAttrib('propDate')->getAttrib('jQueryParams'); $params['paramTime'] = $this->getAttrib('propTime')->getAttrib('jQueryParams'); $this->setJQueryParams($params); return parent::render(); }
public function __construct($spec, $options = null) { parent::__construct($spec, $options); $decorators = array(new ZendT_Form_Decorator_Hidden()); $this->setDecorators($decorators); }
/** * Is the value provided valid? * * Autoregisters InArray validator if necessary. * * @param string $value * @param mixed $context * @return bool */ public function isValid($value, $context = null) { if ($this->registerInArrayValidator()) { if (!$this->getValidator('InArray')) { $multiOptions = $this->getMultiOptions(); $options = array(); foreach ($multiOptions as $opt_value => $opt_label) { // optgroup instead of option label if (is_array($opt_label)) { $options = array_merge($options, array_keys($opt_label)); } else { $options[] = $opt_value; } } $this->addValidator('InArray', true, array($options)); } } return parent::isValid($value, $context); }
/** * * @param Zend_View_Interface $view * @return type */ public function render(Zend_View_Interface $view = null) { $element = new ZendT_Form_Element('clear_both'); $element->setDecorators(array(new ZendT_Form_Decorator_ClearBoth())); $this->addElement($element); if ($this->_enablejQueryValidate) { $onLoad = $this->getView()->placeholder('onLoad')->getValue(); $onLoad['jQueryFormValidate'] = "jQuery('#" . $this->getId() . "').validate({ignore:[]});"; $this->getView()->placeholder('onLoad')->set($onLoad); } if (count($this->_url) > 1) { $this->getView()->headScript()->appendFile(ZendT_Url::getBaseDiretoryPublic() . '/scripts/jquery/widget/TForm.js?' . $data); $baseUrl = ZendT_Url::getBaseUrl(); $url = array(); foreach ($this->_url as $key => $value) { $url['url'][$key] = $baseUrl . $value; } $jsonParam = ZendT_JS_Json::encode($url); $onLoad = $this->getView()->placeholder('onLoad')->getValue(); $onLoad['jQueryForm'] = "jQuery('#" . $this->getId() . "').TForm(" . $jsonParam . ");"; $this->getView()->placeholder('onLoad')->set($onLoad); } if ($this->_enableFocusFirstElement) { $onLoad = $this->getView()->placeholder('onLoad')->getValue(); $onLoad['jQueryFormFocus'] = "focusFirstElement('#" . $this->getId() . " input, #" . $this->getId() . " textare, #" . $this->getId() . " select');"; $this->getView()->placeholder('onLoad')->set($onLoad); } $enableTinyMCE = false; $elements = $this->getElements(); $tinyMCE = ''; foreach ($elements as $element) { if ($element instanceof ZendT_Form_Element_Textarea) { if ($element->isEditorHtml()) { $tinyMCE .= "tinyMCE.get('" . $element->getId() . "').save();"; $enableTinyMCE = true; } } } if ($enableTinyMCE) { $onLoad = $this->getView()->placeholder('onLoad')->getValue(); $onLoad['tinyMCE'] = "jQuery('#" . $this->getId() . "').submit(function(){" . $tinyMCE . "});"; $this->getView()->placeholder('onLoad')->set($onLoad); } return parent::render($view); }
/** * * @param Zend_View_Interface $view * @return string */ public function render(Zend_View_Interface $view = null) { $this->setJQueryParams($this->jQueryParams()); return parent::render($view); }
/** * Configura o Label do Botão * * @param string $label * @return \ZendT_Form_Element_Button */ public function setLabel($label) { parent::setLabel($label); $this->setAttrib('caption', $label); return $this; }
public function __construct($spec, $options = null) { parent::__construct($spec, $options); $this->addStyle('width', '100px'); }