Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into integration

Conflicts:
	admin/css/screen.css
	admin/scss/_style.scss
  • Loading branch information...
commit 5cc33ab843f0a9fb5187a0892fd3719d897e2569 2 parents d0e3129 + 804e2da
@chillu chillu authored
View
5 admin/code/LeftAndMain.php
@@ -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
12 admin/css/screen.css
@@ -260,11 +260,12 @@ body.cms { overflow: hidden; }
.cms-edit-form .cms-content-header-tabs .ui-tabs-nav li a { text-indent: 0; }
-.ui-tabs .ui-tabs-nav li, .cms-dialog .ui-tabs-nav .ui-tabs-nav li { margin: 0; }
-.ui-tabs .ui-tabs-nav li a, .cms-dialog .ui-tabs-nav .ui-tabs-nav li a { font-weight: bold; line-height: 16px; padding: 12px 20px 11px; }
-.ui-tabs .ui-state-default, .ui-tabs .ui-widget-content .ui-state-default, .ui-tabs .ui-widget-header .ui-state-default, .cms-dialog .ui-tabs-nav .ui-state-default, .cms-dialog .ui-tabs-nav .ui-widget-content .ui-state-default, .cms-dialog .ui-tabs-nav .ui-widget-header .ui-state-default { background-color: #b0bec7; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b0bec7), color-stop(100%, #8ca1ae)); background-image: -webkit-linear-gradient(#b0bec7, #8ca1ae); background-image: -moz-linear-gradient(#b0bec7, #8ca1ae); background-image: -o-linear-gradient(#b0bec7, #8ca1ae); background-image: -ms-linear-gradient(#b0bec7, #8ca1ae); background-image: linear-gradient(#b0bec7, #8ca1ae); border-right-color: #a6a6a6; border-left-color: #d9d9d9; border-bottom: none; text-shadow: white 0 1px 0; }
-.ui-tabs .ui-state-active, .ui-tabs .ui-widget-content .ui-state-active, .ui-tabs .ui-widget-header .ui-state-active, .cms-dialog .ui-tabs-nav .ui-state-active, .cms-dialog .ui-tabs-nav .ui-widget-content .ui-state-active, .cms-dialog .ui-tabs-nav .ui-widget-header .ui-state-active { background: #eceff1; border-right-color: #a6a6a6; border-left-color: #a6a6a6; margin-right: -1px; margin-left: -1px; z-index: 2; }
-.ui-tabs .ui-state-active a, .ui-tabs .ui-widget-content .ui-state-active a, .ui-tabs .ui-widget-header .ui-state-active a, .cms-dialog .ui-tabs-nav .ui-state-active a, .cms-dialog .ui-tabs-nav .ui-widget-content .ui-state-active a, .cms-dialog .ui-tabs-nav .ui-widget-header .ui-state-active a { border-bottom: none; }
+/** -------------------------------------------- Tabs -------------------------------------------- */
+.ui-tabs .cms-content-header .ui-tabs-nav li, .cms-dialog .ui-tabs-nav li { margin: 0; }
+.ui-tabs .cms-content-header .ui-tabs-nav li a, .cms-dialog .ui-tabs-nav li a { font-weight: bold; line-height: 16px; padding: 12px 20px 11px; }
+.ui-tabs .cms-content-header .ui-tabs-nav .ui-state-default, .ui-tabs .cms-content-header .ui-tabs-nav .ui-widget-content .ui-state-default, .ui-tabs .cms-content-header .ui-tabs-nav .ui-widget-header .ui-state-default, .cms-dialog .ui-tabs-nav .ui-state-default, .cms-dialog .ui-tabs-nav .ui-widget-content .ui-state-default, .cms-dialog .ui-tabs-nav .ui-widget-header .ui-state-default { background-color: #b0bec7; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b0bec7), color-stop(100%, #8ca1ae)); background-image: -webkit-linear-gradient(#b0bec7, #8ca1ae); background-image: -moz-linear-gradient(#b0bec7, #8ca1ae); background-image: -o-linear-gradient(#b0bec7, #8ca1ae); background-image: -ms-linear-gradient(#b0bec7, #8ca1ae); background-image: linear-gradient(#b0bec7, #8ca1ae); border-right-color: #a6a6a6; border-left-color: #d9d9d9; border-bottom: none; text-shadow: white 0 1px 0; }
+.ui-tabs .cms-content-header .ui-tabs-nav .ui-state-active, .ui-tabs .cms-content-header .ui-tabs-nav .ui-widget-content .ui-state-active, .ui-tabs .cms-content-header .ui-tabs-nav .ui-widget-header .ui-state-active, .cms-dialog .ui-tabs-nav .ui-state-active, .cms-dialog .ui-tabs-nav .ui-widget-content .ui-state-active, .cms-dialog .ui-tabs-nav .ui-widget-header .ui-state-active { background: #eceff1; border-right-color: #a6a6a6; border-left-color: #a6a6a6; margin-right: -1px; margin-left: -1px; z-index: 2; }
+.ui-tabs .cms-content-header .ui-tabs-nav .ui-state-active a, .ui-tabs .cms-content-header .ui-tabs-nav .ui-widget-content .ui-state-active a, .ui-tabs .cms-content-header .ui-tabs-nav .ui-widget-header .ui-state-active a, .cms-dialog .ui-tabs-nav .ui-state-active a, .cms-dialog .ui-tabs-nav .ui-widget-content .ui-state-active a, .cms-dialog .ui-tabs-nav .ui-widget-header .ui-state-active a { border-bottom: none; }
/** ------------------------------------------------------- Loading Interface ------------------------------------------------------- */
.cms-content-loading-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 9998; }
@@ -608,7 +609,6 @@ li.class-ErrorPage > a .jstree-pageicon { background-position: 0 -112px; }
.cms-menu-list li a .toggle-children { display: inline-block; float: right; width: 20px; height: 100%; cursor: pointer; }
.cms-menu-list li a .toggle-children .toggle-children-icon { display: inline-block; width: 8px; height: 8px; background: url('../images/sprites-32x32-sa4e142f7f0.png') 0 -695px no-repeat; vertical-align: middle; }
.cms-menu-list li a .toggle-children.opened .toggle-children-icon { background: url('../images/sprites-32x32-sa4e142f7f0.png') 0 -711px no-repeat; }
-.cms-menu-list li ul { display: none; }
.cms-menu-list li.current a { color: white; text-shadow: #1e5270 0 -1px 0; border-top: 1px solid #55a4d2; border-bottom: 1px solid #1e5270; background-color: #338dc1; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #338dc1), color-stop(100%, #287099)); background-image: -webkit-linear-gradient(#338dc1, #287099); background-image: -moz-linear-gradient(#338dc1, #287099); background-image: -o-linear-gradient(#338dc1, #287099); background-image: -ms-linear-gradient(#338dc1, #287099); background-image: linear-gradient(#338dc1, #287099); }
.cms-menu-list li.current a .toggle-children .toggle-children-icon { background: url('../images/sprites-32x32-sa4e142f7f0.png') 0 -727px no-repeat; }
.cms-menu-list li.current a .toggle-children.opened .toggle-children-icon { background: url('../images/sprites-32x32-sa4e142f7f0.png') 0 -743px no-repeat; }
View
BIN  admin/images/sprites-32x32-sa4e142f7f0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
9 admin/javascript/LeftAndMain.EditForm.js
@@ -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));
View
6 admin/javascript/LeftAndMain.Panel.js
@@ -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
7 admin/scss/_style.scss
@@ -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;
View
2  admin/templates/Includes/LeftAndMain_EditForm.ss
@@ -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 %>
View
33 forms/gridfield/GridFieldPopupForms.php
@@ -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
11 javascript/TabSet.js
@@ -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});
},
/**
View
2  templates/Includes/GridFieldAction_Edit.ss
@@ -1 +1 @@
-<a class="edit-link" href="$Link">edit</a>
+<a class="action edit-link" href="$Link">edit</a>
View
11 tests/forms/GridFieldTest.php
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.