Example #1
0
 /**
  *
  * @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');
 }
Example #2
0
 public function __construct($spec, $options = null)
 {
     parent::__construct($spec, $options);
     $_printer = new ZendT_Printer();
     $printers = $_printer->getPrintersByFilial();
     $this->setServerPrinters($printers);
 }
Example #3
0
 public function setRequired($value = true)
 {
     if ($value == true) {
         $this->addClass('plUploadValidator');
     }
     return parent::setRequired($value);
 }
Example #4
0
 public function __construct($spec, $options = null)
 {
     $this->class = "dateNL";
     parent::__construct($spec, $options);
     $decoratorDefault = new ZendT_Form_Decorator_Default();
     $this->addDecorator($decoratorDefault);
 }
Example #5
0
 public function __construct($spec, $options = null)
 {
     parent::__construct($spec, $options);
     $this->setColHeaders(true);
     $this->setRowHeaders(true);
     $this->setContextMenu(true);
     $this->setManualColumnResize(true);
 }
Example #6
0
 public function __construct($spec, $options = null)
 {
     parent::__construct($spec, $options);
     $decoratorSubmitAjax = new ZendT_Form_Decorator_SubmitAjax();
     $this->addDecorator($decoratorSubmitAjax);
 }
Example #7
0
 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();
 }
Example #8
0
 public function __construct($spec, $options = null)
 {
     parent::__construct($spec, $options);
     $decorators = array(new ZendT_Form_Decorator_Hidden());
     $this->setDecorators($decorators);
 }
Example #9
0
 /**
  * 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);
 }
Example #10
0
 /**
  *
  * @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);
 }
Example #11
0
 /**
  * 
  * @param Zend_View_Interface $view
  * @return string
  */
 public function render(Zend_View_Interface $view = null)
 {
     $this->setJQueryParams($this->jQueryParams());
     return parent::render($view);
 }
Example #12
0
 /**
  * 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;
 }
Example #13
0
 public function __construct($spec, $options = null)
 {
     parent::__construct($spec, $options);
     $this->addStyle('width', '100px');
 }