mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Removed hardcoded children entries from CMS Menu (and record setting logic), as the related controllers have been merged to be accessible under the same top-level menu
This commit is contained in:
parent
cde9b3183b
commit
6bee103d14
@ -237,28 +237,5 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('.cms-menu-list #Menu-CMSPageSettingsController, .cms-menu-list #Menu-CMSPageHistoryController, .cms-menu-list #Menu-CMSPageEditController').entwine({
|
||||
setRecordID: function(id) {
|
||||
// Only applies to edit forms relating to page elements
|
||||
if(!$('.cms-content').is('.CMSMain')) return;
|
||||
|
||||
var link = this.find('a:first'), href = link.attr("href").split('/');
|
||||
// Assumes that current ID will always be the last URL segment (and not a query parameter)
|
||||
href[href.length -1] = id;
|
||||
link.attr('href', href.join('/'));
|
||||
}
|
||||
});
|
||||
|
||||
$('.cms-menu-list #Menu-CMSPageAddController').entwine({
|
||||
setRecordID: function(id) {
|
||||
// Only applies to edit forms relating to page elements
|
||||
if(!$('.cms-content').is('.CMSMain')) return;
|
||||
|
||||
var link = this.find('a:first'), href = link.attr('href');
|
||||
if(!href.match(/\?/)) href += '?';
|
||||
link.attr('href', href.replace(/\?.*$/, '?ParentID=' + id));
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}(jQuery));
|
@ -29,41 +29,6 @@
|
||||
<span class="text">$Title</span>
|
||||
</a>
|
||||
|
||||
<% if Code == 'CMSMain' %>
|
||||
<ul>
|
||||
<li class="first <% if Top.class == 'CMSPageEditController' || Top.class == 'CMSMain' %>current<% end_if %>" id="Menu-CMSPageEditController">
|
||||
<a href="admin/page/edit/show/$Top.CurrentPageID">
|
||||
<span class="text">Content</span>
|
||||
</a>
|
||||
</li>
|
||||
<li <% if Top.class == 'CMSPageSettingsController' %>class="current"<% end_if %> id="Menu-CMSPageSettingsController">
|
||||
<a href="admin/page/settings/show/$Top.CurrentPageID">
|
||||
<span class="text">Settings</span>
|
||||
</a>
|
||||
</li>
|
||||
<li <% if Top.class == 'CMSPageHistoryController' %>class="current"<% end_if %> id="Menu-CMSPageHistoryController">
|
||||
<a href="admin/page/history/show/$Top.CurrentPageID">
|
||||
<span class="text">History</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<% end_if %>
|
||||
|
||||
<% if Code == 'CMSPagesController' %>
|
||||
<ul>
|
||||
<li class="first <% if Top.class == 'CMSPagesController' %>current<% end_if %>" id="Menu-CMSPagesController">
|
||||
<a href="admin/pages/">
|
||||
<span class="text">Edit & organize</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last <% if Top.class == 'CMSPageAddController' %>current<% end_if %>" id="Menu-CMSPageAddController">
|
||||
<a href="admin/page/add/?ParentID=$Top.CurrentPageID">
|
||||
<span class="text">Add page</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<% end_if %>
|
||||
|
||||
<% if Code == 'AssetAdmin' %>
|
||||
<ul>
|
||||
<li class="first <% if Top.class == 'AssetAdmin' %>current<% end_if %>" id="Menu-AssetAdmin">
|
||||
|
Loading…
Reference in New Issue
Block a user