本文整理汇总了PHP中FieldList::addFieldsToTab方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldList::addFieldsToTab方法的具体用法?PHP FieldList::addFieldsToTab怎么用?PHP FieldList::addFieldsToTab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldList
的用法示例。
在下文中一共展示了FieldList::addFieldsToTab方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateCMSFields
/**
* @param FieldList $fields
*/
public function updateCMSFields(FieldList $fields)
{
/** =========================================
* @var TextareaField $address
* @var TextareaField $postalAddress
* @var TextField $mailChimpAPI
* @var TextareaField $mailChimpSuccessMessage
===========================================*/
if (!$fields->fieldByName('Root.Settings')) {
$fields->addFieldToTab('Root', TabSet::create('Settings'));
}
/** -----------------------------------------
* Details
* ----------------------------------------*/
$address = TextareaField::create('Address', 'Address');
$address->setRows(8);
$postalAddress = TextareaField::create('PostalAddress', 'Postal Address');
$postalAddress->setRows(8);
$fields->findOrMakeTab('Root.Settings.Details');
$fields->addFieldsToTab('Root.Settings.Details', array(HeaderField::create('', 'Company Details'), Textfield::create('Phone', 'Phone Number'), Textfield::create('Email', 'Public Email Address'), $address, $postalAddress, TextField::create('Facebook', 'Facebook'), TextField::create('LinkedIn', 'LinkedIn'), TextField::create('Pinterest', 'Pinterest'), TextField::create('TwitterHandle', 'Twitter Handle')));
/** -----------------------------------------
* Subscription
* ----------------------------------------*/
$mailChimpAPI = TextField::create('MailChimpAPI', 'API Key');
$mailChimpSuccessMessage = TextareaField::create('MailChimpSuccessMessage', 'Success Message (optional)');
$mailChimpAPI->setRightTitle('<a href="https://us9.admin.mailchimp.com/account/api-key-popup/" target="_blank"><i>How do I get my MailChimp API Key?</i></a>');
$mailChimpSuccessMessage->setRows(2)->setRightTitle('Message displayed when a user has successfully subscribed to a list.');
$fields->findOrMakeTab('Root.Settings.Subscription', 'Subscription');
$fields->addFieldsToTab('Root.Settings.Subscription', array(HeaderField::create('', 'Newsletter Subscription'), LiteralField::create('', '<p>The API key, and list ID are necessary for the Newsletter Subscription form to function.</p>'), $mailChimpAPI, TextField::create('MailChimpListID', 'List ID'), $mailChimpSuccessMessage));
}
示例2: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
/* -----------------------------------------
* Color Picker
------------------------------------------*/
Requirements::css('boilerplate/css/colorpicker.css');
Requirements::javascript('boilerplate/javascript/colorpicker.min.js');
Requirements::javascript('boilerplate/javascript/colorpicker.init.js');
/* =========================================
* Settings
=========================================*/
if (!$fields->fieldByName('Root.Settings')) {
$fields->addFieldToTab('Root', new TabSet('Settings'));
}
/* -----------------------------------------
* Images
------------------------------------------*/
$fields->findOrMakeTab('Root.Settings.Images', 'Images');
$fields->addFieldsToTab('Root.Settings.Images', array($logo = new UploadField('LogoImage', _t('BoilerplateConfig.LogoImageLabel', 'Logo')), $favicon = new UploadField('Favicon', _t('BoilerplateConfig.FaviconLabel', 'Favicon'))));
$logo->setRightTitle('Choose an Image For Your Logo');
$favicon->setRightTitle('Choose an Image For Your Favicon (16x16)');
/* -----------------------------------------
* Company Details
------------------------------------------*/
$fields->findOrMakeTab('Root.Settings.Details', 'Details');
$fields->addFieldsToTab('Root.Settings.Details', array(new Textfield('Phone', _t('BoilerplateConfig.PhoneLabel', 'Phone Number')), new Textfield('Email', _t('BoilerplateConfig.EmailLabel', 'Public Email Address')), $PhysicalAddress = new HtmlEditorField('PhysicalAddress', _t('BoilerplateConfig.PhysicalAddressLabel', 'Physical Address'))));
$PhysicalAddress->setRows(3);
/* -----------------------------------------
* Tracking Code
------------------------------------------*/
$fields->findOrMakeTab('Root.Settings.TrackingCode', 'Tracking Code');
$fields->addFieldsToTab('Root.Settings.TrackingCode', array($trackingCode = new TextareaField('TrackingCode', _t('BoilerplateConfig.TrackingCodeLabel', 'Tracking Code'))));
$trackingCode->setRows(20);
}
示例3: getEditForm
public function getEditForm($id = null, $fields = null)
{
// TODO Duplicate record fetching (see parent implementation)
if (!$id) {
$id = $this->currentPageID();
}
$form = parent::getEditForm($id);
// TODO Duplicate record fetching (see parent implementation)
$record = $this->getRecord($id);
if ($record && !$record->canView()) {
return Security::permissionFailure($this);
}
$memberList = GridField::create('Members', false, Member::get(), $memberListConfig = GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldButtonRow('after'))->addComponent(new GridFieldExportButton('buttons-after-left')))->addExtraClass("members_grid");
if ($record && method_exists($record, 'getValidator')) {
$validator = $record->getValidator();
} else {
$validator = Injector::inst()->get('Member')->getValidator();
}
$memberListConfig->getComponentByType('GridFieldDetailForm')->setValidator($validator);
$groupList = GridField::create('Groups', false, Group::get(), GridFieldConfig_RecordEditor::create());
$columns = $groupList->getConfig()->getComponentByType('GridFieldDataColumns');
$columns->setDisplayFields(array('Breadcrumbs' => singleton('Group')->fieldLabel('Title')));
$columns->setFieldFormatting(array('Breadcrumbs' => function ($val, $item) {
return Convert::raw2xml($item->getBreadcrumbs(' > '));
}));
$fields = new FieldList($root = new TabSet('Root', $usersTab = new Tab('Users', _t('SecurityAdmin.Users', 'Users'), $memberList, new LiteralField('MembersCautionText', sprintf('<p class="caution-remove"><strong>%s</strong></p>', _t('SecurityAdmin.MemberListCaution', 'Caution: Removing members from this list will remove them from all groups and the' . ' database')))), $groupsTab = new Tab('Groups', singleton('Group')->i18n_plural_name(), $groupList)), new HiddenField('ID', false, 0));
// Add import capabilities. Limit to admin since the import logic can affect assigned permissions
if (Permission::check('ADMIN')) {
$fields->addFieldsToTab('Root.Users', array(new HeaderField(_t('SecurityAdmin.IMPORTUSERS', 'Import users'), 3), new LiteralField('MemberImportFormIframe', sprintf('<iframe src="%s" id="MemberImportFormIframe" width="100%%" height="250px" frameBorder="0">' . '</iframe>', $this->Link('memberimport')))));
$fields->addFieldsToTab('Root.Groups', array(new HeaderField(_t('SecurityAdmin.IMPORTGROUPS', 'Import groups'), 3), new LiteralField('GroupImportFormIframe', sprintf('<iframe src="%s" id="GroupImportFormIframe" width="100%%" height="250px" frameBorder="0">' . '</iframe>', $this->Link('groupimport')))));
}
// Tab nav in CMS is rendered through separate template
$root->setTemplate('CMSTabSet');
// Add roles editing interface
if (Permission::check('APPLY_ROLES')) {
$rolesField = GridField::create('Roles', false, PermissionRole::get(), GridFieldConfig_RecordEditor::create());
$rolesTab = $fields->findOrMakeTab('Root.Roles', _t('SecurityAdmin.TABROLES', 'Roles'));
$rolesTab->push($rolesField);
}
$actionParam = $this->getRequest()->param('Action');
if ($actionParam == 'groups') {
$groupsTab->addExtraClass('ui-state-active');
} elseif ($actionParam == 'users') {
$usersTab->addExtraClass('ui-state-active');
} elseif ($actionParam == 'roles') {
$rolesTab->addExtraClass('ui-state-active');
}
$actions = new FieldList();
$form = Form::create($this, 'EditForm', $fields, $actions)->setHTMLID('Form_EditForm');
$form->addExtraClass('cms-edit-form');
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
// Tab nav in CMS is rendered through separate template
if ($form->Fields()->hasTabset()) {
$form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
}
$form->addExtraClass('center ss-tabset cms-tabset ' . $this->BaseCSSClasses());
$form->setAttribute('data-pjax-fragment', 'CurrentForm');
$this->extend('updateEditForm', $form);
return $form;
}
示例4: updateCMSFields
/**
* @param FieldList $fields
*/
public function updateCMSFields(FieldList $fields)
{
Requirements::add_i18n_javascript(ADVANCED_WORKFLOW_DIR . '/javascript/lang');
// Add timepicker functionality
// @see https://github.com/trentrichardson/jQuery-Timepicker-Addon
Requirements::css(ADVANCED_WORKFLOW_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-timepicker-addon.css');
Requirements::css(ADVANCED_WORKFLOW_DIR . '/css/WorkflowCMS.css');
Requirements::javascript(ADVANCED_WORKFLOW_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-sliderAccess.js');
Requirements::javascript(ADVANCED_WORKFLOW_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-timepicker-addon.js');
Requirements::javascript(ADVANCED_WORKFLOW_DIR . '/javascript/WorkflowField.js');
$this->setIsWorkflowInEffect();
$fields->findOrMakeTab('Root.PublishingSchedule', _t('WorkflowEmbargoExpiryExtension.TabTitle', 'Publishing Schedule'));
if ($this->getIsWorkflowInEffect()) {
$fields->addFieldsToTab('Root.PublishingSchedule', array(HeaderField::create('PublishDateHeader', _t('WorkflowEmbargoExpiryExtension.REQUESTED_PUBLISH_DATE_H3', 'Expiry and Embargo'), 3), LiteralField::create('PublishDateIntro', $this->getIntroMessage('PublishDateIntro')), $dt = Datetimefield::create('DesiredPublishDate', _t('WorkflowEmbargoExpiryExtension.REQUESTED_PUBLISH_DATE', 'Requested publish date')), $ut = Datetimefield::create('DesiredUnPublishDate', _t('WorkflowEmbargoExpiryExtension.REQUESTED_UNPUBLISH_DATE', 'Requested un-publish date')), Datetimefield::create('PublishOnDate', _t('WorkflowEmbargoExpiryExtension.PUBLISH_ON', 'Scheduled publish date'))->setDisabled(true), Datetimefield::create('UnPublishOnDate', _t('WorkflowEmbargoExpiryExtension.UNPUBLISH_ON', 'Scheduled un-publish date'))->setDisabled(true)));
} else {
$fields->addFieldsToTab('Root.PublishingSchedule', array(HeaderField::create('PublishDateHeader', _t('WorkflowEmbargoExpiryExtension.REQUESTED_PUBLISH_DATE_H3', 'Expiry and Embargo'), 3), LiteralField::create('PublishDateIntro', $this->getIntroMessage('PublishDateIntro')), $dt = Datetimefield::create('PublishOnDate', _t('WorkflowEmbargoExpiryExtension.PUBLISH_ON', 'Scheduled publish date')), $ut = Datetimefield::create('UnPublishOnDate', _t('WorkflowEmbargoExpiryExtension.UNPUBLISH_ON', 'Scheduled un-publish date'))));
}
$dt->getDateField()->setConfig('showcalendar', true);
$ut->getDateField()->setConfig('showcalendar', true);
$dt->getTimeField()->setConfig('timeformat', 'HH:mm:ss');
$ut->getTimeField()->setConfig('timeformat', 'HH:mm:ss');
// Enable a jQuery-UI timepicker widget
if (self::$showTimePicker) {
$dt->getTimeField()->addExtraClass('hasTimePicker');
$ut->getTimeField()->addExtraClass('hasTimePicker');
}
}
示例5: updateCMSFields
/**
* updateCMSFields.
* Update Silverstripe CMS Fields for SEO Module
*
* @param FieldList
* @return none
*/
public function updateCMSFields(FieldList $fields)
{
// exclude SEO tab from some pages
if (in_array($this->owner->getClassName(), Config::inst()->get("SeoObjectExtension", "excluded_page_types"))) {
return;
}
Requirements::css(SEO_DIR . '/css/seo.css');
Requirements::javascript(SEO_DIR . '/javascript/seo.js');
// better do this below in some init method? :
$this->getSEOScoreCalculation();
$this->setSEOScoreTipsUL();
// lets create a new tab on top
$fields->addFieldsToTab('Root.SEO', array(LiteralField::create('googlesearchsnippetintro', '<h3>' . _t('SEO.SEOGoogleSearchPreviewTitle', 'Preview google search') . '</h3>'), LiteralField::create('googlesearchsnippet', '<div id="google_search_snippet"></div>'), LiteralField::create('siteconfigtitle', '<div id="ss_siteconfig_title">' . $this->owner->getSiteConfig()->Title . '</div>')));
// move Metadata field from Root.Main to SEO tab for visualising direct impact on search result
$fields->removeFieldFromTab('Root.Main', 'Metadata');
/*$fields->addFieldToTab("Root.SEO", new TabSet('Options',
new Tab('Metadata', _t('SEO.SEOMetaData', 'Meta Data')),
new Tab('HelpAndSEOScore', _t('SEO.SEOHelpAndScore', 'Help and SEO Score'))
));*/
$fields->addFieldsToTab('Root.SEO', array(TextareaField::create("MetaDescription", $this->owner->fieldLabel('MetaDescription'))->setRightTitle(_t('SiteTree.METADESCHELP', "Search engines use this content for displaying search results (although it will not influence their ranking)."))->addExtraClass('help'), TextareaField::create("ExtraMeta", $this->owner->fieldLabel('ExtraMeta'))->setRightTitle(_t('SiteTree.METAEXTRAHELP', "HTML tags for additional meta information. For example <meta name=\"customName\" content=\"your custom content here\" />"))->addExtraClass('help')));
$fields->addFieldsToTab('Root.SEO', array(GoogleSuggestField::create("SEOPageSubject", _t('SEO.SEOPageSubjectTitle', 'Subject of this page (required to view this page SEO score)')), LiteralField::create('', '<div class="message notice"><p>' . _t('SEO.SEOSaveNotice', "After making changes save this page to view the updated SEO score") . '</p></div>'), LiteralField::create('ScoreTitle', '<h4 class="seo_score">' . _t('SEO.SEOScore', 'SEO Score') . '</h4>'), LiteralField::create('Score', $this->getHTMLStars()), LiteralField::create('ScoreClear', '<div class="score_clear"></div>')));
if ($this->checkPageSubjectDefined()) {
$fields->addFieldsToTab('Root.SEO', array(LiteralField::create('SimplePageSubjectCheckValues', $this->getHTMLSimplePageSubjectTest())));
}
if ($this->seo_score < 12) {
$fields->addFieldsToTab('Root.SEO', array(LiteralField::create('ScoreTipsTitle', '<h4 class="seo_score">' . _t('SEO.SEOScoreTips', 'SEO Score Tips') . '</h4>'), LiteralField::create('ScoreTips', $this->seo_score_tips)));
}
}
示例6: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
// vars
$config = SiteConfig::current_site_config();
$owner = $this->owner;
// decode data into array
$data = json_decode($owner->OpenGraphData, true);
// @todo Add repair method if data is missing / corrupt ~ for fringe cases
// tab
$tab = new Tab('OpenGraph');
// add disabled/error state if `off`
if ($data['og:type'] === 'off') {
$tab->addExtraClass('error');
}
// add the tab
$fields->addFieldToTab('Root.Metadata', $tab, 'FullOutput');
// new identity
$tab = 'Root.Metadata.OpenGraph';
// add description
// type always visible
$fields->addFieldsToTab($tab, array(LabelField::create('OpenGraphHeader', '@todo Information</a>')->addExtraClass('information'), DropdownField::create('OpenGraphType', '<a href="http://ogp.me/#types">og:type</a>', self::$types, $data['og:type'])));
if ($data['og:type'] !== 'off') {
$fields->addFieldsToTab($tab, array(ReadonlyField::create('OpenGraphURL', 'Canonical URL', $owner->AbsoluteLink()), TextField::create('OpenGraphSiteName', 'Site Name', $data['og:site_name'])->setAttribute('placeholder', $config->Title), TextField::create('OpenGraphTitle', 'Page Title', $data['og:title'])->setAttribute('placeholder', $owner->Title), TextareaField::create('OpenGraphDescription', 'Description', $data['og:description'])->setAttribute('placeholder', $owner->GenerateDescription()), UploadField::create('OpenGraphImage', 'Image<pre>type: png/jpg/gif</pre><pre>size: variable *</pre>', $owner->OpenGraphImage)->setAllowedExtensions(array('png', 'jpg', 'jpeg', 'gif'))->setFolderName(self::$SEOOpenGraphUpload . $owner->Title)->setDescription('* <a href="https://developers.facebook.com/docs/sharing/best-practices#images" target="_blank">Facebook image best practices</a>, or use any preferred Open Graph guide.')));
}
}
开发者ID:graphiques-digitale,项目名称:silverstripe-seo-open-graph,代码行数:25,代码来源:SEO_OpenGraph_SiteTree_DataExtension.php
示例7: 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
示例8: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$redirectUrl = HailProvider::getRedirectUri();
$redirectField = new ReadonlyField('RedirectURL', 'Redirect URL', $redirectUrl);
// Twitter setup
$fields->addFieldsToTab('Root.Hail', array(new TextField('HailClientID', 'Client ID', null, 255), new TextField('HailClientSecret', 'Client Secret', null, 255), $redirectField));
$siteconfig = SiteConfig::current_site_config();
if (HailProvider::isReadyToAuthorised()) {
$provider = new HailProvider();
$link = HailProvider::isAuthorised() ? 'Reauthorise SilverStripe to Access Hail' : 'Authorise SilverStripe to Access Hail';
$auth = $provider->getAuthorizationUrl();
$fields->addFieldsToTab('Root.Hail', new LiteralField('Go', "<a href='{$auth}'>{$link}</a>"));
}
try {
if (HailProvider::isAuthorised()) {
$orgs = HailApi::getOrganisationList();
$orgs[''] = '';
$orgField = DropdownField::create('HailOrgID', 'Hail Organisation', $orgs);
$fields->addFieldsToTab('Root.Hail', $orgField);
}
} catch (HailApiException $ex) {
$fields->addFieldsToTab('Root.Hail', new LiteralField('Retry', 'You Have to Re-Authorise SilverStripe to Access Hail'));
}
$holderField = DropdownField::create('PrimaryHailHolderID', 'Primary Hail Holder', HailHolder::get()->map('ID', 'Title'));
$holderField->setEmptyString('(None)');
$fields->addFieldsToTab('Root.Hail', $holderField);
}
示例9: getCMSFields
function getCMSFields()
{
$CountryCodes = CountryCodes::$iso_3166_countryCodes;
$CountryCodes['Worldwide'] = 'Worldwide';
$CountryCodes['Prefer not to say'] = 'Prefer not to say';
$CountryCodes['Too many to list'] = 'Too many to list';
$fields = new FieldList($rootTab = new TabSet("Root"));
$fields->addFieldsToTab('Root.Main', array(new LiteralField('Break', '<p>Each deployment profile can be marked public if you wish for the basic information on this page to appear on openstack.org. If you select private we will treat all of the profile information as confidential information.</p>'), new OptionSetField('IsPublic', 'Would you like to keep this information confidential or allow the Foundation to share information about this deployment publicly?', array('1' => '<strong>Willing to share:</strong> The information on this page may be shared for this deployment', '0' => '<strong>Confidential:</strong> All details provided should be kept confidential to the OpenStack Foundation'), 0), new LiteralField('Break', '<hr/>'), new TextField('Label', 'Deployment Name<BR><p class="clean_text">Please create a friendly label, like “Production OpenStack Deployment”. This name is for your deployment in our survey tool. If several people at your organization work on one deployment, we would <b>really appreciate</b> you all referring to the same deployment by the same name!</p>'), $ddl_stage = new DropdownField('DeploymentStage', 'In what stage is your OpenStack deployment? (make a new deployment profile for each type of deployment)', DeploymentOptions::$stage_options), new MultiDropdownField('CountriesPhysicalLocation', 'In which country / countries is this OpenStack deployment physically located?', $CountryCodes), new MultiDropdownField('CountriesUsersLocation', 'In which country / countries are the users / customers for this deployment physically located?', $CountryCodes), $ddl_type = new DropdownField('DeploymentType', 'Deployment Type', DeploymentOptions::$deployment_type_options), new CustomCheckboxSetField('ProjectsUsed', 'Projects Used', DeploymentOptions::$projects_used_options), new CustomCheckboxSetField('CurrentReleases', 'What releases are you currently using?', DeploymentOptions::$current_release_options), new LiteralField('Break', 'Describe the workloads and frameworks running in this OpenStack environment.<BR>Select All That Apply'), new LiteralField('Break', '<hr/>'), new CustomCheckboxSetField('ServicesDeploymentsWorkloads', '<b>Services Deployments - workloads designed to be accessible for external users / customers</b>', DeploymentOptions::$services_deployment_workloads_options), $other_service_workload = new TextAreaField('OtherServicesDeploymentsWorkloads', ''), new CustomCheckboxSetField('EnterpriseDeploymentsWorkloads', '<b>Enterprise Deployments - workloads designed to be run internally to support business</b>', DeploymentOptions::$enterprise_deployment_workloads_options), $other_enterprise_workload = new TextAreaField('OtherEnterpriseDeploymentsWorkloads', ''), new CustomCheckboxSetField('HorizontalWorkloadFrameworks', '<b>Horizontal Workload Frameworks</b>', DeploymentOptions::$horizontal_workload_framework_options), $other_horizontal_workload = new TextAreaField('OtherHorizontalWorkloadFrameworks', '')));
$ddl_type->setEmptyString('-- Select One --');
$ddl_stage->setEmptyString('-- Select One --');
$details = array(new LiteralField('Break', '<p>The information below will help us better understand the most common configuration and component choices OpenStack deployments are using.</p>'), new LiteralField('Break', '<h3>Telemetry</h3>'), new LiteralField('Break', '<hr/>'), new LiteralField('Break', '<p>Please provide the following information about the size and scale of this OpenStack deployment. This information is optional, but will be kept confidential and <b>never</b> published in connection with you or your organization.</p>'), new DropdownField('OperatingSystems', 'What is the main operating system running this OpenStack cloud deployment?', ArrayUtils::AlphaSort(DeploymentOptions::$operating_systems_options, array('' => '-- Select One --'), array('Other' => 'Other (please specify)'))), $other_os = new TextareaField('OtherOperatingSystems', ''), new CustomCheckboxSetField('UsedPackages', 'What packages does this deployment use…?<BR>Select All That Apply', DeploymentOptions::$used_packages_options), new CustomCheckboxSetField('CustomPackagesReason', 'If you have modified packages or have built your own packages, why?<BR>Select All That Apply', DeploymentOptions::$custom_package_reason_options), $other_custom_reason = new TextareaField('OtherCustomPackagesReason', ''), new CustomCheckboxSetField('DeploymentTools', 'What tools are you using to deploy / configure this cluster?<BR>Select All That Apply', DeploymentOptions::$deployment_tools_options), $other_deployment_tools = new TextareaField('OtherDeploymentTools', ''), new CustomCheckboxSetField('PaasTools', 'What Platform-as-a-Service (PaaS) tools are you using to manage applications on this OpenStack deployment?', ArrayUtils::AlphaSort(DeploymentOptions::$paas_tools_options, array('' => '-- Select One --'), array('Other' => 'Other Tool (please specify)'))), $other_paas = new TextareaField('OtherPaasTools', ''), new CustomCheckboxSetField('Hypervisors', 'If this deployment uses <b>OpenStack Compute (Nova)</b>, which hypervisors are you using?<BR>Select All That Apply', DeploymentOptions::$hypervisors_options), new TextareaField('OtherHypervisor', ''), new CustomCheckboxSetField('SupportedFeatures', 'Which compatibility APIs does this deployment support?<BR> Select All That Apply', DeploymentOptions::$deployment_features_options), new TextareaField('OtherSupportedFeatures', ''), new CustomCheckboxSetField('UsedDBForOpenStackComponents', 'What database do you use for the components of this OpenStack cloud?<BR>Select All That Apply', DeploymentOptions::$used_db_for_openstack_components_options), new TextareaField('OtherUsedDBForOpenStackComponents', ''), new CustomCheckboxSetField('NetworkDrivers', ' If this deployment uses <b>OpenStack Network (Neutron)</b>, which drivers are you using?<BR>Select All That Apply', DeploymentOptions::$network_driver_options), new TextareaField('OtherNetworkDriver', ''), new CustomCheckboxSetField('IdentityDrivers', 'If you are using <b>OpenStack Identity Service (Keystone)</b> which OpenStack identity drivers are you using?<BR>Select All That Apply', DeploymentOptions::$identity_driver_options), new TextareaField('OtherIndentityDriver', ''), new CustomCheckboxSetField('BlockStorageDrivers', 'If this deployment uses <b>OpenStack Block Storage (Cinder)</b>, which drivers are <BR>Select All That Apply', DeploymentOptions::$block_storage_divers_options), new TextareaField('OtherBlockStorageDriver', ''), new CustomCheckboxSetField('InteractingClouds', 'With what other clouds does this OpenStack deployment interact?<BR>Select All That Apply', DeploymentOptions::$interacting_clouds_options), new TextareaField('OtherInteractingClouds', ''), $ddl_users = new DropdownField('NumCloudUsers', 'Number of users', DeploymentOptions::$cloud_users_options), $ddl_nodes = new DropdownField('ComputeNodes', 'Physical compute nodes', DeploymentOptions::$compute_nodes_options), $ddl_cores = new DropdownField('ComputeCores', 'Processor cores', DeploymentOptions::$compute_cores_options), $ddl_instances = new DropdownField('ComputeInstances', 'Number of instances', DeploymentOptions::$compute_instances_options), $ddl_ips = new DropdownField('NetworkNumIPs', 'Number of fixed / floating IPs', DeploymentOptions::$network_ip_options), $ddl_block_size = new DropdownField('BlockStorageTotalSize', 'If this deployment uses <b>OpenStack Block Storage (Cinder)</b>, what is the size of its block storage?', DeploymentOptions::$storage_size_options), $ddl_block_size = new DropdownField('ObjectStorageSize', 'If this deployment uses <b>OpenStack Object Storage (Swift)</b>, what is the size of its block storage?', DeploymentOptions::$storage_size_options), $ddl_objects_size = new DropdownField('ObjectStorageNumObjects', 'If this deployment uses <b>OpenStack Object Storage (Swift)</b>, how many total objects are stored?', DeploymentOptions::$storage_objects_options), new LiteralField('Break', '<h3>Spotlight</h3>'), new LiteralField('Break', '<hr/>'), new CustomCheckboxSetField('WhyNovaNetwork', 'If this deployment uses nova-network and not OpenStack Network (Neutron), what would allow you to migrate to Neutron?', DeploymentOptions::$why_nova_network_options), $other_why_nova = new TextareaField('OtherWhyNovaNetwork', ''), $ddl_swift_dist_feat = new DropdownField('SwiftGlobalDistributionFeatures', 'Are you using Swift\'s global distribution features?', DeploymentOptions::$swift_global_distribution_features_options), $ddl_uses_cases = new DropdownField('SwiftGlobalDistributionFeaturesUsesCases', 'If yes, what is your use case?', DeploymentOptions::$swift_global_distribution_features_uses_cases_options), $other_uses_cases = new TextareaField('OtherSwiftGlobalDistributionFeaturesUsesCases', ''), $ddl_policies = new DropdownField('Plans2UseSwiftStoragePolicies', 'Do you have plans to use Swift\'s storage policies or erasure codes in the next year?', DeploymentOptions::$plans_2_use_swift_storage_policies_options), new TextareaField('OtherPlans2UseSwiftStoragePolicies', ''), $ddl_other_tools = new DropdownField('ToolsUsedForYourUsers', 'What tools are you using charging or show-back for your users?', DeploymentOptions::$tools_used_for_your_users_options), $other_tools = new TextareaField('OtherToolsUsedForYourUsers', ''), new TextareaField('Reason2Move2Ceilometer', 'If you are not using Ceilometer, what would allow you to move to it (optional free text)?'));
$ddl_users->setEmptyString('-- Select One --');
$ddl_nodes->setEmptyString('-- Select One --');
$ddl_cores->setEmptyString('-- Select One --');
$ddl_instances->setEmptyString('-- Select One --');
$ddl_ips->setEmptyString('-- Select One --');
$ddl_block_size->setEmptyString('-- Select One --');
$ddl_block_size->setEmptyString('-- Select One --');
$ddl_objects_size->setEmptyString('-- Select One --');
$ddl_swift_dist_feat->setEmptyString('-- Select One --');
$ddl_uses_cases->setEmptyString('-- Select One --');
$ddl_policies->setEmptyString('-- Select One --');
$ddl_other_tools->setEmptyString('-- Select One --');
$fields->addFieldsToTab('Root.Details', $details);
return $fields;
}
示例10: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->removeByName('Theme');
$fields->addFieldsToTab('Root.Main', array(TextField::create('Email', 'Email Address')->setAttribute("placeholder", "email@domain.com"), TextField::create('Phone', 'Phone Number'), TextField::create('FreePhone', 'Free Phone Number'), TextField::create('Mobile', 'Mobile Number'), TextField::create('Fax', 'Fax Number'), TextField::create('FacebookURL', 'Facebook URL')->setAttribute("placeholder", "http://www.facebook.com"), TextField::create('TwitterURL', 'Twitter URL')->setAttribute("placeholder", "http://www.twitter.com"), TextField::create('PinterestURL', 'Pinterest URL')->setAttribute("placeholder", "http://www.pinterest.com"), TextField::create('InstagramURL', 'Instagram URL')->setAttribute("placeholder", "http://www.instagram.com"), TextField::create('LinkedInURL', 'LinkedIn URL')->setAttribute("placeholder", "http://www.linkedin.com"), TextField::create('YoutubeURL', 'Youtube URL')->setAttribute("placeholder", "http://www.youtube.com"), TextareaField::create('PostalAddress', 'Postal Address')->setRows(4), TextareaField::create('PhysicalAddress', 'Physical Address')->setRows(4)));
$fields->addFieldsToTab('Root.Plato', array(TextField::create('GoogleTagManager', 'Enter the Tag Manager ID')));
return $fields;
}
开发者ID:helpfulrobot,项目名称:plato-creative-plato-silverstripe-installer,代码行数:7,代码来源:CustomSiteConfig.php
示例11: updateCMSFields
public function updateCMSFields(\FieldList $oFields)
{
Folder::find_or_make('responsive-gallery');
$aGalleryImagesFields = array();
if ($this->owner->ID > 0) {
$oFields->addFieldsToTab('Root.' . _t('ResponsiveGalleryExtension.GALLERYIMAGES_TAB', 'Gallery Images'), $this->getFieldsForImagesTab());
$oFields->addFieldsToTab('Root.' . _t('ResponsiveGalleryExtension.GALLERYSETTINGS_TAB', 'Gallery Settings'), $this->getFieldsForSettingsTab());
}
}
示例12: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
// Remove framework default metadata group
$fields->removeByName(array('Metadata'));
// Add SEO
$fields->addFieldsToTab('Root.Metadata.SEO', $this->owner->getSEOFields());
// Add full output
$fields->addFieldsToTab('Root.Metadata.FullOutput', $this->owner->getFullOutput());
}
开发者ID:graphiques-digitale,项目名称:silverstripe-seo-metadata,代码行数:9,代码来源:SEO_Metadata_SiteTree_DataExtension.php
示例13: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
// variables
$config = SiteConfig::current_site_config();
$self = $this->owner;
// SSSEO Tabset
$fields->addFieldToTab('Root', new TabSet('SSSEO'));
// remove
$fields->removeByName(array('Metadata'));
//// Full Output
$tab = 'Root.SSSEO.FullOutput';
if ($self->hasExtension('SSSEO_SchemaDotOrg_SiteTree_DataExtension')) {
if ($head = $self->Metahead()) {
$fields->addFieldsToTab($tab, array(LiteralField::create('HeaderMetahead', '<pre class="bold">$Metahead()</pre>'), LiteralField::create('LiteralMetahead', '<pre><span style="background-color: white;">' . htmlentities($head) . '</span></pre>')));
}
}
$fields->addFieldsToTab($tab, array(LiteralField::create('HeaderMetadata', '<pre class="bold">$Metadata()</pre>'), LiteralField::create('LiteralMetadata', '<pre>' . nl2br(htmlentities(trim($self->Metadata()), ENT_QUOTES)) . '</pre>')));
//// Metadata
$tab = 'Root.SSSEO.Metadata';
// Canonical
if ($config->CanonicalEnabled()) {
$fields->addFieldsToTab($tab, array(ReadonlyField::create('ReadonlyMetaCanonical', 'link rel="canonical"', $self->AbsoluteLink())));
}
// Title
if ($config->TitleEnabled()) {
$fields->addFieldsToTab($tab, array(TextField::create('MetaTitle', 'meta title')->setAttribute('placeholder', $self->GenerateTitle())));
}
// Description
$fields->addFieldsToTab($tab, array(TextareaField::create('MetaDescription', 'meta description')->setAttribute('placeholder', $self->GenerateDescriptionFromContent())));
// ExtraMeta
if ($config->ExtraMetaEnabled()) {
$fields->addFieldsToTab($tab, array(TextareaField::create('ExtraMeta', 'Custom Metadata')));
}
//// Open Graph
if ($config->OpenGraphEnabled()) {
$tab = 'Root.SSSEO.OpenGraph';
$fields->addFieldsToTab($tab, array());
}
//// Twitter Cards
if ($config->TwitterCardsEnabled()) {
$tab = 'Root.SSSEO.TwitterCards';
$fields->addFieldsToTab($tab, array());
}
//// Schema.org
if ($config->SchemaDotOrgEnabled()) {
$tab = 'Root.SSSEO.SchemaDotOrg';
$fields->addFieldsToTab($tab, array());
}
//// Authorship
// Authors
if ($config->AuthorshipEnabled()) {
$tab = 'Root.SSSEO.Authors';
$fields->addFieldsToTab($tab, array(GridField::create('Authors', 'Authors', $self->Authors())->setConfig(GridFieldConfig_RelationEditor::create())));
}
}
示例14: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$tab = 'Root.SEO';
// Profile ID
$fields->addFieldsToTab($tab, array(TextField::create('FacebookProfileID', 'Facebook Profile ID'), TextField::create('GoogleProfileID', 'Google+ Profile ID')));
// Pages Authored
// remove
$fields->removeByName(array('Authored'));
// add
$fields->addFieldsToTab($tab, array(GridField::create('Authored', 'Pages Authored', $this->owner->Authored())->setConfig(GridFieldConfig_RelationEditor::create())));
}
开发者ID:Graphiques-Digitale,项目名称:silverstripe-seo-google-plus-authorship,代码行数:11,代码来源:SEO_Authorship_Member_DataExtension.php
示例15: updateCMSFields
/**
* @param FieldSet $fields
*/
public function updateCMSFields(FieldList $fields)
{
$fields->findOrMakeTab('Root.Schedule', _t('ScheduledExecution.ScheduleTabTitle', 'Schedule'));
$fields->addFieldsToTab('Root.Schedule', array($dt = new Datetimefield('FirstExecution', _t('ScheduledExecution.FIRST_EXECUTION', 'First Execution')), FieldGroup::create(new NumericField('ExecuteInterval', ''), new DropdownField('ExecuteEvery', '', array('' => '', 'Minute' => _t('ScheduledExecution.ExecuteEveryMinute', 'Minute'), 'Hour' => _t('ScheduledExecution.ExecuteEveryHour', 'Hour'), 'Day' => _t('ScheduledExecution.ExecuteEveryDay', 'Day'), 'Week' => _t('ScheduledExecution.ExecuteEveryWeek', 'Week'), 'Fortnight' => _t('ScheduledExecution.ExecuteEveryFortnight', 'Fortnight'), 'Month' => _t('ScheduledExecution.ExecuteEveryMonth', 'Month'), 'Year' => _t('ScheduledExecution.ExecuteEveryYear', 'Year'))))->setTitle(_t('ScheduledExecution.EXECUTE_EVERY', 'Execute every')), new TextField('ExecuteFree', _t('ScheduledExecution.EXECUTE_FREE', 'Scheduled (in strtotime format from first execution)'))));
if ($this->owner->ScheduledJobID) {
$jobTime = $this->owner->ScheduledJob()->StartAfter;
$fields->addFieldsToTab('Root.Schedule', array(new ReadonlyField('NextRunDate', _t('ScheduledExecution.NEXT_RUN_DATE', 'Next run date'), $jobTime)));
}
$dt->getDateField()->setConfig('showcalendar', true);
$dt->getTimeField()->setConfig('showdropdown', true);
}