本文整理汇总了PHP中UploadField::Field方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadField::Field方法的具体用法?PHP UploadField::Field怎么用?PHP UploadField::Field使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadField
的用法示例。
在下文中一共展示了UploadField::Field方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Field
public function Field($properties = array())
{
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
Requirements::javascript(SORTABLEFILE_DIR . '/javascript/SortableUploadField.js');
Requirements::css(SORTABLEFILE_DIR . '/css/SortableUploadField.css');
return parent::Field($properties);
}
示例2: Field
public function Field($properties = array())
{
$output = parent::Field($properties);
Requirements::javascript('ModifiedUploadField/javascript/ModifiedUploadField_downloadtemplate.js');
Requirements::javascript('ModifiedUploadField/javascript/ModifiedUploadField.js');
return $output;
}
示例3: Field
public function Field($properties = array())
{
$items = $this->getItems();
$unprocessed = false;
$messages = array();
// check that all the items have been uploaded
foreach ($items as $vFile) {
if ($vFile->ProcessStatus != VuforiaImage::COMPLETE_STATUS) {
// do a status check
$update = $this->vuforiaAPIService->checkImageStatus($vFile);
if ($update->ProcessStatus == VuforiaImage::PROCESS_STATUS) {
$unprocessed = true;
}
if ($update->ProcessStatus == VuforiaImage::ERROR_STATUS) {
$messages[] = $update->Messages;
}
}
}
//
// if (count($messages)) {
// $field .= '<div class="vuforia-messages" style="padding: 3px; color: #f33">' . implode('<br/>', $messages) . '</div>';
// }
//
$field = parent::Field($properties);
return $field;
}
示例4: Field
public function Field($properties = array())
{
//Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
Requirements::javascript(SORTABLEGALLERY_DIR . '/javascript/SortableGalleryField.js');
Requirements::customScript("window.imageClassName = '{$this->imageClassName}'; window.parentClassName='{$this->pageClassName}'; window.relationName='{$this->relationName}'");
Requirements::css(SORTABLEGALLERY_DIR . '/css/SortableUploadField.css');
return parent::Field($properties);
}
开发者ID:helpfulrobot,项目名称:xmarkclx-silverstripe-extended-sortable-gallery-field,代码行数:8,代码来源:SortableGalleryField.php
示例5: Field
/**
* @param array $properties
* @return HTMLText
*/
public function Field($properties = array())
{
$field = parent::Field($properties);
Requirements::css('cloudinary/css/CloudinaryUploadField.css');
Requirements::javascript('cloudinary/javascript/CloudinaryUploadField.js');
$this->extend('updateFieldJs');
return $field;
}
示例6: Field
public function Field($properties = array())
{
$field = parent::Field($properties);
// Extra requirements
$base = basename(dirname(__DIR__));
Requirements::javascript("{$base}/javascript/SelectUploadField.js");
Requirements::css("{$base}/css/SelectUploadField.css");
return $field;
}
示例7: Field
public function Field($properties = array())
{
// add the javascript
$this->setConfig('sorturl', $this->Link('savesort'));
$output = parent::Field($properties);
Requirements::javascript(SORTABLEUPLOADFIELD_DIR . '/javascript/SortableUploadField.js');
Requirements::css(SORTABLEUPLOADFIELD_DIR . '/css/SortableUploadField.css');
return $output;
}
示例8: Field
public function Field($properties = array())
{
// add the javascript
$this->setConfig('sorturl', $this->Link('savesort'));
$output = parent::Field($properties);
Requirements::javascript('sortableuploadfield/javascript/SortableUploadField.js');
Requirements::css('sortableuploadfield/css/SortableUploadField.css');
// $this->test();
return $output;
}
开发者ID:helpfulrobot,项目名称:nathancox-silverstripe-sortableuploadfield,代码行数:10,代码来源:SortableUploadField.php
示例9: Field
public function Field($properties = array())
{
/** @var HTMLText $htmlText */
$htmlText = parent::Field($properties);
Requirements::javascript(SORTABLEFILE_DIR . '/javascript/SortableUploadField.js');
Requirements::css(SORTABLEFILE_DIR . '/css/SortableUploadField.css');
// check if the record (to write into) exists. If not, there's no sort action to be used in the frontend
if ($this->getRecord() && $this->getRecord()->exists()) {
$html = $htmlText->getValue();
$token = $this->getForm()->getSecurityToken();
$action = Convert::raw2att($token->addToUrl($this->getItemHandler("{id}")->Link("sort")));
// add the sort action to the field, use {id} as a substitute for the ID
$html .= "<input type=\"hidden\" id=\"{$this->ID()}_FileSortAction\" class=\"sortableupload-sortaction\" data-action=\"{$action}\">";
$htmlText->setValue($html);
}
return $htmlText;
}
示例10: Field
/**
* Return our field for display in SS template
* @param array $properties
* @return SS_viewable
*/
public function Field($properties = array())
{
// Highjack some values in the UploadField config
$this->ufConfig['url'] = self::getBucketUrl();
$this->ufConfig['canAttachExisting'] = false;
$this->ufConfig['urlFileExists'] = '';
$this->ufConfig['overwriteWarning'] = false;
$this->ufConfig['overwriteWarning'] = false;
$this->ufConfig['downloadTemplateName'] = 'ss-s3uploadfield-downloadtemplate';
// Attach a signed S3 Fileupload request
$this->ufConfig['FormData'] = self::getFormData();
$this->ufConfig['uploadCallbackUrl'] = $this->Link('upload');
// Call the parent function but don't return it right away
$return = parent::Field($properties);
// Require some custom JS
Requirements::javascript(S3_FILE_UPLOAD_DIR . '/js/S3UploadField_downloadtemplate.js');
Requirements::javascript(S3_FILE_UPLOAD_DIR . '/js/S3UploadField.js');
// We want this loaded after the default CSS rules to make sure it
// overrides the parents
Requirements::css(S3_FILE_UPLOAD_DIR . '/css/S3UploadField.css');
return $return;
}
示例11: Field
public function Field($properties = array())
{
$fields = parent::Field($properties);
//replace the download template with a new one only when access the upload field through a GridField
$useCustomTemplate = $this->getConfig('useDMSReplaceTemplate');
if (!empty($useCustomTemplate)) {
Requirements::block(FRAMEWORK_DIR . '/javascript/UploadField_downloadtemplate.js');
Requirements::javascript(DMS_DIR . '/javascript/DMSUploadField_downloadtemplate.js');
} else {
//in the add dialog, add the addtemplate into the set of file that load
Requirements::javascript(DMS_DIR . '/javascript/DMSUploadField_addtemplate.js');
}
return $fields;
}
示例12: Field
/**
* Adds a JS requirement and returns the field markup.
*
* @param array $properties key value pairs of template variables
*
* @return string
*
* @author Sebastian Diel <sdiel@pixeltricks.de>
* @since 26.03.2013
*/
public function Field($properties = array())
{
Requirements::javascript('silvercart/admin/javascript/SilvercartFileUploadField.js');
return parent::Field($properties);
}
示例13: Field
public function Field($properties = array())
{
$res = parent::Field($properties);
Requirements::css('themes/openstack/css/custom.uploadfield.css');
Requirements::javascript('themes/openstack/javascript/custom.uploadfield.js');
return $res;
}
示例14: Field
public function Field($properties = array())
{
$fields = parent::Field($properties);
// Replace the download template with a new one only when access the upload field through a GridField.
// Needs to be enabled through setConfig('downloadTemplateName', 'ss-dmsuploadfield-downloadtemplate');
Requirements::javascript('dms/javascript/DMSUploadField_downloadtemplate.js');
// In the add dialog, add the addtemplate into the set of file that load.
Requirements::javascript('dms/javascript/DMSUploadField_addtemplate.js');
return $fields;
}
示例15: Field
/**
* Called by SS to output the field.
* @param array $properties [description]
*/
public function Field($properties = array())
{
// Set up the JS options, placing the map pin in the default location and with the default zoom level.
$jsOptions = array('coords' => array($this->getDefaultValue('Latitude'), $this->getDefaultValue('Longitude')), 'map' => array('zoom' => $this->getDefaultValue('Zoom') ?: $this->getOption('map.zoom'), 'mapTypeId' => 'ROADMAP'));
$jsOptions = array_replace_recursive($this->options, $jsOptions);
$this->setAttribute('data-settings', Convert::array2json($jsOptions));
$this->requireDependencies();
return parent::Field($properties);
}