本文整理汇总了PHP中DateField::setConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP DateField::setConfig方法的具体用法?PHP DateField::setConfig怎么用?PHP DateField::setConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateField
的用法示例。
在下文中一共展示了DateField::setConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
function getCMSFields()
{
// don't overwrite the main fields
$fields = parent::getCMSFields();
// Nominations Open
$NominationsOpenField = new DateField('NominationsOpen', 'Date the nominations open (12:00AM this day)');
$NominationsOpenField->setConfig('showcalendar', true);
$NominationsOpenField->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $NominationsOpenField, 'Content');
$NominationsOpenHeader = new HeaderField('Candidate Nomination Dates');
$fields->addFieldToTab('Root.Main', $NominationsOpenHeader, 'NominationsOpen');
// Nominations Close
$NominationsCloseField = new DateField('NominationsClose', 'Date the nominations close (11:59PM this day)');
$NominationsCloseField->setConfig('showcalendar', true);
$NominationsCloseField->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $NominationsCloseField, 'Content');
// Nomination App Deadline
$NominationAppDeadlineField = new DateField('NominationAppDeadline', 'Date candidates must have completed the application in order to be listed (11:59PM this day)');
$NominationAppDeadlineField->setConfig('showcalendar', true);
$NominationAppDeadlineField->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $NominationAppDeadlineField, 'Content');
// Elections Open
$ElectionsOpenField = new DateField('ElectionsOpen', 'Date the elections open (12:00AM this day)');
$ElectionsOpenField->setConfig('showcalendar', true);
$ElectionsOpenField->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $ElectionsOpenField, 'Content');
$NominationsOpenHeader = new HeaderField('Election Dates');
$fields->addFieldToTab('Root.Main', $NominationsOpenHeader, 'ElectionsOpen');
// Elections Close
$ElectionsCloseField = new DateField('ElectionsClose', 'Date the elections close (11:59PM this day)');
$ElectionsCloseField->setConfig('showcalendar', true);
$ElectionsCloseField->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $ElectionsCloseField, 'Content');
return $fields;
}
示例2: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
// the date field is added in a bit more complex manner so it can have the dropdown date picker
$EventStartDate = new DateField('EventStartDate', 'First Day of Event');
$EventStartDate->setConfig('showcalendar', true);
$EventStartDate->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $EventStartDate, 'Content');
// same things for the event end date
$EventEndDate = new DateField('EventEndDate', 'Last Day of Event');
$EventEndDate->setConfig('showcalendar', true);
$EventEndDate->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $EventEndDate, 'Content');
$fields->addFieldToTab('Root.Main', new TextField('EventLink', 'Event Button Link (URL)'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('EventLinkLabel', 'Event Button Label'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('EventLocation', 'Event Location'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('EventSponsor', 'Event Sponsor'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('EventSponsorLogoUrl', 'URL of the Event Sponsor Logo'), 'Content');
$fields->addFieldToTab('Root.Main', new CheckboxField('IsSummit', 'Official OpenStack Summit Event'), 'Content');
// remove unneeded fields
$fields->removeFieldFromTab("Root.Main", "MenuTitle");
// rename fields
$fields->renameField("Content", "Event Page Content");
$fields->renameField("Title", "Event Title");
return $fields;
}
示例3: 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;
}
示例4: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
// Summit Video Stream
$VideoLiveField = new OptionSetField('VideoCurrentlyPlaying', 'Is the video live streaming at the moment?', array('Yes' => 'Video is being streamed.', 'No' => 'No video playing.'));
$fields->addFieldToTab("Root.Main", new TextField('LiveStreamURL', 'URL of Live Stream Feed'));
$SummitModeField = new OptionSetField('SummitMode', 'Homepage mode:', array(0 => 'Normal Mode', 1 => 'Summit Mode'));
$fields->addFieldToTab("Root.Main", new TextField('NextPresentationStartTime', 'Next Presentation Start Time'));
$fields->addFieldToTab("Root.Main", new TextField('NextPresentationStartDate', 'Next Presentation Start Date'));
$fields->addFieldToTab("Root.Main", $VideoLiveField, 'Content');
$fields->addFieldToTab("Root.Main", $SummitModeField, 'Content');
// Countdown Date
$EventStartDate = new DateField('EventDate', 'First Day of Event (for counting down)');
$EventStartDate->setConfig('showcalendar', true);
$EventStartDate->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $EventStartDate, 'Content');
// remove unneeded fields
$fields->removeFieldFromTab("Root.Main", "Content");
$promo_hero_image = new CustomUploadField('PromoImage', 'Promo Hero Image');
$promo_hero_image->setFolderName('homepage');
$promo_hero_image->setAllowedFileCategories('image');
$fields->addFieldToTab("Root.IntroHeader", $promo_hero_image);
$fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoIntroMessage', 'Promo Intro Message'));
$fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoButtonText', 'Promo Button Text'));
$fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoButtonUrl', 'Promo Button Url'));
$fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoDatesText', 'Promo Dates Text'));
$fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoHeroCredit', 'Hero Credit'));
$fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoHeroCreditUrl', 'Hero Credit Url'));
return $fields;
}
示例5: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$HSEAScore = GroupedList::create(Score::get()->sort('ClassName'));
$fields->addFieldToTab("Root.Main", new OptionSetField('Status', 'Status', singleton('Project')->dbObject('Status')->enumValues()));
$fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Check List', $HSEAScore));
$impact = GroupedList::create(Impact::get()->sort('Title'));
$fields->addFieldToTab("Root.Main", new CheckboxsetField('Impacts', 'Impact', $impact));
//$FinScore= DataObject::get('Score' ,"ClassName = 'Financial'");
// $fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Financial', $FinScore));
// $ServScore= DataObject::get('Score', "ClassName = 'Service'");
// $fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Service', $ServScore));
/*$gridFieldConfig = GridFieldConfig::create()->addComponents(
new GridFieldToolbarHeader(),
new GridFieldAddNewButton('toolbar-header-right'),
new GridFieldSortableHeader(),
new GridFieldDataColumns(),
new GridFieldPaginator(15),
new GridFieldEditButton(),
new GridFieldDeleteAction(),
new GridFieldDetailForm()
);
$gridfield = new GridField("Tasks", "Tasks", $this->Tasks(), $gridFieldConfig);
$fields->addFieldToTab('Root.Tasks', $gridfield);*/
$fields->addFieldToTab("Root.Main", $dateField = new DateField("DueDate", "Date Due"));
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'dd/MM/YYYY');
return $fields;
}
示例6: getCMSFields
public function getCMSFields()
{
//Fetch curret fields and store in Fields
$fields = parent::getCMSFields();
//Remove Fields
$fields->removeFieldFromTab("Root.Main", array("SortOrder", "CalendarID", "Title", "Content", "StartDate", "StartTime", "EndDate", "EndTime", "Location"));
//Event Title
$Title = new TextField("Title", "Event Title");
$Title->setRightTitle("Enter the event title. i.e. sports day.");
//Start Date & Time
$StartDate = new DateField("StartDate", "Start Date");
$StartDate->setConfig('showcalendar', 1);
$StartDate->setConfig('dateformat', 'dd/MM/YYYY');
$StartTime = new TimeField("StartTime", "Start Time (Optional)");
$StartTime->setConfig('use_strtotime', 1);
//End Date & Time
$EndDate = new DateField("EndDate", "End Date (Optional)");
$EndDate->setConfig('showcalendar', 1);
$EndDate->setConfig('dateformat', 'dd/MM/YYYY');
$EndTime = new TimeField("EndTime", "End Time (Optional)");
$StartTime->setConfig('use_strtotime', 1);
//Location
$Location = new AddressTextField("Location", "Event Location", "AIzaSyA-folYpPWGiFcpBZURJpf610nO6FJtqqQ");
$Location->SetRightTitle("Optional. Begin typing and you will see address suggestions (Beta). Powered by Google.");
$Location->addExtraClass("text");
//Event Description
$Description = new HTMLEditorField("Content", "Event Description");
//Group Start and End Date & Time Fields
$Times = FieldGroup::create($StartDate, $StartTime, $EndDate, $EndTime)->setTitle('Timings');
//Add Fields to the CMS
$fields->addFieldsToTab("Root.Main", array($Title, $Times, $Location, $Description));
//Return Fields to the CMS
return $fields;
}
示例7: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Main", $dateField = new DateField("Date", "Date"));
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'dd/MM/YYYY');
return $fields;
}
示例8: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$datefield = new DateField('Date');
$datefield->setConfig('showcalendar', true);
$datefield->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $datefield, 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Author'), 'Content');
return $fields;
}
示例9: modifyParameterFields
/**
* @param \FieldList $parameterFields
* @param array $filters
* @param \SS_HTTPRequest $request
* @return void
*/
public function modifyParameterFields(\FieldList $parameterFields, array $filters, \SS_HTTPRequest $request)
{
$parameterFields->push($start = new \DateField('StartDate'));
$start->setConfig('showcalendar', true);
$start->setConfig('dateformat', 'dd/MM/YYYY');
$parameterFields->push($end = new \DateField('EndDate'));
$end->setConfig('showcalendar', true);
$end->setConfig('dateformat', 'dd/MM/YYYY');
$parameterFields->push(new \DropdownField('Range', 'Range', ['' => '-- Range --', 'Today' => 'Today', 'Yesterday' => 'Yesterday', 'Current Week' => 'Current Week', 'Last Week' => 'Last Week', 'Current Month' => 'Current Month', 'Last Month' => 'Last Month', 'Current Year' => 'Current Year', 'All Time' => 'All Time']));
}
示例10: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
// the date field is added in a bit more complex manner so it can have the dropdown date picker
$MustBeMemberBy = new DateField('MustBeMemberBy', 'Only show foundation members that signed up before this date:');
$MustBeMemberBy->setConfig('showcalendar', true);
$MustBeMemberBy->setConfig('showdropdown', true);
$fields->addFieldToTab('Root.Main', $MustBeMemberBy, 'Content');
return $fields;
}
示例11: getCMSFields
public function getCMSFields()
{
$Sfields = parent::getCMSFields();
$dateField = new DateField('Date', 'Article Date (for example: 20/12/2010)');
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'dd/MM/YYYY');
$fields->addFieldToTab('Root.Main', $dateField, 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Author', 'Author Name'), 'Content');
return $fields;
}
示例12: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new CheckboxField('IsExplicit', 'Contains Explicit Content'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('ChapterTitle', 'Chapter Title'), 'Content');
$fields->addFieldToTab('Root.Main', $dateField = new DateField('Added', 'Added on (for example: 12/20/2010)'), 'Content');
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'MM/dd/YYYY');
return $fields;
}
示例13: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$Datepckr = new DateField('Date');
$Datepckr->setConfig('dateformat', 'dd-MM-yyyy');
// global setting
$Datepckr->setConfig('showcalendar', 1);
// field-specific setting
$fields->addFieldToTab("Root.Main", $Datepckr, 'Content');
return $fields;
}
示例14: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$datefield = new DateField('Date', 'Date');
$datefield->setConfig('showcalendar', true);
$datefield->setConfig('showdropdown', true);
$datefield->setConfig('dateformat', 'dd/MM/YYYY');
$fields->addFieldToTab('Root.Main', $datefield, 'Content');
$fields->addFieldToTab('Root.Main', new CheckboxField('Featured', 'Not for display on homepage'), 'Content');
return $fields;
}
示例15: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new TextField('Description', 'Contest Short Description'), 'Content');
$fields->addFieldToTab('Root.Main', new UploadField('CoverImage', 'Cover Image'), 'Content');
$fields->addFieldToTab('Root.Main', $startField = new DateField('StartDate', 'Start Date'), 'Content');
$startField->setConfig('showcalendar', true);
$startField->setConfig('dateformat', 'MM/dd/YYYY');
$fields->addFieldToTab('Root.Main', $deadlineField = new DateField('Deadline', 'Submission Deadline'), 'Content');
$deadlineField->setConfig('showcalendar', true);
$deadlineField->setConfig('dateformat', 'MM/dd/YYYY');
return $fields;
}