예제 #1
0
 /**
  * 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();
 }
예제 #2
0
 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;
 }
예제 #3
0
 function attach()
 {
     $field = new FileUploadField();
     return JsonDataEncoder::encode(array('id' => $field->ajaxUpload(true)));
 }
예제 #4
0
 /**
  * Force the object to accept only images.
  *
  * @return UploadifyField
  */
 public function FieldHolder()
 {
     $this->imagesOnly();
     return parent::FieldHolder();
 }