本文整理汇总了PHP中UploadField::setOverwriteWarning方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadField::setOverwriteWarning方法的具体用法?PHP UploadField::setOverwriteWarning怎么用?PHP UploadField::setOverwriteWarning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadField
的用法示例。
在下文中一共展示了UploadField::setOverwriteWarning方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldsToTab('Root.Main', new HtmlEditorField('OverviewIntro', 'Overview Intro'));
if ($this->ID > 0) {
$fields->addFieldToTab('Root.Networking', new HtmlEditorField('NetworkingContent', 'Content'));
//networking photos
$config = GridFieldConfig_RecordEditor::create();
$config->addComponent(new GridFieldSortableRows('Order'));
$gridField = new GridField('NetworkingPhotos', 'Photos', $this->NetworkingPhotos(), $config);
$fields->addFieldToTab('Root.Networking', $gridField);
$fields->addFieldToTab('Root.Networking', new HtmlEditorField('NetworkingContent', 'Content'));
//menu items
$config = GridFieldConfig_RecordEditor::create();
$config->addComponent(new GridFieldSortableRows('Order'));
$gridField = new GridField('HelpMenuItems', 'Help Menu Items', $this->HelpMenuItems(), $config);
$fields->addFieldToTab('Root.HelpSideBarMenu', $gridField);
}
$fields->addFieldsToTab('Root.Schedule', new TextField('ScheduleTitle', 'Title'));
$fields->addFieldsToTab('Root.Schedule', new HtmlEditorField('ScheduleText', 'Text'));
$fields->addFieldsToTab('Root.Schedule', new TextField('ScheduleUrl', 'Url'));
$fields->addFieldsToTab('Root.Schedule', new TextField('ScheduleBtnText', 'Button Caption'));
// Video Recap
$fields->addFieldsToTab('Root.VideoRecap', new TextField('RecapTitle', 'Title'));
$fields->addFieldsToTab('Root.VideoRecap', new TextField('VideoRecapCaption1', 'Caption Text 1'));
$fields->addFieldsToTab('Root.VideoRecap', new TextField('VideoRecapYouTubeID1', 'YouTubeID 1'));
$fields->addFieldsToTab('Root.VideoRecap', new TextField('VideoRecapCaption2', 'Caption Text 2'));
$fields->addFieldsToTab('Root.VideoRecap', new TextField('VideoRecapYouTubeID2', 'YouTubeID 2'));
// GrowthBox
$fields->addFieldToTab("Root.GrowthBox", new HtmlEditorField('GrowthBoxTextTop', 'Text Top'));
$fields->addFieldToTab("Root.GrowthBox", new HtmlEditorField('GrowthBoxTextBottom', 'Text Bottom'));
$fields->addFieldsToTab("Root.GrowthBox", $upload_0 = new UploadField('GrowthBoxBackground', 'Background Image'));
$fields->addFieldsToTab("Root.GrowthBox", $upload_1 = new UploadField('GrowthBoxChartLegend', 'Chart Legend (SVG)'));
$fields->addFieldsToTab("Root.GrowthBox", $upload_2 = new UploadField('GrowthBoxChartLegendPng', 'Chart Legend (PNG)'));
$fields->addFieldsToTab("Root.GrowthBox", $upload_3 = new UploadField('GrowthBoxChart', 'Chart (SVG)'));
$fields->addFieldsToTab("Root.GrowthBox", $upload_4 = new UploadField('GrowthBoxChartPng', 'Chart (PNG)'));
$upload_0->setFolderName('summits/overview');
$upload_0->setAllowedMaxFileNumber(1);
$upload_0->setAllowedFileCategories('image');
$upload_0->setOverwriteWarning(false);
$upload_0->getUpload()->setReplaceFile(true);
$upload_1->setFolderName('summits/overview');
$upload_1->setAllowedMaxFileNumber(1);
$upload_1->setAllowedExtensions(array('svg'));
$upload_1->setOverwriteWarning(false);
$upload_1->getUpload()->setReplaceFile(true);
$upload_2->setFolderName('summits/overview');
$upload_2->setAllowedMaxFileNumber(1);
$upload_2->setAllowedExtensions(array('png'));
$upload_2->setOverwriteWarning(false);
$upload_2->getUpload()->setReplaceFile(true);
$upload_3->setFolderName('summits/overview');
$upload_3->setAllowedMaxFileNumber(1);
$upload_3->setAllowedExtensions(array('svg'));
$upload_3->setOverwriteWarning(false);
$upload_3->getUpload()->setReplaceFile(true);
$upload_4->setFolderName('summits/overview');
$upload_4->setAllowedMaxFileNumber(1);
$upload_4->setAllowedExtensions(array('png'));
$upload_4->setOverwriteWarning(false);
$upload_4->getUpload()->setReplaceFile(true);
//two main events
$fields->addFieldsToTab('Root.TwoMainEvents', new TextField('TwoMainEventsTitle', 'Title'));
$fields->addFieldsToTab('Root.TwoMainEvents', new TextField('EventOneTitle', 'Event One - Title'));
$fields->addFieldsToTab('Root.TwoMainEvents', new TextField('EventOneSubTitle', 'Event One - SubTitle'));
$fields->addFieldsToTab('Root.TwoMainEvents', new HtmlEditorField('EventOneContent', 'Event One - Content'));
$fields->addFieldsToTab('Root.TwoMainEvents', new TextField('EventTwoTitle', 'Event Two - Title'));
$fields->addFieldsToTab('Root.TwoMainEvents', new TextField('EventTwoSubTitle', 'Event Two - SubTitle'));
$fields->addFieldsToTab('Root.TwoMainEvents', new HtmlEditorField('EventTwoContent', 'Event Two - Content'));
$fields->addFieldsToTab("Root.TwoMainEvents", $upload_5 = new UploadField('EventOneLogo', 'Event Two Logo (SVG)'));
$fields->addFieldsToTab("Root.TwoMainEvents", $upload_6 = new UploadField('EventOneLogoPng', 'Event Two Logo (PNG)'));
$fields->addFieldsToTab("Root.TwoMainEvents", $upload_7 = new UploadField('EventTwoLogo', 'Event Two Logo (SVG)'));
$fields->addFieldsToTab("Root.TwoMainEvents", $upload_8 = new UploadField('EventTwoLogoPng', 'Event Two Logo (PNG)'));
$upload_5->setFolderName('summits/overview/events');
$upload_5->setAllowedMaxFileNumber(1);
$upload_5->setAllowedExtensions(array('svg'));
$upload_5->setOverwriteWarning(false);
$upload_5->getUpload()->setReplaceFile(true);
$upload_6->setFolderName('summits/overview/events');
$upload_6->setAllowedMaxFileNumber(1);
$upload_6->setAllowedExtensions(array('png'));
$upload_6->setOverwriteWarning(false);
$upload_6->getUpload()->setReplaceFile(true);
$upload_7->setFolderName('summits/overview/events');
$upload_7->setAllowedMaxFileNumber(1);
$upload_7->setAllowedExtensions(array('svg'));
$upload_7->setOverwriteWarning(false);
$upload_7->getUpload()->setReplaceFile(true);
$upload_8->setFolderName('summits/overview/events');
$upload_8->setAllowedMaxFileNumber(1);
$upload_8->setAllowedExtensions(array('png'));
$upload_8->setOverwriteWarning(false);
$upload_8->getUpload()->setReplaceFile(true);
//atendees chart
$fields->addFieldsToTab("Root.AtendeesChart", $upload_13 = new UploadField('AtendeesChartRef', 'Atendees Chart Legend (SVG)'));
$fields->addFieldsToTab("Root.AtendeesChart", $upload_19 = new UploadField('AtendeesChartRefPng', 'Atendees Chart Legend (PNG)'));
$fields->addFieldToTab("Root.AtendeesChart", new TextField('Atendees1Label', 'Atendees 1 Label'));
$fields->addFieldsToTab("Root.AtendeesChart", $upload_9 = new UploadField('Atendees1Chart', 'Atendees 1 Chart (SVG)'));
$fields->addFieldsToTab("Root.AtendeesChart", $upload_15 = new UploadField('Atendees1ChartPng', 'Atendees 1 Chart (PNG)'));
$fields->addFieldToTab("Root.AtendeesChart", new TextField('Atendees2Label', 'Atendees 2 Label'));
//.........这里部分代码省略.........