本文整理汇总了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);
}
示例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');
}
示例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;
}
示例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'));
}
示例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);
}
示例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
}
示例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();
}
示例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
}
示例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);
}
}
}
示例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);
}
示例12: __construct
public function __construct($gridfield, $parent, $folderName = null)
{
$this->gridfield = $gridfield;
parent::__construct($parent, $folderName);
}
示例13: __construct
public function __construct($name, $title = null, \SS_List $items = null)
{
parent::__construct($name, $title, $items);
}
示例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