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