public function render(Zend_View_Interface $view = null) { $o = array('dataType' => 'json', 'url' => '/z/fu'); $o = array_merge($o, $this->getAttribs()); $s = new Zend_Session_Namespace(); $js = '$.include(["/zkernel/ctl/blueimp/js/vendor/jquery.ui.widget.js", "/zkernel/ctl/blueimp/js/jquery.iframe-transport.js", "/zkernel/ctl/blueimp/js/jquery.fileupload.js"], function() { $("#' . $this->getName() . '").fileupload(' . Zend_Json::encode($o, false, array('enableJsonExprFinder' => true)) . '); });'; if (!isset($this->url)) { $this->url = str_ireplace(PUBLIC_PATH, '', $this->destination); } $this->required = $this->isRequired(); $s->form[$this->getName()] = array('folder' => $this->destination, 'value' => $this->getValue(), 'validators' => $this->getValidators()); $this->getView()->inlineScript('script', $js); return parent::render($view); }
public function render(Zend_View_Interface $view = null) { $o = array('buttonText' => 'Browse...', 'fileObjName' => $this->getName(), 'postData' => array('folder' => '/' . $this->destination, 'old' => $this->getAttrib('multi') ? 'multi' : $this->getValue(), 'sid' => session_id())); $o = array_merge($o, $this->getAttribs()); if ($this->getAttrib('multi')) { $o['multi'] = 1; } $s = new Zend_Session_Namespace(); $js = '$.include("/zkernel/ctl/uploadify3/uploadify.css|link"); $.include(["/zkernel/js/swfobject.js", "/zkernel/ctl/uploadify3/jquery.uploadify.js", "/zkernel/ctl/uploadify3/zuploadify.js"], function() { $("input[type=file][name=' . $this->getName() . ']").zuploadify(' . Zend_Json::encode($o) . '); });'; if (!isset($this->url)) { $this->url = str_ireplace(PUBLIC_PATH, '', $this->destination); } $this->required = $this->isRequired(); $s->form[$this->getName()] = array('folder' => $this->destination, 'value' => $this->getValue(), 'validators' => $this->getValidators()); $this->getView()->inlineScript('script', $js); return parent::render($view); }
public function render(Zend_View_Interface $view = null) { $o = array('buttonText' => 'Browse...', 'fileDataName' => $this->getName(), 'folder' => '/' . $this->destination, 'scriptData' => array('length' => $this->getAttrib('length') ? $this->getAttrib('length') : 20, 'old' => $this->getAttrib('multi') ? 'multi' : $this->getValue(), 'sid' => session_id())); $o = array_merge($o, $this->getAttribs()); if ($this->getAttrib('multi')) { $o['multi'] = 1; } $crop = $this->getAttrib('jcrop'); $s = new Zend_Session_Namespace(); $js = '$.include("/zkernel/ctl/uploadify/uploadify.css|link"); ' . ($crop ? '$.include("/zkernel/ctl/jcrop/css/jquery.jcrop.css|link");' : '') . ' $.include(["/zkernel/js/swfobject.js", "/zkernel/ctl/uploadify/jquery.uploadify.js", "/zkernel/ctl/uploadify/zuploadify.js"' . ($crop ? ', "/zkernel/ctl/jcrop/js/jquery.jcrop.js"' : '') . '], function() { zuf.init(' . Zend_Json::encode($o, false, array('enableJsonExprFinder' => true)) . '); });'; if (!isset($this->url)) { $this->url = str_ireplace(PUBLIC_PATH, '', $this->destination); } $this->required = $this->isRequired(); $s->form[$this->getName()] = array('folder' => $this->destination, 'value' => $this->getValue(), 'validators' => $this->getValidators()); $this->getView()->inlineScript('script', $js); return parent::render($view); }
protected function _buildCropDataElement() { $element = new Zend_Form_Element_Hidden(array('name' => $this->_attribs['name'] . 'CropData', 'decorators' => array('ViewHelper'))); return $element->render(); }