public function __construct($name, $pageClassName, $className, $title = null, SS_List $items = null)
 {
     $this->imageClassName = $className;
     $this->pageClassName = $pageClassName;
     $this->relationName = $name;
     parent::__construct($name, $title, $items);
 }
 /**
  * @param string $name
  * @param null $title
  * @param SS_List $items
  * @param null $sortColumn
  */
 public function __construct($name, $title = null, SS_List $items = null, $sortColumn = null)
 {
     parent::__construct($name, $title, $items);
     $this->setSortColumn($sortColumn);
     $arrExtensions = array_merge(array_filter($this->getExtensionsAllowed()), array('svg'));
     $this->getValidator()->setAllowedExtensions($arrExtensions);
 }
 public function __construct($name, $title = null, SS_List $items = null)
 {
     $this->addExtraClass('upload');
     $this->addExtraClass('ss-modifieduploadfield');
     //	print_r($items);
     parent::__construct($name, $title, $items);
     $this->setConfig('downloadTemplateName', 'ss-modifieduploadfield-downloadtemplate');
 }
Exemple #4
0
 public function __construct($name, $label, $path)
 {
     parent::__construct($name, $label, $path);
     $this->type = "imageupload";
     $this->acceptsMask = array("image/jpg", "image/jpeg", "image/png", "image/gif", "image/bmp");
     $this->accepts("image/jpg,image/jpeg,image/png,image/gif,image/bmp");
     $this->showFilename = false;
     $this->samples = array(array("resizeMethod" => Image::RESIZE_METHOD_NONE, "original" => true, "key" => "original"));
     $this->customFilters = null;
 }
 /**
  * Override the standard UploadField constructor so we can set a few things.
  * @param string $name
  * @param string $title
  * @param SS_List $items
  */
 public function __construct($name, $title = null, SS_List $items = null)
 {
     parent::__construct($name, $title, $items);
     // Remove the parent's JS hook.
     $this->removeExtraClass('ss-upload');
     // Add our own JS hook.
     $this->addExtraClass('s3-upload');
     // Set a bigger initial limit for our uploads. Otherwise this will
     // default to what's the Max File Size limit in our php.ini
     $this->getValidator()->setAllowedMaxFileSize(File::ini2bytes('2G'));
 }
 /**
  * Construct a new UploadField instance
  *
  * @param string $name The internal field name, passed to forms.
  * @param string $title The field label.
  * @param SS_List $items If no items are defined, the field will try to auto-detect an existing relation on
  *                       @link $record}, with the same name as the field name.
  * @param Form $form Reference to the container form
  */
 public function __construct($name, $title = null, SS_List $items = null)
 {
     parent::__construct($name, $title, $items);
     $this->getValidator()->setAllowedExtensions(array("gif", "jpg", "jpeg", "png"));
     $callingClass = $this->getCallingClass();
     $folderName = Config::inst()->get($callingClass, "folder_name_for_images");
     if (!$folderName) {
         $folderName = $callingClass . "_" . $name;
     }
     $this->setFolderName($folderName);
 }
 /**
  * Construct a new ChunkedUploadField instance
  * 
  * @param string $name The internal field name, passed to forms.
  * @param string $title The field label.
  * @param SS_List $items If no items are defined, the field will try to auto-detect an existing relation on
  *                       @link $record}, with the same name as the field name.
  * @param Form $form Reference to the container form
  */
 public function __construct($name, $title = null, SS_List $items = null)
 {
     parent::__construct($name, $title);
     if ($items) {
         $this->setItems($items);
     }
     // set max chunk size
     $maxUpload = File::ini2bytes(ini_get('upload_max_filesize'));
     $maxPost = File::ini2bytes(ini_get('post_max_size'));
     $this->setConfig('maxChunkSize', round(min($maxUpload, $maxPost) * 0.9));
     // ~90%, allow some overhead
 }
 /**
  * Constructor
  * @param string $name    The name of the upload field.
  * @param string $title   Title of the field on the form.
  * @param array  $options User defined options for the google map.
  * @param string $latFieldName Name of the Latitude property in the dataobject to save the lat value in.
  * @param string $lngFieldName Name of the Longitude property in the dataobject to save the lng value in.
  * @param string $zoomFieldName Name of the Zoom property in the dataobject to save the zoom value in.
  */
 public function __construct($name, $title = null, $options = array(), $latFieldName = 'Latitude', $lngFieldName = 'Longitude', $zoomFieldName = 'Zoom')
 {
     // Call parent constructor to do normal upload field things.
     parent::__construct($name, $title);
     // Save the lat and long field names for later use.
     $this->latFieldName = $latFieldName;
     $this->lngFieldName = $lngFieldName;
     $this->zoomFieldName = $zoomFieldName;
     // Set up the google map options passing in user supplied options.
     $this->setupOptions($options);
     // Call function to create hidden long, lat, zoom level fields on the form.
     $this->setupChildren();
 }
 public function __construct($name, $title = null, SS_List $items = null)
 {
     parent::__construct($name, $title, $items);
     $this->setCanAttachExisting(false);
     // only upload from Computer
     $this->setCanPreviewFolder(false);
     // keeps filesystem structure hidden
     $this->setAllowedMaxFileNumber(1);
     // only one file
     $this->upload->setReplaceFile(false);
     // do not replace file, instead create new file with altered name
     $this->setOverwriteWarning(false);
     // do not warn
 }
 public function __construct($name, $title = null, \SS_List $items = null)
 {
     parent::__construct($name, $title, $items);
     $this->addExtraClass('ss-selectupload');
     // class, used by js
     $this->addExtraClass('ss-selectuploadfield');
     // class, used by css for selectuploadfield onl
     $this->selectField = FolderDropdownField::create("{$name}/folder")->addExtraClass('FolderSelector')->setTitle('Select a folder to upload into');
     // If we haven't uploaded to a folder yet, set to the default foldername
     if (!$this->selectField->Value()) {
         $folderID = $this->folderIDFromPath($this->getDefaultFolderName());
         if ($folderID) {
             $this->selectField->setValue($folderID);
         }
     }
 }
 public function __construct($name, $title = null, SS_List $items = null)
 {
     parent::__construct($name, $title, $items);
     //set default DMS replace template to false
     $this->setConfig('useDMSReplaceTemplate', 0);
 }
 public function __construct($gridfield, $parent, $folderName = null)
 {
     $this->gridfield = $gridfield;
     parent::__construct($parent, $folderName);
 }
 public function __construct($name, $title = null, \SS_List $items = null)
 {
     parent::__construct($name, $title, $items);
 }
 public function __construct($name, $title = null, SS_List $items = null)
 {
     // add a class for the javascript
     $this->addExtraClass('ss-sortableuploadfield');
     parent::__construct($name, $title, $items);
 }