Permalink
Browse files

Merge branch 'master' into integration

Conflicts:
	admin/css/screen.css
	admin/scss/_style.scss
  • Loading branch information...
2 parents d0e3129 + 804e2da commit 5cc33ab843f0a9fb5187a0892fd3719d897e2569 @chillu chillu committed Feb 28, 2012
@@ -516,6 +516,7 @@ public function Breadcrumbs($unlinked = false) {
if($record) {
if($record->hasExtension('Hierarchy')) {
$ancestors = $record->getAncestors();
+ $ancestors = new ArrayList(array_reverse($ancestors->toArray()));
$ancestors->push($record);
foreach($ancestors as $ancestor) {
$items->push(new ArrayData(array(
@@ -1157,8 +1158,8 @@ function getSilverStripeNavigator() {
public function currentPageID() {
if($this->request->requestVar('ID')) {
return $this->request->requestVar('ID');
- } elseif ($this->request->param('ID') && is_numeric($this->request->param('ID'))) {
- return $this->request->param('ID');
+ } elseif (isset($this->urlParams['ID']) && is_numeric($this->urlParams['ID'])) {
+ return $this->urlParams['ID'];
} elseif(Session::get("{$this->class}.currentPage")) {
return Session::get("{$this->class}.currentPage");
} else {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -172,7 +172,7 @@
* We need this onclick overloading because we can't get to the
* clicked button from a form.onsubmit event.
*/
- $('.cms-edit-form .Actions :button').entwine({
+ $('.cms-edit-form .Actions :submit').entwine({
/**
* Function: onclick
@@ -183,13 +183,6 @@
}
});
- $('.cms-edit-form .ss-gridfield .action-edit').entwine({
- onclick: function(e) {
- $('.cms-container').loadPanel(this.attr('href'), '', {selector: '.cms-edit-form'});
- e.preventDefault();
- }
- });
-
});
}(jQuery));
@@ -96,10 +96,12 @@
// Save collapsed state in cookie
if($.cookie && this.attr('id')) $.cookie('cms-panel-collapsed-' + this.attr('id'), !bool, {path: '/', expires: 31});
- if(!silent) {
+ // TODO Fix redraw order (inner to outer), and re-enable silent flag
+ // to avoid multiple expensive redraws on a single load.
+ // if(!silent) {
this.trigger('toggle', bool);
this.trigger(bool ? 'expand' : 'collapse');
- }
+ // }
},
expandPanel: function(force) {
View
@@ -192,8 +192,11 @@ body.cms {
}
}
-.ui-tabs, .cms-dialog .ui-tabs-nav {
- .ui-tabs-nav li {
+/** --------------------------------------------
+ * Tabs
+ * -------------------------------------------- */
+.ui-tabs .cms-content-header .ui-tabs-nav, .cms-dialog .ui-tabs-nav {
+ li {
margin:0;
a {
font-weight: bold;
@@ -35,7 +35,7 @@
$EditFormTools
<% end_control %>
- <div class="cms-content-fields center <% if not Fields.hasTabset %>cms-panel-padded<% end_if %>">
+ <div class="cms-content-fields center cms-panel-padded">
<% if Message %>
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
<% else %>
@@ -214,12 +214,12 @@ function ItemEditForm() {
// WARNING: The arguments passed here are a little arbitrary. This API will need cleanup
$this->record->getCMSFields($this->popupController, $this->popupFormName),
new FieldList(
- $saveAction = new FormAction('doSave', _t('GridFieldDetailsForm.Save', 'Save')),
- $deleteAction = new FormAction('doDelete', _t('GridFieldDetailsForm.Delete', 'Delete'))
+ FormAction::create('doSave', _t('GridFieldDetailsForm.Save', 'Save'))
+ ->setUseButtonTag(true)->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept'),
+ FormAction::create('doDelete', _t('GridFieldDetailsForm.Delete', 'Delete'))
+ ->setUseButtonTag(true)->addExtraClass('ss-ui-action-destructive')
)
);
- $saveAction->addExtraClass('ss-ui-action-constructive');
- $deleteAction->addExtraClass('ss-ui-action-destructive');
$form->loadDataFrom($this->record);
return $form;
}
@@ -291,4 +291,29 @@ function setTemplate($template) {
function getTemplate() {
return $this->template;
}
+
+ /**
+ * CMS-specific functionality: Passes through navigation breadcrumbs
+ * to the template, and includes the currently edited record (if any).
+ * see {@link LeftAndMain->Breadcrumbs()} for details.
+ *
+ * @param boolean $unlinked
+ * @return ArrayData
+ */
+ function Breadcrumbs($unlinked = false) {
+ if(!($this->popupController instanceof LeftAndMain)) return false;
+
+ $items = $this->popupController->Breadcrumbs($unlinked);
+ if($this->record) {
+ $items->push(new ArrayData(array(
+ 'Title' => $this->record->Title,
+ 'Link' => false
+ )));
+ }
+
+ // TODO Remove once ViewableData->First()/Last() is fixed
+ foreach($items as $i => $item) $item->iteratorProperties($i, $items->Count());
+
+ return $items;
+ }
}
View
@@ -17,11 +17,12 @@
redrawTabs: function() {
this.rewriteHashlinks();
- // Initialize jQuery UI tabs
- var id = this.attr('id');
- this.tabs({
- cookie: ($.cookie && id) ? { expires: 30, path: '/', name: 'ui-tabs-' + id } : false
- });
+ var id = this.attr('id'), cookieId = 'ui-tabs-' + id;
+
+ // Fix for wrong cookie storage of deselected tabs
+ if($.cookie && id && $.cookie(cookieId) == -1) $.cookie(cookieId, 0);
+
+ this.tabs({cookie: ($.cookie && id) ? { expires: 30, path: '/', name: cookieId } : false});
},
/**
@@ -1 +1 @@
-<a class="edit-link" href="$Link">edit</a>
+<a class="action edit-link" href="$Link">edit</a>
@@ -29,11 +29,12 @@ public function testGridFieldDefaultConfig() {
$obj = new GridField('testfield', 'testfield');
$expectedComponents = new ArrayList(array(
- 0 => new GridFieldSortableHeader,
- 1 => new GridFieldFilter,
- 2 => new GridFieldDefaultColumns,
- 3 => new GridFieldPaginator,
- 4 => new GridState_Component,
+ new GridFieldTitle(),
+ new GridFieldSortableHeader,
+ new GridFieldFilter,
+ new GridFieldDefaultColumns,
+ new GridFieldPaginator,
+ new GridState_Component,
));
$this->assertEquals($expectedComponents, $obj->getConfig()->getComponents(), 'Testing default Config');

0 comments on commit 5cc33ab

Please sign in to comment.