mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #300 from chillu/pulls/show-children-as-list
NEW "Show children as list" tree context action
This commit is contained in:
commit
1bad0742fb
@ -12,12 +12,27 @@
|
|||||||
'edit': {
|
'edit': {
|
||||||
'label': ss.i18n._t('Tree.EditPage'),
|
'label': ss.i18n._t('Tree.EditPage'),
|
||||||
'action': function(obj) {
|
'action': function(obj) {
|
||||||
$('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf(
|
$('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf(
|
||||||
self.data('urlEditpage'), obj.data('id')
|
self.data('urlEditpage'), obj.data('id')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Add "show as list"
|
||||||
|
if(!node.hasClass('nochildren')) {
|
||||||
|
menuitems['showaslist'] = {
|
||||||
|
'label': ss.i18n._t('Tree.ShowAsList'),
|
||||||
|
'action': function(obj) {
|
||||||
|
$('.cms-container').entwine('.ss').loadPanel(
|
||||||
|
self.data('urlListview') + '&ParentID=' + obj.data('id'),
|
||||||
|
null,
|
||||||
|
// Default to list view tab
|
||||||
|
{tabState: {'pages-controller-cms-content': {'tabSelector': '.content-listview'}}}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Build a list for allowed children as submenu entries
|
// Build a list for allowed children as submenu entries
|
||||||
var pagetype = node.data('pagetype'),
|
var pagetype = node.data('pagetype'),
|
||||||
|
@ -33,6 +33,7 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
|||||||
'Tree.EditPage': 'Edit',
|
'Tree.EditPage': 'Edit',
|
||||||
'Tree.ThisPageOnly': 'This page only',
|
'Tree.ThisPageOnly': 'This page only',
|
||||||
'Tree.ThisPageAndSubpages': 'This page and subpages',
|
'Tree.ThisPageAndSubpages': 'This page and subpages',
|
||||||
|
'Tree.ShowAsList': 'Show children as list',
|
||||||
'CMSMain.ConfirmRestoreFromLive': "Do you really want to copy the published content to the draft site?",
|
'CMSMain.ConfirmRestoreFromLive': "Do you really want to copy the published content to the draft site?",
|
||||||
'CMSMain.RollbackToVersion': "Do you really want to roll back to version #%s of this page?",
|
'CMSMain.RollbackToVersion': "Do you really want to roll back to version #%s of this page?",
|
||||||
'URLSEGMENT.Edit': 'Edit',
|
'URLSEGMENT.Edit': 'Edit',
|
||||||
|
@ -19,7 +19,7 @@ $ExtraTreeTools
|
|||||||
</div>
|
</div>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
|
|
||||||
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1')}&ParentID=%s&PageType=%s&SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-url-duplicate="{$Link('duplicate/%s')}?SecurityID=$SecurityID" data-url-duplicatewithchildren="{$Link('duplicatewithchildren/%s')}?SecurityID=$SecurityID" data-hints="$SiteTreeHints.XML">
|
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1')}&ParentID=%s&PageType=%s&SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-url-duplicate="{$Link('duplicate/%s')}?SecurityID=$SecurityID" data-url-duplicatewithchildren="{$Link('duplicatewithchildren/%s')}?SecurityID=$SecurityID" data-url-listview="{$Link('?view=list')}" data-hints="$SiteTreeHints.XML">
|
||||||
$SiteTreeAsUL
|
$SiteTreeAsUL
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
<div class="cms-content-header-tabs">
|
<div class="cms-content-header-tabs">
|
||||||
<ul class="cms-tabset-nav-primary">
|
<ul class="cms-tabset-nav-primary">
|
||||||
<li class="content-treeview<% if ViewState == tree %> ui-tabs-active<% end_if %> cms-tabset-icon tree">
|
<li class="content-treeview<% if ViewState == tree %> ui-tabs-active ss-tabs-force-active<% end_if %> cms-tabset-icon tree">
|
||||||
<a href="#cms-content-treeview" class="cms-panel-link" data-href="$LinkTreeView"><% _t('CMSPagesController.TreeView', 'Tree View') %></a>
|
<a href="#cms-content-treeview" class="cms-panel-link" data-href="$LinkTreeView"><% _t('CMSPagesController.TreeView', 'Tree View') %></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="content-listview<% if ViewState == list %> ui-tabs-active<% end_if %> cms-tabset-icon list">
|
<li class="content-listview<% if ViewState == list %> ui-tabs-active ss-tabs-force-active<% end_if %> cms-tabset-icon list">
|
||||||
<a href="#cms-content-listview" class="cms-panel-link" data-href="$LinkListView"><% _t('CMSPagesController.ListView', 'List View') %></a>
|
<a href="#cms-content-listview" class="cms-panel-link" data-href="$LinkListView"><% _t('CMSPagesController.ListView', 'List View') %></a>
|
||||||
</li>
|
</li>
|
||||||
<!--
|
<!--
|
||||||
|
Loading…
Reference in New Issue
Block a user