本文整理汇总了PHP中UploadField::setFolderName方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadField::setFolderName方法的具体用法?PHP UploadField::setFolderName怎么用?PHP UploadField::setFolderName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadField
的用法示例。
在下文中一共展示了UploadField::setFolderName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$type = new DropdownField('EventType', _t('ScoutDistrict.Events.TYPE', 'Type'), array('section-meeting' => _t('ScoutDistrict.Enum.SECTIONMEETING', 'Section Meeting'), 'leaders-meeting' => _t('ScoutDistrict.Enum.LEADERSMEETING', 'Leaders Meeting'), 'activity' => _t('ScoutDistrict.Enum.ACTIVITY', 'Activity'), 'fundraising' => _t('ScoutDistrict.Enum.FUNDRAISING', 'Fundraising'), 'committee' => _t('ScoutDistrict.Enum.COMMITTEE', 'Committee'), 'camp' => _t('ScoutDistrict.Enum.CAMP', 'Camp'), 'group' => _t('ScoutDistrict.Enum.GROUP', 'Group'), 'district' => _t('ScoutDistrict.Enum.DISTRICT', 'District'), 'training' => _t('ScoutDistrict.Enum.TRAINING', 'Training'), 'other' => _t('ScoutDistrict.Enum.OTHER', 'Other')));
$type->setRightTitle(_t('ScoutDistrict.Events.TYPE_HELP', 'What Type of event is this'))->addExtraClass('help');
$location = new TextField('EventLocation', _t('ScoutDistrict.Events.LOCATION', 'Location'));
$location->setRightTitle(_t('ScoutDistrict.Events.LOCATION_HELP', 'Where is the event being held'))->addExtraClass('help');
$latitude = new TextField('EventLatitude', _t('ScoutDistrict.Events.LATITUDE', 'Latitude'));
$latitude->setRightTitle(_t('ScoutDistrict.Events.LATITUDE_HELP', 'Latitude of event Location'))->addExtraClass('help');
$longitude = new TextField('EventLongitude', _t('ScoutDistrict.Events.LONGITUDE', 'Longitude'));
$longitude->setRightTitle(_t('ScoutDistrict.Events.LONGITUDE_HELP', 'Longitude of event Location'))->addExtraClass('help');
$bookingDetails = new TextareaField('EventBookingDetails', _t('ScoutDistrict.Events.BOOKINGDETAILS', 'Booking Details'));
$bookingDetails->setRightTitle(_t('ScoutDistrict.Events.BOOKINGDETAILS_HELP', 'Details of how to book a place for the Event'))->addExtraClass('help');
$bookingURL = new TextField('EventBookingURL', _t('ScoutDistrict.Events.BOOKINGURL', 'Booking URL'));
$bookingURL->setRightTitle(_t('ScoutDistrict.Events.BOOKINGURL_HELP', 'The URL of an external site to book a place'))->addExtraClass('help');
$fields->addFieldsToTab('Root.Scouts', array($type, $location, $latitude, $longitude, $bookingDetails, $bookingURL));
$thumbnail = new UploadField('ThumbnailImage', _t('ScoutDistrict.Events.THUMBNAIL', 'Thumbnail Image'));
$thumbnail->setFolderName('event/thumbnail');
$thumbnail->setRightTitle(_t('ScoutDistrict.Events.THUMBNAIL_HELP', 'A small image for displaying in listing/aggregated content'))->addExtraClass('help');
$image = new UploadField('Image', _t('ScoutDistrict.Events.IMAGE', 'Image'));
$image->setFolderName('event/image');
$image->setRightTitle(_t('ScoutDistrict.Events.IMAGE_HELP', 'A Larger image for displaying in event header'))->addExtraClass('help');
$files = new UploadField('Files', _t('ScoutDistrict.Events.FILE', 'Files'));
$files->setFolderName('event/file');
$files->setRightTitle(_t('ScoutDistrict.Events.FILE_HELP', 'This can be a file containing information about the event or an application form, etc'))->addExtraClass('help');
$fields->addFieldsToTab('Root.Files', array($thumbnail, $image, $files));
return $fields;
}
开发者ID:helpfulrobot,项目名称:phpboyscout-silverstripe-scouts,代码行数:27,代码来源:ScoutCalenderEventExtension.php
示例2: getUploadField
/**
* Helper to create an upload field with the correct path, which ensures that the uploader puts files in the right place
*/
protected function getUploadField($field, $caption)
{
$field = new UploadField($field, $caption);
$path = $this->getFolderPath();
$field->setFolderName($path);
return $field;
}
示例3: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeByName("FlexSliderID");
// Main
$field_Picture = new UploadField('Picture', _t("FlexSlider.Picture"));
$field_Picture->setFolderName("FlexSlides");
$field_Picture->setConfig('allowedMaxFileNumber', 1);
$field_Position = new NumericField("Position", _t("FlexSlider.Position"));
$field_Position->RightTitle(_t("FlexSlider.PositionExplain"));
$field_SlideTitle = new TextField("SlideTitle", _t("FlexSlider.Title"));
$field_SlideDescription = new TextField("SlideDescription", _t("FlexSlider.Description"));
$field_HeadlineLinks = new HeaderField("HeadlineLinks", _t("FlexSlider.HeadlineLinks"));
$field_InternalLink = new TreeDropdownField("InternalLinkID", _t('FlexSlider.InternalLink'), 'SiteTree');
$field_removeInternalLink = new CheckboxField("doRemoveInternalLink", _t("FlexSlider.doRemoveInternalLink"));
$field_ExternalLink = new TextField("ExternalLink", _t("FlexSlider.or") . " " . _t("FlexSlider.ExternalLink"));
$field_HeadlineEnabled = new HeaderField("HeadlineEnabled", _t("FlexSlider.HeadlineEnabled"));
$field_isEnabled = new CheckboxField("isEnabled", _t("FlexSlider.isEnabled"));
$FieldsArray = array($field_Position, $field_Picture, $field_SlideTitle, $field_SlideDescription, $field_InternalLink, $field_removeInternalLink, $field_ExternalLink, $field_HeadlineEnabled, $field_isEnabled);
$fields->addFieldToTab('Root.Main', $field_Position);
$fields->addFieldToTab('Root.Main', $field_Picture);
$fields->addFieldToTab('Root.Main', $field_SlideTitle);
$fields->addFieldToTab('Root.Main', $field_SlideDescription);
$fields->addFieldToTab('Root.Main', $field_HeadlineLinks);
$fields->addFieldToTab('Root.Main', $field_InternalLink);
$fields->addFieldToTab('Root.Main', $field_removeInternalLink);
$fields->addFieldToTab('Root.Main', $field_ExternalLink);
$fields->addFieldToTab('Root.Main', $field_HeadlineEnabled);
$fields->addFieldToTab('Root.Main', $field_isEnabled);
return $fields;
}
示例4: getCMSFields
/**
* Returns a FieldSet with which to create the CMS editing form.
* You can use the extend() method of FieldSet to create customised forms for your other
* data objects.
*
* @param Controller
* @return FieldSet
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeFieldFromTab('Root.Main', 'Content');
$BackgroundImageField = new UploadField('BackgroundImage');
$BackgroundImageField->setFolderName('homepage');
$fields->addFieldToTab('Root.Header', $BackgroundImageField);
$ForegroundImageField = new UploadField('ForegroundImage');
$ForegroundImageField->setFolderName('homepage');
$fields->addFieldToTab('Root.Header', $ForegroundImageField);
$FocalImageLeftField = new UploadField('FocalImageLeft');
$FocalImageLeftField->setFolderName('homepage');
$fields->addFieldToTab('Root.Header', $FocalImageLeftField);
$FocalImageCentreField = new UploadField('FocalImageCentre');
$FocalImageCentreField->setFolderName('homepage');
$fields->addFieldToTab('Root.Header', $FocalImageCentreField);
$FocalImageRightField = new UploadField('FocalImageRight');
$FocalImageRightField->setFolderName('homepage');
$fields->addFieldToTab('Root.Header', $FocalImageRightField);
$fields->addFieldToTab('Root.Header', new TextField('FirstTagLine', _t('ScoutDistrict.Homepage.FirstTagLine', 'First Line of Header')));
$fields->addFieldToTab('Root.Header', new TextField('SecondTagLine', _t('ScoutDistrict.Homepage.SecondTagLine', 'Second Line of Header')));
$fields->addFieldToTab('Root.Header', new TextField('TagLinkText', _t('ScoutDistrict.Homepage.TagLinkText', 'Text to show on Header Button')));
$fields->addFieldToTab('Root.Header', new TreeDropdownField("TagLink", _t('ScoutDistrict.Homepage.TagLink', 'Where should Header Button link to'), "SiteTree"));
$blogDropdown = new TreeDropdownField("BlogHolder", "Which blog/news page should we use", "SiteTree");
$fields->addFieldToTab('Root.Main', $blogDropdown, 'Metadata');
$calDropdown = new TreeDropdownField("Calendar", "Which calendar page should we use", "SiteTree");
$fields->addFieldToTab('Root.Main', $calDropdown, 'Metadata');
$fields->addFieldToTab('Root.Main', new TreeDropdownField("InfoPanelPage", "Select the page to use in the Info panel", "SiteTree"), 'Metadata');
$infoImageField = new UploadField('InfoPanelImage');
$fields->addFieldToTab('Root.Main', $infoImageField, 'Metadata');
return $fields;
}
示例5: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
// mp4 upload
$MP4Field = new UploadField('MP4Video', 'MP4 Video');
$MP4Field->getValidator()->setAllowedExtensions(array('mp4', 'm4v'));
$MP4Field->setFolderName('Uploads/video');
$MP4Field->setConfig('allowedMaxFileNumber', 1);
// ogg upload
$OggField = new UploadField('OggVideo', 'Ogg Video');
$OggField->getValidator()->setAllowedExtensions(array('ogv', 'ogg'));
$OggField->setFolderName('Uploads/video');
$OggField->setConfig('allowedMaxFileNumber', 1);
// mp4 upload
$WebMField = new UploadField('WebMVideo', 'WebM Video');
$WebMField->getValidator()->setAllowedExtensions(array('webm'));
$WebMField->setFolderName('Uploads/video');
$WebMField->setConfig('allowedMaxFileNumber', 1);
// poster
$PosterField = new UploadField('Poster', 'Poster Image');
$PosterField->allowedExtensions = array('jpg', 'gif', 'png');
$PosterField->setFolderName('Uploads/videoposters');
$PosterField->setConfig('allowedMaxFileNumber', 1);
$fields->addFieldsToTab('Root.Video', array($MP4Field, $OggField, $WebMField, $PosterField));
return $fields;
}
示例6: updateCMSFields
/**
* @param FieldList $fields
*/
public function updateCMSFields(FieldList $fields)
{
$tabName = Config::inst()->get('Downloadable', 'tab_name');
$tabFields = array();
$upload = new UploadField('DownloadableFiles', '');
$upload->setFolderName(Config::inst()->get('Downloadable', 'source_folder'));
$tabFields[] = $upload;
// For certain types of products, it makes sense to include downloads
// from parent (ProductVariation) or child products (GroupedProduct)
// NOTE: there could be better ways to do this that don't involve checking
// for specific classes. The advantage here is that the fields show up
// even if the product has not yet been saved or doesn't yet have a
// parent or child products.
$p = $this->owner instanceof ProductVariation ? $this->owner->Product() : $this->owner->Parent();
if ($p && $p->exists() && $p->hasExtension('Downloadable')) {
$tabFields[] = new CheckboxField('IncludeParentDownloads', 'Include downloads from parent product in purchase');
} elseif (class_exists('GroupedProduct') && $this->owner instanceof GroupedProduct) {
$tabFields[] = new CheckboxField('IncludeChildDownloads', 'Include downloads from child products in purchase');
}
// this will just add unnecessary queries slowing down the page load
//$tabFields[] = new LiteralField('DownloadCount', '<p>Total Downloads: <strong>' . $this->owner->getDownloads()->count() . '</strong></p>');
// Product variations don't have tabs, so we need to be able
// to handle either case.
if ($fields->first() instanceof TabSet) {
$fields->addFieldsToTab("Root.{$tabName}", $tabFields);
} else {
$fields->push(new HeaderField('DownloadsHeader', $tabName));
foreach ($tabFields as $f) {
$fields->push($f);
}
}
}
示例7: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$cssFiles = new UploadField('CustomCSSFiles', _t('UserTemplatesExtension.CustomCSSFiles', "Custom CSS Files"));
$jsFiles = new UploadField('CustomJSFiles', _t('UserTemplatesExtension.CustomJSFiles', "Custom JS Files"));
$cssFiles->setFolderName(self::$css_folder);
$jsFiles->setFolderName(self::$js_folder);
$fields->removeByName('CustomCSSFiles');
$fields->removeByName('CustomJSFiles');
$templates = $this->fileBasedTemplates();
if (count($templates)) {
$fields->addFieldToTab('Root.Main', $dd = new DropdownField('ContentFile', _t('UserTemplatesExtension.CONTENT_FILE', 'File containing template'), $templates));
$dd->setRightTitle('If selected, any Content set above will be ignored');
} else {
$fields->removeByName('ContentFile');
}
$fields->push($strict = CheckboxField::create('StrictActions', _t('UserTemplates.STRICT_ACTIONS', 'Require actions to be explicitly overridden')));
$text = <<<DOC
When applied to a page type that has sub-actions, an action template will be used ONLY if the action is listed below, and this main
\t template will only be used for the 'index' action. If this is not checked, then this template will be used for ALL actions
\t in the page it is applied to.
DOC;
$strict->setRightTitle(_t('UserTemplates.STRICT_HELP', $text));
$templates = DataList::create('UserTemplate')->filter(array('ID:not' => $this->ID));
if ($templates->count()) {
$templates = $templates->map();
$fields->addFieldToTab('Root.Main', $kv = new KeyValueField('ActionTemplates', _t('UserTemplates.ACTION_TEMPLATES', 'Action specific templates'), array(), $templates));
$kv->setRightTitle(_t('UserTemplates.ACTION_TEMPLATES_HELP', 'Specify an action name and select another user defined template to handle a specific action. Only used for Layout templates'));
}
$fields->addFieldToTab('Root.Main', $cssFiles);
$fields->addFieldToTab('Root.Main', $jsFiles);
return $fields;
}
示例8: getCMSFields
function getCMSFields()
{
$_REQUEST["CompanyId"] = $this->ID;
$large_logo = new UploadField('BigLogo', 'Large Company Logo');
$large_logo->setFolderName('companies/main_logo');
$large_logo->setAllowedFileCategories('image');
$small_logo = new UploadField('Logo', 'Small Company Logo');
$small_logo->setAllowedFileCategories('image');
//logo validation rules
$large_logo_validator = new Upload_Image_Validator();
$large_logo_validator->setAllowedExtensions(array('jpg', 'png', 'jpeg'));
$large_logo_validator->setAllowedMaxImageWidth(500);
$large_logo->setValidator($large_logo_validator);
$small_logo_validator = new Upload_Image_Validator();
$small_logo_validator->setAllowedExtensions(array('jpg', 'png', 'jpeg'));
$small_logo_validator->setAllowedMaxImageWidth(200);
$small_logo->setValidator($small_logo_validator);
$fields = new FieldList(new TabSet($name = "Root", new Tab($title = 'Company', new HeaderField("Company Data"), new TextField('Name', 'Company Name'), new TextField('URLSegment', 'Unique page name for this company profile (ie: company-name)'), new TextField('URL', 'Company Web Address (URL)'), $level = new DropDownField('MemberLevel', 'OpenStack Foundation Member Level', $this->dbObject('MemberLevel')->enumValues()), new ColorField("Color", "Company Color"), new CheckboxField('DisplayOnSite', 'List this company on openstack.org'), new CheckboxField('Featured', 'Include this company in featured companies area'), new LiteralField('Break', '<hr/>'), $this->canEditLogo() ? $large_logo : new LiteralField('Space', '<br/>'), $this->canEditLogo() ? $small_logo : new LiteralField('Space', '<br/>'), new TextField('Industry', 'Industry (<4 Words)'), new HtmlEditorField('Description', 'Company Description'), new HtmlEditorField('Contributions', 'How you are contributing to OpenStack (<150 words)'), new HtmlEditorField('Products', 'Products/Services Related to OpenStack (<100 words)'), new HtmlEditorField('Overview', 'Company Overview'), new TextField('CommitmentAuthor', 'Commitment Author (Optional)'), new HtmlEditorField('Commitment', "OpenStack Commitment"), new LiteralField('Break', '<hr/>'), new TextField('ContactEmail', 'Best Contact email address (optional)'))));
$level->setEmptyString('-- Choose One --');
if ($this->ID > 0) {
$admin_list = $this->Administrators()->sort('ID');
$query = $admin_list->dataQuery();
$query->groupby('MemberID');
$admin_list = $admin_list->setDataQuery($query);
$config = GridFieldConfig_RelationEditor::create();
$config->removeComponentsByType('GridFieldEditButton');
$config->removeComponentsByType('GridFieldAddNewButton');
$config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('FirstName' => 'First Name', 'Surname' => 'Last Name', 'Email' => 'Email', 'DDLAdminSecurityGroup' => 'Security Group'));
$admins = new GridField('Administrators', 'Company Administrators', $admin_list, $config);
$contracts = new GridField("Contracts", "Contracts", $this->Contracts(), GridFieldConfig_RecordEditor::create(10));
$fields->addFieldsToTab('Root.Administrators', array(new HeaderField("Companies Administrators"), $admins));
$fields->addFieldsToTab('Root.Contracts', array(new HeaderField("Companies Contracts"), $contracts));
}
return $fields;
}
示例9: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', $image = new UploadField('Image', _t('TestimonialPage.ImageLabel', 'Image')), 'Content');
$image->setFolderName('Uploads/testimonials');
return $fields;
}
示例10: getEditForm
/**
* Returns the edit form for this admin.
*
* @param type $id
* @param type $fields
*
* @return Form
*/
public function getEditForm($id = null, $fields = null)
{
$fields = new FieldList();
$desc = _t('SilvercartProductImageAdmin.Description');
$descriptionField = new SilvercartAlertInfoField('SilvercartProductImagesDescription', str_replace(PHP_EOL, '<br/>', $desc));
$uploadField = new UploadField('SilvercartProductImages', _t('SilvercartProductImageAdmin.UploadProductImages', 'Upload product images'));
$uploadField->setFolderName(SilvercartProductImageImporter::get_relative_upload_folder());
$fields->push($uploadField);
$fields->push($descriptionField);
if (!SilvercartProductImageImporter::is_installed()) {
$cronTitle = _t('SilvercartProductImageAdmin.CronNotInstalledTitle') . ':';
$cron = _t('SilvercartProductImageAdmin.CronNotInstalledDescription');
$cronjobInfoField = new SilvercartAlertDangerField('SilvercartProductImagesCronjobInfo', str_replace(PHP_EOL, '<br/>', $cron), $cronTitle);
$fields->insertAfter('SilvercartProductImages', $cronjobInfoField);
} elseif (SilvercartProductImageImporter::is_running()) {
$cronTitle = _t('SilvercartProductImageAdmin.CronIsRunningTitle') . ':';
$cron = _t('SilvercartProductImageAdmin.CronIsRunningDescription');
$cronjobInfoField = new SilvercartAlertSuccessField('SilvercartProductImagesCronjobInfo', str_replace(PHP_EOL, '<br/>', $cron), $cronTitle);
$fields->insertAfter('SilvercartProductImages', $cronjobInfoField);
}
$uploadedFiles = $this->getUploadedFiles();
if (count($uploadedFiles) > 0) {
$uploadedFilesInfo = '<br/>' . implode('<br/>', $uploadedFiles);
$fileInfoField = new SilvercartAlertWarningField('SilvercartProductImagesFileInfo', $uploadedFilesInfo, _t('SilvercartProductImageAdmin.FileInfoTitle'));
$fields->insertAfter('SilvercartProductImages', $fileInfoField);
}
$actions = new FieldList();
$form = new Form($this, "EditForm", $fields, $actions);
$form->addExtraClass('cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses());
$form->loadDataFrom($this->request->getVars());
$this->extend('updateEditForm', $form);
return $form;
}
示例11: getCMSFields
public function getCMSFields()
{
$fields = new FieldList();
$fields->push(new TabSet('Root', new Tab('Main', _t('SiteTree.TABMAIN', 'Main'), new TextField('Title', _t('UniadsObject.db_Title', 'Title')))));
if ($this->ID) {
$previewLink = Director::absoluteBaseURL() . 'admin/' . UniadsAdmin::config()->url_segment . '/UniadsObject/preview/' . $this->ID;
$fields->addFieldToTab('Root.Main', new ReadonlyField('Impressions', _t('UniadsObject.db_Impressions', 'Impressions')), 'Title');
$fields->addFieldToTab('Root.Main', new ReadonlyField('Clicks', _t('UniadsObject.db_Clicks', 'Clicks')), 'Title');
$fields->addFieldsToTab('Root.Main', array(DropdownField::create('CampaignID', _t('UniadsObject.has_one_Campaign', 'Campaign'), DataList::create('UniadsCampaign')->map())->setEmptyString(_t('UniadsObject.Campaign_none', 'none')), DropdownField::create('ZoneID', _t('UniadsObject.has_one_Zone', 'Zone'), DataList::create('UniadsZone')->map())->setEmptyString(_t('UniadsObject.Zone_select', 'select one')), new NumericField('Weight', _t('UniadsObject.db_Weight', 'Weight (controls how often it will be shown relative to others)')), new TextField('TargetURL', _t('UniadsObject.db_TargetURL', 'Target URL')), new Treedropdownfield('InternalPageID', _t('UniadsObject.has_one_InternalPage', 'Internal Page Link'), 'Page'), new CheckboxField('NewWindow', _t('UniadsObject.db_NewWindow', 'Open in a new Window')), $file = new UploadField('File', _t('UniadsObject.has_one_File', 'Advertisement File')), $AdContent = new TextareaField('AdContent', _t('UniadsObject.db_AdContent', 'Advertisement Content')), $Starts = new DateField('Starts', _t('UniadsObject.db_Starts', 'Starts')), $Expires = new DateField('Expires', _t('UniadsObject.db_Expires', 'Expires')), new NumericField('ImpressionLimit', _t('UniadsObject.db_ImpressionLimit', 'Impression Limit')), new CheckboxField('Active', _t('UniadsObject.db_Active', 'Active')), new LiteralField('Preview', '<a href="' . $previewLink . '" target="_blank">' . _t('UniadsObject.Preview', 'Preview this advertisement') . "</a>")));
$app_categories = File::config()->app_categories;
$file->setFolderName($this->config()->files_dir);
$file->getValidator()->setAllowedMaxFileSize(array('*' => $this->config()->max_file_size));
$file->getValidator()->setAllowedExtensions(array_merge($app_categories['image'], $app_categories['flash']));
$AdContent->setRows(10);
$AdContent->setColumns(20);
$Starts->setConfig('showcalendar', true);
$Starts->setConfig('dateformat', i18n::get_date_format());
$Starts->setConfig('datavalueformat', 'yyyy-MM-dd');
$Expires->setConfig('showcalendar', true);
$Expires->setConfig('dateformat', i18n::get_date_format());
$Expires->setConfig('datavalueformat', 'yyyy-MM-dd');
$Expires->setConfig('min', date('Y-m-d', strtotime($this->Starts ? $this->Starts : '+1 days')));
}
$this->extend('updateCMSFields', $fields);
return $fields;
}
示例12: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$avatar = new UploadField('Avatar', 'Avatar');
$avatar->setFolderName('member/avatar');
$fields->replaceField('Avatar', $avatar);
$fields->removeByName('SortOrder');
}
示例13: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new HTMLEditorField('VisaInformation', 'Visa Information'));
$fields->addFieldToTab('Root.Main', new HTMLEditorField('TravelSupport', 'Travel Support'));
$fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('CityIntro', 'City Intro'));
$fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('AboutTheCity', 'About The City'));
$fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('Locals', 'In The Words Of The Locals'));
$fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('GettingAround', 'Getting Around'));
$fields->addFieldsToTab('Root.CityInfo', new TextField('HostCityLat', 'City Latitude (Map Center)'));
$fields->addFieldsToTab('Root.CityInfo', new TextField('HostCityLng', 'City Longitude (Map Center)'));
$fields->addFieldToTab('Root.MapLocations', new HTMLEditorField('LocationsTextHeader', 'Intro Text'));
$fields->addFieldToTab('Root.MapLocations', new HTMLEditorField('OtherLocations', 'Other Locations'));
if ($this->ID) {
// Summit Question Categories
$fields->addFieldsToTab('Root.Main', $venue_back = new UploadField('VenueBackgroundImage', 'Venue Background Image'));
$venue_back->setFolderName('summits/locations');
$venue_back->setAllowedMaxFileNumber(1);
$venue_back->setAllowedFileCategories('image');
$fields->addFieldsToTab('Root.Main', new TextField('VenueBackgroundImageHero', 'Venue Background Image Author'));
$fields->addFieldsToTab('Root.Main', new TextField('VenueBackgroundImageHeroSource', 'Venue Background Image Author Url'));
$fields->addFieldsToTab('Root.CityInfo', $about_back = new UploadField('AboutTheCityBackgroundImage', 'About The City Background Image'));
$about_back->setFolderName('summits/location/about');
$about_back->setAllowedMaxFileNumber(1);
$about_back->setAllowedFileCategories('image');
$fields->addFieldsToTab('Root.CityInfo', new TextField('AboutTheCityBackgroundImageHero', 'About The City Background Image Author'));
$fields->addFieldsToTab('Root.CityInfo', new TextField('AboutTheCityBackgroundImageHeroSource', 'About The City Background Image Author Source Url'));
}
$fields->addFieldToTab('Root.Main', new TextField('VenueTitleText', 'Venue Title Text'));
$fields->addFieldToTab('Root.Main', new TextField('AirportsTitle', 'Airports Title'));
$fields->addFieldToTab('Root.Main', new TextField('AirportsSubTitle', 'Airports SubTitle'));
$fields->addFieldToTab('Root.Main', new TextField('CampusGraphic', 'URL of image of campus graphic'));
return $fields;
}
示例14: getCMSFields
public function getCMSFields()
{
$ScrollDirectionOptions = array("up", "down", "left", "right");
$ScrollEasingOptions = array("Elastic", "Linear");
$ScrollFx = array("none", "scroll", "directscroll", "fade", "crossfade", "cover", "cover-fade", "uncover", "uncover-fade");
$GenAlignment = array("Left", "Center", "Right");
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Photos', $uploadField = new UploadField($name = 'Images', $title = 'Upload one or more images (max 10 at a time)'));
$fields->addFieldToTab('Root.Settings.General', new CheckBoxField('GenAutoStart', 'Auto Start Carousel?'));
$fields->addFieldToTab('Root.Settings.General', new CheckBoxField('GenCarouselCircular', 'Make Carousel Circular?'));
$fields->addFieldToTab('Root.Settings.General', new CheckBoxField('GenCarouselInfinite', 'Make Carousel Infinite?'));
$fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemNumberToStart', 'Which item should start carousel (0 for random)'));
$fields->addFieldToTab('Root.Settings.General', new NumericField('GenDurationBeforeStart', 'Delay before carousel scrolls for first time (millisec)'));
$fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemsMin', 'Items Viewable Minimum'));
$fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemsMax', 'Items Viewable Maximum'));
$fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemWidth', 'Set image width (use 0 for no scaling)'));
$fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemHeight', 'Set image Height (use 0 for no scaling)'));
$fields->addFieldToTab('Root.Settings.General', new DropDownField("GenAlignment", "Slide Alignment?", $GenAlignment));
$fields->addFieldToTab('Root.Settings.Scroll', new DropDownField("ScrollDirection", "What direction to move the carousel?", $ScrollDirectionOptions));
$fields->addFieldToTab('Root.Settings.Scroll', new DropDownField("ScrollFx", "Slide Transition type?", $ScrollFx));
$fields->addFieldToTab('Root.Settings.Scroll', new DropDownField("ScrollEasing", "Slide Easing Option", $ScrollEasingOptions));
$fields->addFieldToTab('Root.Settings.Scroll', new NumericField('ScrollNumItems', 'Scroll number of items (0 will scroll none)'));
$fields->addFieldToTab('Root.Settings.Scroll', new NumericField('ScrollDuration', 'Scroll Duration Time (millisec)'));
$fields->addFieldToTab('Root.Settings.Scroll', new CheckBoxField('ScrollPauseOnHover', 'Pause the scrolling when mouse is hovering?'));
$fields->addFieldToTab('Root.Settings.Swipe', new CheckBoxField('SwipeOnMouse', 'scroll via dragging (on non-touch-devices only)'));
$fields->addFieldToTab('Root.Settings.Swipe', new CheckBoxField('SwipeOnTouch', 'scroll via swiping gestures (on touch-devices only)'));
$uploadField->setFolderName('slides');
$uploadField->setAllowedMaxFileNumber(10);
return $fields;
}
示例15: getProfileFields
/**
* @return array
*/
protected function getProfileFields()
{
//TODO gender enum
$postcode = new RegexTextField('Postcode', _t('Addressable.POSTCODE', 'Postcode'));
$postcode->setRegex($this->postcodeRegex);
$fields = array(new HeaderField('ProfileHeader', _t('Profileable.PROFILE', 'Profile')), new OptionsetField('Gender', _t('Profileable.GENDER', 'Gender'), array('m' => _t('Profileable.MASCULINE', 'masculine'), 'f' => _t('Profileable.FEMININE', 'feminine'), 'u' => _t('Profileable.UNKNOWN', 'unknown')), 'u'), new TextField('AcademicTitle', _t('Profileable.ACADEMICTITLE', 'Name')), new TextField('ProfileName', _t('Profileable.NAME', 'Name')), new TextField('Company', _t('Profileable.COMPANY', 'Company')), new TextField('Position', _t('Profileable.POSITION', 'Position')), new TextField('Address', _t('Addressable.ADDRESS', 'Address')), new TextField('AddressAddition', _t('Profileable.ADDRESSADDITION', 'Address Addition')), $postcode, new TextField('City', _t('Profileable.CITY', 'City')), new TextField('Suburb', _t('Addressable.SUBURB', 'Suburb')));
$label = _t('Addressable.STATE', 'State');
if (is_array($this->allowedStates)) {
$fields[] = new DropdownField('State', $label, $this->allowedStates);
} elseif (!is_string($this->allowedStates)) {
$fields[] = new TextField('State', $label);
}
$label = _t('Addressable.COUNTRY', 'Country');
if (is_array($this->allowedCountries)) {
$fields[] = new DropdownField('Country', $label, $this->allowedCountries);
} elseif (!is_string($this->allowedCountries)) {
$fields[] = new CountryDropdownField('Country', $label);
}
$fields[] = new TextField('Phone', _t('Profileable.PHONE', 'Phone'));
$fields[] = new TextField('Fax', _t('Profileable.FAX', 'Fax'));
$fields[] = new EmailField('ProfileEmail', _t('Profileable.EMAIL', 'E-Mail'));
$fields[] = new TextField('Www', _t('Profileable.WWW', 'Homepage'));
$profileUpload = new UploadField('ProfilePicture', _t('Profileable.PROFILEPICTURE', 'Profile Picture'));
$profileUpload->allowedExtensions = self::$ProfilePictureAllowedTypes;
$profileUpload->setFolderName(self::$ProfilePictureFolder);
$profileUpload->setConfig('allowedMaxFileNumber', 1);
$fields[] = $profileUpload;
$fields[] = new TextareaField('Description', _t('Profileable.DESCRIPTION', 'Description'));
return $fields;
}