/** * Overload some settings to make sure the right script is used. * * @return UploadifyField */ public function FieldHolder() { if (!$this->getSetting('s3script')) { $this->setVar('script', urlencode(Director::baseURL() . Director::makeRelative($this->Link('uploads3')))); } else { $this->setVar('script', $this->getSetting('s3script')); } if (!$this->Backend()) { $this->template = "UploadifyField"; } return parent::FieldHolder(); }
function getAttachments($config = false) { if (!$config) { $config = $this->field->getConfiguration(); } $field = new FileUploadField(array('id' => 'attach', 'name' => 'attach:' . $this->field->get('id'), 'configuration' => $config)); $field->setForm($this->field->getForm()); return $field; }
function attach() { $field = new FileUploadField(); return JsonDataEncoder::encode(array('id' => $field->ajaxUpload(true))); }
/** * Force the object to accept only images. * * @return UploadifyField */ public function FieldHolder() { $this->imagesOnly(); return parent::FieldHolder(); }