本文整理汇总了PHP中TextareaField::create方法的典型用法代码示例。如果您正苦于以下问题:PHP TextareaField::create方法的具体用法?PHP TextareaField::create怎么用?PHP TextareaField::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextareaField
的用法示例。
在下文中一共展示了TextareaField::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($controller, $name, $order)
{
/* Store Settings Object */
$conf = StoreSettings::get_settings();
/* Comments Box, if enabled */
if ($conf->CheckoutSettings_OrderComments) {
$comments = TextareaField::create("CustomerComments", "Order Comments");
$comments->setRightTitle("These comments will be seen by staff.");
} else {
$comments = HiddenField::create("CustomerComments", "");
}
/* Terms and Conditions, if enabled */
if ($conf->CheckoutSettings_TermsAndConditions) {
$terms = CheckboxField::create("Terms", "I agree to " . $conf->StoreSettings_StoreName . "'s " . "<a href=" . DataObject::get_by_id("SiteTree", $conf->CheckoutSettings_TermsAndConditionsSiteTree)->URLSegment . ">" . "Terms & Conditions</a>.");
} else {
$terms = HiddenField::create("Terms", "");
}
/* Fields */
$fields = FieldList::create($comments, OptionsetField::create("PaymentMethod", "Payment Method", Gateway::create()->getGateways($order)), $terms ? HeaderField::create("Terms and Conditions", 5) : HiddenField::create("TermsHeaderField", ""), $terms);
/* Actions */
$actions = FieldList::create(FormAction::create('payment', 'Place Order & Continue to Payment'));
/* Required Fields */
$required = new RequiredFields(array("PaymentMethod", $terms ? "Terms" : null));
/*
* Now we create the actual form with our fields and actions defined
* within this class.
*/
return parent::__construct($controller, $name, $fields, $actions, $required);
}
示例2: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldsToTab("Root.Main", array(TextareaField::create('Content', 'Content'), UploadField::create('PreviewImage', 'Image')), 'Type');
$fields->addFieldsToTab("Root.Main", array(TextField::create('ReadMore', 'Read more')));
return $fields;
}
示例3: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldsToTab("Root.Main", array(OptionsetField::create('Status', 'Status', array("1" => "Active", "0" => "Disabled"), 1), TextField::create('AdminTitle')->setDescription('This field is for adminisration use only and will not display on the site.'), TextareaField::create('Title', 'Title')->setRows(2), HtmlEditorField::create('Content', 'Content')));
$this->extend('updateCMSFields', $fields);
return $fields;
}
示例4: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', TextField::create('FeaturedTitle', 'Featured Heading'), 'Content');
$fields->addFieldToTab('Root.Main', TextareaField::create('FeaturedContent', 'Featured Content'), 'Content');
return $fields;
}
示例5: getCMSFields
public function getCMSFields()
{
$fields = FieldList::create(TextField::create('Title'), TextField::create('Copyright'), TextareaField::create('Caption'), $imageField = UploadField::create('Attachment'));
$imageField->setAllowedFileCategories('image');
$imageField->setAllowedMaxFileNumber(1);
return $fields;
}
示例6: getCMSFields
/**
* @return FieldList
*/
public function getCMSFields()
{
// Get NotifiedOn implementors
$types = ClassInfo::implementorsOf('NotifiedOn');
$types = array_combine($types, $types);
unset($types['NotifyOnThis']);
if (!$types) {
$types = array();
}
array_unshift($types, '');
// Available keywords
$keywords = $this->getKeywords();
if (count($keywords)) {
$availableKeywords = '<div class="field"><div class="middleColumn"><p><u>Available Keywords:</u> </p><ul><li>$' . implode('</li><li>$', $keywords) . '</li></ul></div></div>';
} else {
$availableKeywords = "Available keywords will be shown if you select a NotifyOnClass";
}
// Identifiers
$identifiers = $this->config()->get('identifiers');
if (count($identifiers)) {
$identifiers = array_combine($identifiers, $identifiers);
}
$fields = FieldList::create();
$relevantMsg = 'Relevant for (note: this notification will only be sent if the context of raising the notification is of this type)';
$fields->push(TabSet::create('Root', Tab::create('Main', DropdownField::create('Identifier', _t('SystemNotification.IDENTIFIER', 'Identifier'), $identifiers), TextField::create('Title', _t('SystemNotification.TITLE', 'Title')), TextField::create('Description', _t('SystemNotification.DESCRIPTION', 'Description')), DropdownField::create('NotifyOnClass', _t('SystemNotification.NOTIFY_ON_CLASS', $relevantMsg), $types), TextField::create('CustomTemplate', _t('SystemNotification.TEMPLATE', 'Template (Optional)'))->setAttribute('placeholder', $this->config()->get('default_template')), LiteralField::create('AvailableKeywords', $availableKeywords))));
if ($this->config()->html_notifications) {
$fields->insertBefore(HTMLEditorField::create('NotificationHTML', _t('SystemNotification.TEXT', 'Text')), 'AvailableKeywords');
} else {
$fields->insertBefore(TextareaField::create('NotificationText', _t('SystemNotification.TEXT', 'Text')), 'AvailableKeywords');
}
return $fields;
}
示例7: 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));
}
示例8: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$subsites = DataObject::get('Subsite');
if (!$subsites) {
$subsites = new ArrayList();
} else {
$subsites = ArrayList::create($subsites->toArray());
}
$subsites->push(new ArrayData(array('Title' => 'Main site', 'ID' => 0)));
$fields->addFieldToTab('Root.Main', DropdownField::create("CopyContentFromID_SubsiteID", _t('SubsitesVirtualPage.SubsiteField', "Subsite"), $subsites->map('ID', 'Title'))->addExtraClass('subsitestreedropdownfield-chooser no-change-track'), 'CopyContentFromID');
// Setup the linking to the original page.
$pageSelectionField = new SubsitesTreeDropdownField("CopyContentFromID", _t('VirtualPage.CHOOSE', "Choose a page to link to"), "SiteTree", "ID", "MenuTitle");
if (Controller::has_curr() && Controller::curr()->getRequest()) {
$subsiteID = Controller::curr()->getRequest()->requestVar('CopyContentFromID_SubsiteID');
$pageSelectionField->setSubsiteID($subsiteID);
}
$fields->replaceField('CopyContentFromID', $pageSelectionField);
// Create links back to the original object in the CMS
if ($this->CopyContentFromID) {
$editLink = "admin/pages/edit/show/{$this->CopyContentFromID}/?SubsiteID=" . $this->CopyContentFrom()->SubsiteID;
$linkToContent = "\n\t\t\t\t<a class=\"cmsEditlink\" href=\"{$editLink}\">" . _t('VirtualPage.EDITCONTENT', 'Click here to edit the content') . "</a>";
$fields->removeByName("VirtualPageContentLinkLabel");
$fields->addFieldToTab("Root.Main", $linkToContentLabelField = new LabelField('VirtualPageContentLinkLabel', $linkToContent), 'Title');
$linkToContentLabelField->setAllowHTML(true);
}
$fields->addFieldToTab('Root.Main', TextField::create('CustomMetaTitle', $this->fieldLabel('CustomMetaTitle'))->setDescription(_t('SubsitesVirtualPage.OverrideNote', 'Overrides inherited value from the source')), 'MetaTitle');
$fields->addFieldToTab('Root.Main', TextareaField::create('CustomMetaKeywords', $this->fieldLabel('CustomMetaTitle'))->setDescription(_t('SubsitesVirtualPage.OverrideNote')), 'MetaKeywords');
$fields->addFieldToTab('Root.Main', TextareaField::create('CustomMetaDescription', $this->fieldLabel('CustomMetaTitle'))->setDescription(_t('SubsitesVirtualPage.OverrideNote')), 'MetaDescription');
$fields->addFieldToTab('Root.Main', TextField::create('CustomExtraMeta', $this->fieldLabel('CustomMetaTitle'))->setDescription(_t('SubsitesVirtualPage.OverrideNote')), 'ExtraMeta');
return $fields;
}
示例9: getCMSFields
public function getCMSFields()
{
Requirements::css('widgetify/thirdparty/codemirror-3.18/lib/codemirror.css');
Requirements::css('widgetify/css/widgetify_cms.css');
Requirements::javascript('framework/thirdparty/jquery/jquery.js');
Requirements::javascript('widgetify/thirdparty/codemirror-3.18/lib/codemirror.js');
Requirements::javascript('widgetify/thirdparty/codemirror-3.18/mode/xml/xml.js');
Requirements::javascript('widgetify/thirdparty/codemirror-3.18/mode/javascript/javascript.js');
Requirements::javascript('widgetify/thirdparty/codemirror-3.18/mode/css/css.js');
Requirements::javascript('widgetify/scripts/template_editor.js');
$fields = FieldList::create();
$fields->push(TextField::create('Title', 'Template Title', false, 100));
$fields->push(HeaderField::create('WidgetifyPreviewTitle', 'Preview', 4));
$fields->push(LiteralField::create('WidgetifyPreview', '<div id="widgetifyPreview" class="widgetifyTemplate"><p><strong>Click "Refresh & validate" to load preview</strong></p></div><p><a href="javascript:;" id="refreshAndValidate" class="ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary">Refresh & validate</a></p>'));
$fields->push(LiteralField::create('WidgetifyLog', '<p><strong>Validation log:</strong></p><div id="widgetifyLog"></div>'));
$fields->push(HeaderField::create('WidgetifyEditorTitle', 'Template editor', 4));
$fields->push(LiteralField::create('WidgetifyEditorHelp', '<p><strong>Note:</strong> in the HTML tab, insert the tag <strong>{widget-UniqueIdentifier}</strong> where widgets should be placed. <em>Example: {widget-1} {widget-2} ...</em></p>'));
$fields->push(LiteralField::create('Tabs', '<p class="tabs"><a href="javascript:;" id="tabTemplate" class="selected tabChange">HTML</a><a href="javascript:;" id="tabCSS" class="tabChange">Stylesheet</a><a href="javascript:;" id="tabJS" class="tabChange">Javascript</a></p>'));
$fields->push(TextareaField::create('TemplateContent', false));
$fields->push(TextareaField::create('CSSContent', false));
$fields->push(TextareaField::create('JSContent', false));
if ($this->ID) {
$fields->push(HeaderField::create('WidgetifyRelatedTitle', 'Pages using this template', 4));
$fields->push(LiteralField::create('AppliedTo', $this->_getTablePages()));
}
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 $fields)
{
$fields->insertBefore(new Tab('MembershipDetails', 'Membership Details'), 'Main');
//move first and ;astname
$fields->addFieldToTab('Root.MembershipDetails', $fields->dataFieldByName('FirstName'));
$fields->addFieldToTab('Root.MembershipDetails', $fields->dataFieldByName('Surname'));
$fields->addFieldToTab('Root.MembershipDetails', $fields->dataFieldByName('Email'));
$fields->addFieldToTab('Root.MembershipDetails', $region = DropdownField::create('RegionID', 'Region', Region::get()->map('ID', 'Title')));
$region->setEmptyString(' ');
$fields->addFieldToTab('Root.MembershipDetails', DropdownField::create('MembershipStatus', 'Membership Status', $this->owner->dbObject('MembershipStatus')->enumValues()));
$fields->addFieldToTab('Root.MembershipDetails', $expiry = DateField::create('ExpiryDate'));
$fields->addFieldToTab('Root.MembershipDetails', DropdownField::create('Discount', 'Discount', $this->owner->dbObject('Discount')->enumValues()));
$fields->addFieldToTab('Root.MembershipDetails', $discountExpiry = DateField::create('DiscountExpiryDate'));
$fields->addFieldToTab('Root.MembershipDetails', $joined = DateField::create('JoinedDate'));
$fields->addFieldToTab('Root.MembershipDetails', TextareaField::create('NotesForMember'));
if ($this->owner->MembershipStatus !== "Not applied") {
$fields->addFieldToTab('Root.MembershipDetails', TextField::create('MemberNumber'));
}
$fields->addFieldToTab('Root.MembershipDetails', TextField::create('HomePhone'));
$fields->addFieldToTab('Root.MembershipDetails', TextField::create('WorkPhone'));
$fields->addFieldToTab('Root.MembershipDetails', TextField::create('MobilePhone'));
$fields->addFieldToTab('Root.MembershipDetails', TextareaField::create('Address'));
$fields->addFieldToTab('Root.MembershipDetails', TextField::create('Occupation'));
$fields->addFieldToTab('Root.MembershipDetails', TextField::create('BirthDate'));
$expiry->setConfig('showcalendar', true);
$expiry->setConfig('showdropdown', true);
$expiry->setConfig('dateformat', 'dd-MM-YYYY');
$discountExpiry->setConfig('showcalendar', true);
$discountExpiry->setConfig('showdropdown', true);
$discountExpiry->setConfig('dateformat', 'dd-MM-YYYY');
$joined->setConfig('showcalendar', true);
$joined->setConfig('showdropdown', true);
$joined->setConfig('dateformat', 'dd-MM-YYYY');
}
示例12: getCMSFields
/**
* getCMSFields
* Construct the FieldList used in the CMS. To provide a
* smarter UI we don't use the scaffolding provided by
* parent::getCMSFields.
*
* @return FieldList
*/
public function getCMSFields()
{
Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
//Create the FieldList and push the Root TabSet on to it.
$fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Order Status"), CompositeField::create(TextField::create("Title", "Friendly Name")->setRightTitle("The name of your custom order status. i.e. Pending, Awaiting Stock."), TextareaField::create("Content", "Friendly Description")->setRightTitle("This will be shown to your customers. What do you wish to tell them about this status?")))));
return $fields;
}
示例13: getCMSFields
public function getCMSFields()
{
$conf = SiteConfig::current_site_config();
$themes = $conf->getAvailableThemes();
$theme = new DropdownField('Theme', _t('Multisites.THEME', 'Theme'), $themes);
$theme->setEmptyString(_t('Multisites.DEFAULTTHEME', '(Default theme)'));
$fields = new FieldList(new TabSet('Root', new Tab('Main', new HeaderField('SiteConfHeader', _t('Multisites.SITECONF', 'Site Configuration')), new TextField('Title', _t('Multisites.TITLE', 'Title')), new TextField('Tagline', _t('Multisites.TAGLINE', 'Tagline/Slogan')), $theme, new HeaderField('SiteURLHeader', _t('Multisites.SITEURL', 'Site URL')), new OptionsetField('Scheme', _t('Multisites.SCHEME', 'Scheme'), array('any' => _t('Multisites.ANY', 'Any'), 'http' => _t('Multisites.HTTP', 'HTTP'), 'https' => _t('Multisites.HTTPS', 'HTTPS (HTTP Secure)'))), new TextField('Host', _t('Multisites.HOST', 'Host')), new MultiValueTextField('HostAliases', _t('Multisites.HOSTALIASES', 'Host Aliases')), new CheckboxField('IsDefault', _t('Multisites.ISDEFAULT', 'Is this the default site?')), new HeaderField('SiteAdvancedHeader', _t('Multisites.SiteAdvancedHeader', 'Advanced Settings')), TextareaField::create('RobotsTxt', _t('Multisites.ROBOTSTXT', 'Robots.txt'))->setDescription(_t('Multisites.ROBOTSTXTUSAGE', '<p>Please consult <a href="http://www.robotstxt.org/robotstxt.html" target="_blank">http://www.robotstxt.org/robotstxt.html</a> for usage of the robots.txt file.</p>')))));
$devIDs = Config::inst()->get('Multisites', 'developer_identifiers');
if (is_array($devIDs)) {
if (!ArrayLib::is_associative($devIDs)) {
$devIDs = ArrayLib::valuekey($devIDs);
}
$fields->addFieldToTab('Root.Main', DropdownField::create('DevID', _t('Multisites.DeveloperIdentifier', 'Developer Identifier'), $devIDs));
}
if (Multisites::inst()->assetsSubfolderPerSite()) {
$fields->addFieldToTab('Root.Main', new TreeDropdownField('FolderID', _t('Multisites.ASSETSFOLDER', 'Assets Folder'), 'Folder'), 'SiteURLHeader');
}
if (!Permission::check('SITE_EDIT_CONFIGURATION')) {
foreach ($fields->dataFields() as $field) {
$fields->makeFieldReadonly($field);
}
}
$this->extend('updateSiteCMSFields', $fields);
return $fields;
}
示例14: getCMSFields
public function getCMSFields()
{
$fields = FieldList::create(HeaderField::create('Outer Captions'), $category = DropdownField::create('FeaturedWorkCategoryID', 'Category', ProjectCategory::get()->map('ID', 'Title')), $imgUploadField = UploadField::create('ProjectCoverImage', 'Cover Image'), TextareaField::create('ProjectBriefDesc', 'Hover Over Description'), TextField::create('ProjectTitle', 'Title'), HeaderField::create('Project Phases'), $imgPhase1 = UploadField::create('ProjectPhaseImg1', 'Phase 1 Image'), TextareaField::create('ProjectPhaseDesc1', 'Phase 1 Description'), $imgPhase2 = UploadField::create('ProjectPhaseImg2', 'Phase 2 Image'), TextareaField::create('ProjectPhaseDesc2', 'Phase 2 Description'), $imgPhase3 = UploadField::create('ProjectPhaseImg3', 'Phase 3 Image'), TextareaField::create('ProjectPhaseDesc3', 'Phase 3 Description'), $imgPhase4 = UploadField::create('ProjectPhaseImg4', 'Phase 4 Image'), TextareaField::create('ProjectPhaseDesc4', 'Phase 4 Description'), $imgPhase5 = UploadField::create('ProjectPhaseImg5', 'Phase 5 Image'), TextareaField::create('ProjectPhaseDesc5', 'Phase 5 Description'), $imgPhase6 = UploadField::create('ProjectPhaseImg6', 'Phase 6 Image'), TextareaField::create('ProjectPhaseDesc6', 'Phase 6 Description'));
//create inner GridField for ProjectPhases images
/*$fields->addFieldToTab('Root.Phases', GridField::create(
'ProjectPhases',
'Project Phases',
$this->ProjectPhases(),
GridFieldConfig_RecordEditor::create()
));*/
//set image upload getTempFolder
$imgUploadField->setFolderName('Featured Works Images');
//validate image upload types
$imgUploadField->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg'));
//project phase img 1
$imgPhase1->setFolderName('Project Phase Images');
$imgPhase1->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg'));
//project phase img 2
$imgPhase2->setFolderName('Project Phase Images');
$imgPhase2->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg'));
//project phase img 3
$imgPhase3->setFolderName('Project Phase Images');
$imgPhase3->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg'));
//project phase img 4
$imgPhase4->setFolderName('Project Phase Images');
$imgPhase4->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg'));
//project phase img 5
$imgPhase5->setFolderName('Project Phase Images');
$imgPhase5->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg'));
//project phase img 6
$imgPhase6->setFolderName('Project Phase Images');
$imgPhase6->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpg', 'jpeg'));
//return the fields
return $fields;
}
示例15: 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)));
}
}