Permalink
Browse files

Merge branch 'master' into 3.0 (one-off)

This is a one-off merge in the direction master->3.0,
to ensure all bugfixes since we branched off find
their way into the next micro/minor release.
From now on, we'll commit to the latest release branch,
and merge back to master. API changes should go into
the master branch (not merged into a release branch).
  • Loading branch information...
2 parents 040f780 + d1bc721 commit c1aad0d0c0d0f9dcad67f01a4109c0171bf4644c @chillu chillu committed Jul 5, 2012
@@ -146,7 +146,8 @@ public function getEditForm($id = null, $fields = null) {
new GridFieldPaginator(15),
new GridFieldEditButton(),
new GridFieldDeleteAction(),
- new GridFieldDetailForm()
+ new GridFieldDetailForm(),
+ GridFieldLevelup::create($folder->ID)->setLinkSpec('admin/assets/show/%d')
);
$gridField = new GridField('File', $title, $this->getList(), $gridFieldConfig);
@@ -669,14 +669,16 @@ public function getList($params, $parentID = 0) {
public function ListViewForm() {
$params = $this->request->requestVar('q');
$list = $this->getList($params, $parentID = $this->request->requestVar('ParentID'));
- $gridFieldConfig = GridFieldConfig::create()->addComponents(
+ $gridFieldConfig = GridFieldConfig::create()->addComponents(
new GridFieldSortableHeader(),
new GridFieldDataColumns(),
new GridFieldPaginator(15)
);
if($parentID){
$gridFieldConfig->addComponent(
- new GridFieldLevelup($parentID)
+ GridFieldLevelup::create($parentID)
+ ->setLinkSpec('?ParentID=%d&view=list')
+ ->setAttributes(array('data-pjax' => 'ListViewForm,Breadcrumbs'))
);
}
$gridField = new GridField('Page','Pages', $list, $gridFieldConfig);
@@ -122,7 +122,9 @@ public function doAdd($data, $form) {
}
$record = $this->getNewItem("new-$className-$parentID".$suffix, false);
- if(class_exists('Translatable') && $record->hasExtension('Translatable')) $record->Locale = $data['Locale'];
+ if(class_exists('Translatable') && $record->hasExtension('Translatable') && isset($data['Locale'])) {
+ $record->Locale = $data['Locale'];
+ }
try {
$record->write();
View
@@ -2704,8 +2704,8 @@ function provideI18nEntities() {
if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = FRAMEWORK_DIR;
if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = FRAMEWORK_DIR;
- $types = self::page_type_classes();
- foreach($types as $type) {
+ $types = ClassInfo::subclassesFor('SiteTree');
+ foreach($types as $k => $type) {
$inst = singleton($type);
$entities[$type . '.DESCRIPTION'] = array(
$inst->stat('description'),
@@ -127,13 +127,13 @@
* (Function) callback
*/
suggest: function(val, callback) {
- var field = this.find(':text');
+ var field = this.find(':text'), urlParts = $.path.parseUrl(this.closest('form').attr('action')),
+ url = urlParts.hrefNoSearch + '/field/' + field.attr('name') + '/suggest/?value=' + encodeURIComponent(val);
+ if(urlParts.search) url += '&' + urlParts.search.replace(/^\?/, '');
+
$.get(
- this.closest('form').attr('action') +
- '/field/' + field.attr('name') + '/suggest/?value=' + encodeURIComponent(val),
- function(data) {
- callback.apply(this, arguments);
- }
+ url,
+ function(data) {callback.apply(this, arguments);}
);
},
View
@@ -37,6 +37,8 @@ en:
Back: Back
BasicFieldsTestPage:
DESCRIPTION: 'Generic content page'
+ BigFamilyPage:
+ DESCRIPTION: 'Generic content page'
BrokenLinksReport:
Any: Any
BROKENLINKS: 'Broken links report'
@@ -91,6 +93,7 @@ en:
PUBALLFUN: '"Publish All" functionality'
PUBALLFUN2: "Pressing this button will do the equivalent of going to every page and pressing \"publish\". It's\n intended to be used after there have been massive edits of the content, such as when the site was\n first built."
PUBPAGES: 'Done: Published {count} pages'
+ PageAdded: 'Successfully created page'
REMOVED: 'Deleted ''%s''%s from live site'
REMOVEDPAGE: 'Removed ''{title}'' from the published site'
REMOVEDPAGEFROMDRAFT: 'Removed ''%s'' from the draft site'
@@ -211,13 +214,24 @@ en:
GridFieldTestPage:
DESCRIPTION: 'Generic content page'
LeftAndMain:
+ DELETED: Deleted.
PreviewButton: Preview
SAVEDUP: Saved.
STATUSPUBLISHEDSUCCESS: 'Published ''{title}'' successfully'
SearchResults: 'Search Results'
VersionUnknown: Unknown
LegacyTableFieldsTestPage:
DESCRIPTION: 'Generic content page'
+ MyNonRootPage:
+ DESCRIPTION: 'Generic content page'
+ MyOtherPage:
+ DESCRIPTION: 'Generic content page'
+ MyPage:
+ DESCRIPTION: 'Generic content page'
+ MyRandomPage:
+ DESCRIPTION: 'Generic content page'
+ PackageManagerPage:
+ DESCRIPTION: 'Generic content page'
Page:
DESCRIPTION: 'Generic content page'
Permission:
@@ -264,8 +278,6 @@ en:
EDITHEADER: 'Who can edit pages on this site?'
EDIT_PERMISSION: 'Manage site configuration'
EDIT_PERMISSION_HELP: 'Ability to edit global access settings/top-level page permissions.'
- PLURALNAME: 'Site Configs'
- SINGULARNAME: 'Site Config'
SITENAMEDEFAULT: 'Your Site Name'
SITETAGLINE: 'Site Tagline/Slogan'
SITETITLE: 'Site title'
@@ -289,7 +301,6 @@ en:
BUTTONSAVEPUBLISH: 'Save & Publish'
BUTTONUNPUBLISH: Unpublish
BUTTONUNPUBLISHDESC: 'Remove this page from the published site'
- CHANGETO: 'Change to "%s"'
CREATED: 'Date Created'
Comments: Comments
Content: Content
@@ -891,6 +891,25 @@ function testModifyStatusFlagByInheritance(){
$this->assertContains('InheritedTitle', $treeTitle);
$this->assertContains('inherited-class', $treeTitle);
}
+
+ function testMenuTitleIsUnsetWhenEqualsTitle() {
+ $page = new SiteTree();
+ $page->Title = 'orig';
+ $page->MenuTitle = 'orig';
+ $page->write();
+
+ // change menu title
+ $page->MenuTitle = 'changed';
+ $page->write();
+ $page = SiteTree::get()->byID($page->ID);
+ $this->assertEquals('changed', $page->getField('MenuTitle'));
+
+ // change menu title back
+ $page->MenuTitle = 'orig';
+ $page->write();
+ $page = SiteTree::get()->byID($page->ID);
+ $this->assertEquals(null, $page->getField('MenuTitle'));
+ }
}

0 comments on commit c1aad0d

Please sign in to comment.