當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UploadField::__construct方法代碼示例

本文整理匯總了PHP中UploadField::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP UploadField::__construct方法的具體用法?PHP UploadField::__construct怎麽用?PHP UploadField::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UploadField的用法示例。


在下文中一共展示了UploadField::__construct方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 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);
 }
開發者ID:helpfulrobot,項目名稱:xmarkclx-silverstripe-extended-sortable-gallery-field,代碼行數:7,代碼來源:SortableGalleryField.php

示例2: __construct

 /**
  * @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);
 }
開發者ID:helpfulrobot,項目名稱:mademedia-silverstripe-cloudinary,代碼行數:13,代碼來源:CloudinaryUploadField.php

示例3: __construct

 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');
 }
開發者ID:nathancox,項目名稱:silverstripe-modifieduploadfield,代碼行數:8,代碼來源:ModifiedUploadField.php

示例4: __construct

 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;
 }
開發者ID:jura-php,項目名稱:jura,代碼行數:10,代碼來源:ImageUploadField.php

示例5: __construct

 /**
  * 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'));
 }
開發者ID:firebrandhq,項目名稱:s3fileupload,代碼行數:17,代碼來源:S3FileUploadField.php

示例6: __construct

 /**
  * 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);
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-ecommerce,代碼行數:20,代碼來源:Product_ProductImageUploadField.php

示例7: __construct

 /**
  * 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
 }
開發者ID:micschk,項目名稱:silverstripe-chunkeduploadfield,代碼行數:21,代碼來源:ChunkedUploadField.php

示例8: __construct

 /**
  * 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();
 }
開發者ID:zarocknz,項目名稱:silverstripe-geodata-uploadfield,代碼行數:22,代碼來源:GeodataUploadField.php

示例9: __construct

 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
 }
開發者ID:spekulatius,項目名稱:silverstripe-bootstrap_extra_fields,代碼行數:14,代碼來源:BootstrapUploadField.php

示例10: __construct

 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);
         }
     }
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-selectupload,代碼行數:16,代碼來源:SelectUploadField.php

示例11: __construct

 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);
 }
開發者ID:nyeholt,項目名稱:silverstripe-dms,代碼行數:6,代碼來源:DMSUploadField.php

示例12: __construct

 public function __construct($gridfield, $parent, $folderName = null)
 {
     $this->gridfield = $gridfield;
     parent::__construct($parent, $folderName);
 }
開發者ID:pschiffe,項目名稱:GridFieldBulkEditingTools,代碼行數:5,代碼來源:BulkUploadField.php

示例13: __construct

 public function __construct($name, $title = null, \SS_List $items = null)
 {
     parent::__construct($name, $title, $items);
 }
開發者ID:helpfulrobot,項目名稱:lekoala-silverstripe-form-extras,代碼行數:4,代碼來源:BaseUploadField.php

示例14: __construct

 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);
 }
開發者ID:helpfulrobot,項目名稱:nathancox-silverstripe-sortableuploadfield,代碼行數:6,代碼來源:SortableUploadField.php


注:本文中的UploadField::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。