Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cwp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
cwp
cwp
Commits
c7107d21
Commit
c7107d21
authored
Mar 07, 2017
by
Robbie Averill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API Add ability to disable page utilities for a page
parent
72fbd609
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
_config/config.yml
_config/config.yml
+3
-0
code/extensions/CwpSiteTreeExtension.php
code/extensions/CwpSiteTreeExtension.php
+40
-0
lang/en.yml
lang/en.yml
+2
-0
No files found.
_config/config.yml
View file @
c7107d21
...
...
@@ -5,6 +5,9 @@ After: 'cwp-core/*'
SiteConfig
:
extensions
:
-
CustomSiteConfig
SiteTree
:
extensions
:
-
CwpSiteTreeExtension
TaxonomyTerm
:
extensions
:
-
TaxonomyTermExtension
...
...
code/extensions/CwpSiteTreeExtension.php
0 → 100644
View file @
c7107d21
<?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?'
);
}
}
lang/en.yml
View file @
c7107d21
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment