Permalink
Browse files

ENHANCEMENT Saving tab state for CMSPagesController

  • Loading branch information...
1 parent c9fc7cd commit ad7c4432550762bbd7aedf9f2a81eeedcf4bd701 @chillu chillu committed May 30, 2012
Showing with 9 additions and 2 deletions.
  1. +7 −0 code/controllers/CMSPagesController.php
  2. +2 −2 templates/Includes/CMSPagesController_Content.ss
@@ -16,6 +16,13 @@ function LinkPreview() {
}
/**
+ * @return String
+ */
+ public function ViewState() {
+ return $this->request->getVar('view');
+ }
+
+ /**
* Doesn't deal with a single record, and we need
* to avoid session state from previous record edits leaking in here.
*/
@@ -9,10 +9,10 @@
<div class="cms-content-header-tabs">
<ul>
- <li class="content-treeview">
+ <li class="content-treeview<% if ViewState == tree %> ui-tabs-selected<% end_if %>">
<a href="#cms-content-treeview" class="cms-panel-link" data-href="$LinkTreeView"><% _t('CMSPagesController.TreeView', 'Tree View') %></a>
</li>
- <li class="content-listview">
+ <li class="content-listview<% if ViewState == list %> ui-tabs-selected<% end_if %>">
<a href="#cms-content-listview" class="cms-panel-link" data-href="$LinkListView"><% _t('CMSPagesController.ListView', 'List View') %></a>
</li>
<!--

0 comments on commit ad7c443

Please sign in to comment.