Skip to content

Commit

Permalink
MINOR Removed hardcoded children entries from CMS Menu (and record se…
Browse files Browse the repository at this point in the history
…tting logic), as the related controllers have been merged to be accessible under the same top-level menu
  • Loading branch information
chillu committed Apr 17, 2012
1 parent cde9b31 commit 6bee103
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
23 changes: 0 additions & 23 deletions admin/javascript/LeftAndMain.Menu.js
Expand Up @@ -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));
35 changes: 0 additions & 35 deletions admin/templates/Includes/LeftAndMain_Menu.ss
Expand Up @@ -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 &amp; 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">
Expand Down

0 comments on commit 6bee103

Please sign in to comment.