本文整理汇总了PHP中DropdownField::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP DropdownField::setDescription方法的具体用法?PHP DropdownField::setDescription怎么用?PHP DropdownField::setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DropdownField
的用法示例。
在下文中一共展示了DropdownField::setDescription方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
// Contact Form settings
$recipient_field = new EmailField('DefaultRecipient', 'Email recipient');
$recipient_field->setDescription('Default email address to send submissions to.');
$subject_field = new TextField('Subject', 'Email subject');
$subject_field->setDescription('Subject for the email.');
$default_from_field = new EmailField('DefaultFrom', 'Email from');
$default_from_field->setDescription('Default from email address.');
$fields->addFieldToTab('Root.ContactForm.Settings', $recipient_field);
$fields->addFieldToTab('Root.ContactForm.Settings', $subject_field);
$fields->addFieldToTab('Root.ContactForm.Settings', $default_from_field);
// Contact Form fields
$conf = GridFieldConfig_RelationEditor::create(10);
$conf->addComponent(new GridFieldSortableRows('SortOrder'));
$data_columns = $conf->getComponentByType('GridFieldDataColumns');
$data_columns->setDisplayFields(array('Name' => 'Name', 'Type' => 'Type', 'requiredText' => 'Required'));
$contact_form_fields = new GridField('Fields', 'Field', $this->ContactFields(), $conf);
$fields->addFieldToTab('Root.ContactForm.Fields', $contact_form_fields);
// Recipient map
$contact_fields = array();
foreach ($this->ContactFields() as $contact_field) {
$contact_fields[$contact_field->Name] = $contact_field->Name;
}
$recipient_map_field_field = new DropdownField('RecipientMapField', 'Recipient Map Field', $contact_fields);
$recipient_map_field_field->setDescription('Field used to map recipients.');
$recipient_map_field = new TextareaField('RecipientMap', 'Recipient Map');
$recipient_map_field->setDescription('Map field values to an email address (format: value:email address) one per line.');
$fields->addFieldToTab('Root.ContactForm.RecipientMap', $recipient_map_field_field);
$fields->addFieldToTab('Root.ContactForm.RecipientMap', $recipient_map_field);
return $fields;
}
示例2: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->insertAfter(new ToggleCompositeField('AfterRegistrationContent', _t('EventRegistration.AFTER_REG_CONTENT', 'After Registration Content'), array(new TextField('AfterRegTitle', _t('EventRegistration.TITLE', 'Title')), new HtmlEditorField('AfterRegContent', _t('EventRegistration.CONTENT', 'Content')))), 'Content');
$fields->insertAfter(new ToggleCompositeField('AfterUnRegistrationContent', _t('EventRegistration.AFTER_UNREG_CONTENT', 'After Un-Registration Content'), array(new TextField('AfterUnregTitle', _t('EventRegistration.TITLE', 'Title')), new HtmlEditorField('AfterUnregContent', _t('EventRegistration.CONTENT', 'Content')))), 'AfterRegistrationContent');
if ($this->RegEmailConfirm) {
$fields->addFieldToTab('Root.Main', new ToggleCompositeField('AfterRegistrationConfirmation', _t('EventRegistration.AFTER_REG_CONFIRM_CONTENT', 'After Registration Confirmation Content'), array(new TextField('AfterConfirmTitle', _t('EventRegistration.TITLE', 'Title')), new HtmlEditorField('AfterConfirmContent', _t('EventRegistration.CONTENT', 'Content')))));
}
if ($this->UnRegEmailConfirm) {
$fields->addFieldToTab('Root.Main', new ToggleCompositeField('AfterUnRegistrationConfirmation', _t('EventRegistration.AFTER_UNREG_CONFIRM_CONTENT', 'After Un-Registration Confirmation Content'), array(new TextField('AfterConfUnregTitle', _t('EventRegistration.TITLE', 'Title')), new HtmlEditorField('AfterConfUnregContent', _t('EventRegistration.CONTENT', 'Content')))));
}
$fields->addFieldToTab('Root.Tickets', new GridField('Tickets', 'Ticket Types', $this->Tickets(), GridFieldConfig_RecordEditor::create()));
$generators = ClassInfo::implementorsOf('EventRegistrationTicketGenerator');
if ($generators) {
foreach ($generators as $generator) {
$instance = new $generator();
$generators[$generator] = $instance->getGeneratorTitle();
}
$generator = new DropdownField('TicketGenerator', _t('EventRegistration.TICKET_GENERATOR', 'Ticket generator'), $generators);
$generator->setEmptyString(_t('EventManagement.NONE', '(None)'));
$generator->setDescription(_t('EventManagement.TICKET_GENERATOR_NOTE', 'The ticket generator is used to generate a ticket file for the user to download.'));
$fields->addFieldToTab('Root.Tickets', $generator);
}
$regGridFieldConfig = GridFieldConfig_Base::create()->removeComponentsByType('GridFieldAddNewButton')->removeComponentsByType('GridFieldDeleteAction')->addComponents(new GridFieldButtonRow('after'), new GridFieldPrintButton('buttons-after-left'), new GridFieldExportButton('buttons-after-left'));
$fields->addFieldsToTab('Root.Registrations', array(new GridField('Registrations', _t('EventManagement.REGISTRATIONS', 'Registrations'), $this->DateTimes()->relation('Registrations')->filter('Status', 'Valid'), $regGridFieldConfig), new GridField('CanceledRegistrations', _t('EventManagement.CANCELLATIONS', 'Cancellations'), $this->DateTimes()->relation('Registrations')->filter('Status', 'Canceled'), $regGridFieldConfig)));
if ($this->RegEmailConfirm) {
$fields->addFieldToTab('Root.Registrations', new ToggleCompositeField('UnconfirmedRegistrations', _t('EventManagement.UNCONFIRMED_REGISTRATIONS', 'Unconfirmed Registrations'), array(new GridField('UnconfirmedRegistrations', '', $this->DateTimes()->relation('Registrations')->filter('Status', 'Unconfirmed')))));
}
$fields->addFieldToTab('Root.Invitations', new GridField('Invitations', _t('EventManagement.INVITATIONS', 'Invitations'), $this->Invitations(), GridFieldConfig_RecordViewer::create()->addComponent(new GridFieldButtonRow('before'))->addComponent(new EventSendInvitationsButton($this))));
return $fields;
}
示例3: getCMSFields
/**
* (non-PHPdoc)
*
* @see SiteTree::getCMSFields()
*/
public function getCMSFields()
{
// Get the fields from the parent implementation
$fields = parent::getCMSFields();
// List of available fields in the page
$groupFields = $this->EditableFieldGroup()->Fields();
$list = $this->Fields()->addMany($groupFields)->sort('Sort', 'ASC');
// Add tab to edit fields values
$this->buildPageFieldsTab($list, $fields);
// GridField for managing page specific fields
$config = GridFieldConfig_RelationEditor::create();
$config->getComponentByType('GridFieldPaginator')->setItemsPerPage(10);
$config->removeComponentsByType('GridFieldAddNewButton');
$config->removeComponentsByType('GridFieldEditButton');
$config->getComponentByType('GridFieldDataColumns')->setDisplayFields(['Name' => _t('ConfigurablePage.NAME', 'Name'), 'Title' => _t('ConfigurablePage.TITLE', 'Title'), 'Sort' => _t('ConfigurablePage.SORT', 'Sort'), 'Group' => _t('ConfigurablePage.GROUP', 'Group')]);
$config->addComponent(new GridFieldEditableManyManyExtraColumns(['Sort' => 'Int']), 'GridFieldEditButton');
$config->getComponentByType('GridFieldDataColumns')->setFieldFormatting(['Group' => function ($value) {
return !$value ? '' : $this->EditableFieldGroup()->Title;
}]);
$fieldsField = new GridField('Fields', 'Fields', $list, $config);
// Drop-down list of editable field groups
$groups = EditableFieldGroup::get()->map();
$groups->unshift('', '');
$groupsField = new DropdownField("EditableFieldGroupID", _t('ConfigurablePage.FIELDGROUP', 'Editable field group'), $groups);
$groupsField->setDescription(_t('ConfigurablePage.FIELDGROUP_HELP', 'Select a group to load its collection of fields in the current page. ' . 'You need to click save to update the page fields.'));
// Add fields to manage page fields tab
$fields->addFieldToTab('Root.ManagePageFields', $groupsField);
$fields->addFieldToTab('Root.ManagePageFields', $fieldsField);
// JS & CSS for the gridfield sort column
Requirements::javascript('configurablepage/javascript/ConfigurablePage.js');
Requirements::css('configurablepage/css/ConfigurablePage.css');
return $fields;
}
示例4: getCMSFields
public function getCMSFields()
{
$locationDropDown = new DropdownField('LocationID', 'Choose Location', $this->getLocationOptions());
$locationDropDown->setEmptyString('(Select Location)');
$locationDropDown->setDescription('Create new Locations in Model Admin');
$fields = parent::getCMSFields();
$fields->push($locationDropDown);
return $fields;
}
示例5: getCMSFields
/**
* @dod why singleton('CodeBlock')->dbObject('Status')->enumValues() instead of $this->Status?
* @return FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new HeaderField('CodeBlockHead', 'Code Block Administration'));
$fields->addFieldToTab('Root.Main', new LiteralField('CodeBlockIntro', '<p>"CodeBlocks" are containers of arbitary HTML, text or javascript that can be "embedded" in page content via each page\'s WYSIWYG editor.</p>'));
$fields->addFieldToTab('Root.Main', new TextField('Name'));
$fields->addFieldToTab('Root.Main', new TextareaField('Content'));
$fields->addFieldToTab('Root.Main', $statusField = new DropdownField("Status", "Status", $this->dbObject('Status')->enumValues()));
$statusField->setDescription('<strong>Note:</strong> This only controls the appearance of this code-block within the editor itself.');
return $fields;
}
示例6: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
//$fields->addFieldToTab('Root.Main', new TextField('Location'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('Subtitle'), 'Content');
$fields->addFieldToTab('Root.Main', new TextareaField('Excerpt'), 'Content');
$dateField = new DateField('Date');
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'dd.MM.YYYY');
$fields->addFieldToTab('Root.Main', $dateField, 'Content');
$locationDropDown = new DropdownField('LocationID', 'Choose Location', $this->getLocationOptions());
$locationDropDown->setEmptyString('(Select Location)');
$locationDropDown->setDescription('Create new Locations in Model Admin');
$fields->addFieldToTab('Root.Main', $locationDropDown, 'Content');
return $fields;
}
示例7: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$languageField = new DropdownField('Language', 'Language', array('af' => 'Afrikaans', 'sq' => 'Albanian', 'eu' => 'Basque', 'be' => 'Belarusian', 'bg' => 'Bulgarian', 'ca' => 'Catalan', 'zh-cn' => 'Chinese (Simplified)', 'zh-tw' => 'Chinese (Traditional)', 'hr' => 'Croatian', 'cs' => 'Czech', 'da' => 'Danish', 'nl' => 'Dutch', 'nl-be' => 'Dutch (Belgium)', 'nl-nl' => 'Dutch (Netherlands)', 'en' => 'English', 'en-au' => 'English (Australia)', 'en-bz' => 'English (Belize)', 'en-ca' => 'English (Canada)', 'en-ie' => 'English (Ireland)', 'en-jm' => 'English (Jamaica)', 'en-nz' => 'English (New Zealand)', 'en-ph' => 'English (Phillipines)', 'en-za' => 'English (South Africa)', 'en-tt' => 'English (Trinidad)', 'en-gb' => 'English (United Kingdom)', 'en-us' => 'English (United States)', 'en-zw' => 'English (Zimbabwe)', 'et' => 'Estonian', 'fo' => 'Faeroese', 'fi' => 'Finnish', 'fr' => 'French', 'fr-be' => 'French (Belgium)', 'fr-ca' => 'French (Canada)', 'fr-fr' => 'French (France)', 'fr-lu' => 'French (Luxembourg)', 'fr-mc' => 'French (Monaco)', 'fr-ch' => 'French (Switzerland)', 'gl' => 'Galician', 'gd' => 'Gaelic', 'de' => 'German', 'de-at' => 'German (Austria)', 'de-de' => 'German (Germany)', 'de-li' => 'German (Liechtenstein)', 'de-lu' => 'German (Luxembourg)', 'de-ch' => 'German (Switzerland)', 'el' => 'Greek', 'haw' => 'Hawaiian', 'hu' => 'Hungarian', 'is' => 'Icelandic', 'in' => 'Indonesian', 'ga' => 'Irish', 'it' => 'Italian', 'it-it' => 'Italian (Italy)', 'it-ch' => 'Italian (Switzerland)', 'ja' => 'Japanese', 'ko' => 'Korean', 'mk' => 'Macedonian', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'pt-br' => 'Portuguese (Brazil)', 'pt-pt' => 'Portuguese (Portugal)', 'ro' => 'Romanian', 'ro-mo' => 'Romanian (Moldova)', 'ro-ro' => 'Romanian (Romania)', 'ru' => 'Russian', 'ru-mo' => 'Russian (Moldova)', 'ru-ru' => 'Russian (Russia)', 'sr' => 'Serbian', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'es' => 'Spanish', 'es-ar' => 'Spanish (Argentina)', 'es-bo' => 'Spanish (Bolivia)', 'es-cl' => 'Spanish (Chile)', 'es-co' => 'Spanish (Colombia)', 'es-cr' => 'Spanish (Costa Rica)', 'es-do' => 'Spanish (Dominican Republic)', 'es-ec' => 'Spanish (Ecuador)', 'es-sv' => 'Spanish (El Salvador)', 'es-gt' => 'Spanish (Guatemala)', 'es-hn' => 'Spanish (Honduras)', 'es-mx' => 'Spanish (Mexico)', 'es-ni' => 'Spanish (Nicaragua)', 'es-pa' => 'Spanish (Panama)', 'es-py' => 'Spanish (Paraguay)', 'es-pe' => 'Spanish (Peru)', 'es-pr' => 'Spanish (Puerto Rico)', 'es-es' => 'Spanish (Spain)', 'es-uy' => 'Spanish (Uruguay)', 'es-ve' => 'Spanish (Venezuela)', 'sv' => 'Swedish', 'sv-fi' => 'Swedish (Finland)', 'sv-se' => 'Swedish (Sweden)', 'tr' => 'Turkish', 'uk' => 'Ukranian'));
$languageField->setHasEmptyDefault(true)->setEmptyString('Select Language');
$podcastImage = new UploadField('PodcastImage', 'Podcast Image');
$podcastImage->setFolderName('podcast/podcast-artwork')->setDescription("iTunes recommends a size of at least 1400x1400")->getValidator()->setAllowedExtensions(array('jpg', 'png'));
$completeField = new CheckboxField('Complete');
$completeField->setDescription('This podcast is complete. No more episodes will be added to the podcast.');
$blockField = new CheckboxField('Block');
$blockField->setDescription('Prevent the <strong>entire</strong> podcast from appearing in the iTunes podcast directory.');
$explicitField = new DropdownField('Explicit', 'Explicit', $this->dbObject('Explicit')->enumValues());
$explicitField->setDescription("Displays an 'Explicit', 'Clean' or no parental advisory graphic next to your podcast artwork in iTunes.");
$fields->addFieldsToTab('Root.Podcast', array(new TextField('PodcastTitle', 'Podcast Title'), new TextField('Subtitle'), $languageField, new TextField('Author'), new TextAreaField('Summary'), new TextField('OwnerName', 'Owner Name'), new EmailField('OwnerEmail', 'Owner Email'), new TextField('Copyright'), $completeField, $blockField, $explicitField, new TextAreaField('Keywords'), $podcastImage));
$config = GridFieldConfig_RelationEditor::create();
$episodesTable = new GridField('PodcastEpisodes', 'Podcast Episodes', $this->PodcastEpisodes()->sort('EpisodeDate', 'DESC'), $config);
$fields->addFieldToTab('Root.Episodes', $episodesTable);
return $fields;
}
示例8: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
// Build albums tab
$fields->addFieldToTab('Root', $albumTab = new Tab('Albums'), 'Main');
$albumTab->setTitle(_t('MagnificGalleryPage.ALBUMS', 'Albums'));
if ($rootFolder = $this->RootFolder()) {
$albumConfig = GridFieldConfig_RecordEditor::create();
// Enable bulk image loading if necessary module is installed
// @see composer.json/suggests
if (class_exists('GridFieldBulkManager')) {
$albumConfig->addComponent(new GridFieldBulkManager());
}
// Enable album sorting if necessary module is installed
// @see composer.json/suggests
if (class_exists('GridFieldSortableRows')) {
$albumConfig->addComponent(new GridFieldSortableRows('SortOrder'));
} else {
if (class_exists('GridFieldOrderableRows')) {
$albumConfig->addComponent(new GridFieldOrderableRows('SortOrder'));
}
}
$albumField = new GridField('Albums', 'Albums', $this->Albums(), $albumConfig);
$fields->addFieldToTab("Root.Albums", $albumField);
} else {
$fields->addFieldToTab("Root.Albums", new HeaderField(_t("MagnificGalleryPage.ALBUMSNOTSAVED", "You may add albums to your gallery once you have saved the page for the first time."), $headingLevel = "3"));
}
// Build configuration fields
$fields->addFieldToTab('Root', $configTab = new Tab('Configuration'));
$configTab->setTitle(_t('MagnificGalleryPage.CONFIGURATION', 'Configuration'));
$fields->addFieldsToTab("Root.Configuration", array($albumEffects = new DropdownField('AlbumEffect', _t('MagnificGalleryPage.ALBUMEFFECT', 'Album Effect'), array_combine(self::listEffects(), self::listEffects())), new NumericField('MediaPerPage', _t('MagnificGalleryPage.IMAGESPERPAGE', 'Number of images per page')), new LiteralField('FolderUsed', '<div class="message">' . _t('MagnificGalleryPage.FOLDERUSED', 'Images will be saved in : %s', array($this->RootFolder()->Filename)) . '</div>')));
$albumEffects->setDescription(_t('MagnificGalleryPage.PREVIEWPAGE', 'Preview effects <a target="_blank" href="http://tympanus.net/Development/HoverEffectIdeas/">here</a>'));
return $fields;
}