Permalink
Browse files

Merge branch '3.0-translation-compatibility-fixes' of git://github.co…

…m/tractorcow/silverstripe-cms into tractorcow-3.0-translation-compatibility-fixes

Conflicts:
	code/controllers/CMSMain.php
  • Loading branch information...
2 parents 2e791ab + 7807842 commit 0ec269f1bdcee821fc6a7f2cba13834d7d73d4ea @chillu chillu committed Aug 23, 2012
@@ -202,9 +202,10 @@ protected function LinkWithSearch($link) {
return $link;
}
- function LinkPageAdd() {
+ function LinkPageAdd($extraArguments = null) {
$link = singleton("CMSPageAddController")->Link();
$this->extend('updateLinkPageAdd', $link);
+ if($extraArguments) $link = Controller::join_links ($link, $extraArguments);
return $link;
}
@@ -719,9 +720,8 @@ public function ListViewForm() {
$num = $item ? $item->numChildren() : null;
if($num) {
return sprintf(
- '<a class="cms-panel-link list-children-link" data-pjax-target="ListViewForm,Breadcrumbs" href="%s?ParentID=%d&view=list">%s</a>',
- $controller->Link(),
- $item->ID,
+ '<a class="cms-panel-link list-children-link" data-pjax-target="ListViewForm,Breadcrumbs" href="%s">%s</a>',
+ Controller::join_links($controller->Link(), "?ParentID={$item->ID}&view=list"),
$num
);
}
@@ -22,7 +22,7 @@ $ExtraTreeTools
</div>
<% end_if %>
- <div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd}AddForm/?action_doAdd=1&amp;ParentID=%s&amp;PageType=%s&amp;SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-hints="$SiteTreeHints">
+ <div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1')}&amp;ParentID=%s&amp;PageType=%s&amp;SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-hints="$SiteTreeHints">
$SiteTreeAsUL
</div>
</div>
@@ -1,5 +1,5 @@
<div class="cms-actions-row">
- <a class="cms-page-add-button ss-ui-button ss-ui-action-constructive" data-icon="add" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd}?ParentID=%s"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
+ <a class="cms-page-add-button ss-ui-button ss-ui-action-constructive" data-icon="add" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd('?ParentID=%s')}"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
</div>
<div class="cms-content-batchactions">

0 comments on commit 0ec269f

Please sign in to comment.