Commit c7107d21 authored by Robbie Averill's avatar Robbie Averill

API Add ability to disable page utilities for a page

parent 72fbd609
......@@ -5,6 +5,9 @@ After: 'cwp-core/*'
SiteConfig:
extensions:
- CustomSiteConfig
SiteTree:
extensions:
- CwpSiteTreeExtension
TaxonomyTerm:
extensions:
- TaxonomyTermExtension
......
<?php
class CwpSiteTreeExtension extends DataExtension
{
private static $db = array(
'ShowPageUtilities' => 'Boolean(1)'
);
private static $defaults = array(
'ShowPageUtilities' => true
);
/**
* Modify the settings for a SiteTree
*
* {@inheritDoc}
*
* @param FieldList $fields
*/
public function updateSettingsFields(FieldList $fields)
{
$helpText = _t(
'SiteTree.SHOW_PAGE_UTILITIES_HELP',
'You can disable page utilities (print, share, etc) for this page'
);
$fields->addFieldsToTab(
'Root.Settings',
array(
LiteralField::create('PageUtilitiesHelp', $helpText),
CheckboxField::create('ShowPageUtilities', $this->owner->fieldLabel('ShowPageUtilities'))
)
);
}
public function updateFieldLabels(&$labels)
{
$labels['ShowPageUtilities'] = _t('SiteTree.SHOW_PAGE_UTILITIES', 'Show page utilities?');
}
}
......@@ -132,6 +132,8 @@ en:
FeatureTwo: 'Feature Two'
PLURALNAME: Pages
SINGULARNAME: Page
SHOW_PAGE_UTILITIES: 'Show page utilities?'
SHOW_PAGE_UTILITIES_HELP: 'You can disable page utilities (print, share, etc) for this page'
SiteTreeFileExtension:
BACKLINK_LIST_DESCRIPTION: 'This list shows all pages where the file has been added through a WYSIWYG editor.'
EDIT: Edit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment