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); }
public function Field($properties = array()) { $output = parent::Field($properties); Requirements::javascript('ModifiedUploadField/javascript/ModifiedUploadField_downloadtemplate.js'); Requirements::javascript('ModifiedUploadField/javascript/ModifiedUploadField.js'); return $output; }
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; }
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); }
/** * @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; }
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; }
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; }
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; }
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; }
/** * 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; }
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; }
/** * Adds a JS requirement and returns the field markup. * * @param array $properties key value pairs of template variables * * @return string * * @author Sebastian Diel <*****@*****.**> * @since 26.03.2013 */ public function Field($properties = array()) { Requirements::javascript('silvercart/admin/javascript/SilvercartFileUploadField.js'); return parent::Field($properties); }
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; }
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; }
/** * 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); }