当前位置: 首页>>代码示例>>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;未经允许,请勿转载。