mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
REFACTOR: Remove duplication and set SiteTree instances to use generic CMSEditLink()
This commit is contained in:
parent
d85cc24aa0
commit
58795a2324
@ -1690,10 +1690,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
/** @var SiteTree $item */
|
||||
$title = sprintf(
|
||||
'<a class="action-detail" href="%s">%s</a>',
|
||||
Controller::join_links(
|
||||
CMSPageEditController::singleton()->Link('show'),
|
||||
(int)$item->ID
|
||||
),
|
||||
$item->CMSEditLink(),
|
||||
$item->TreeTitle // returns HTML, does its own escaping
|
||||
);
|
||||
$breadcrumbs = $item->Breadcrumbs(20, true, false, true, '/');
|
||||
@ -2101,7 +2098,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
// Can be used in different contexts: In normal page edit view, in which case the redirect won't have any effect.
|
||||
// Or in history view, in which case a revert causes the CMS to re-load the edit view.
|
||||
// The X-Pjax header forces a "full" content refresh on redirect.
|
||||
$url = Controller::join_links(CMSPageEditController::singleton()->Link('show'), $record->ID);
|
||||
$url = $record->CMSEditLink();
|
||||
$this->getResponse()->addHeader('X-ControllerURL', $url);
|
||||
$this->getRequest()->addHeader('X-Pjax', 'Content');
|
||||
$this->getResponse()->addHeader('X-Pjax', 'Content');
|
||||
@ -2287,7 +2284,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
array('title' => $newPage->Title)
|
||||
))
|
||||
);
|
||||
$url = Controller::join_links(CMSPageEditController::singleton()->Link('show'), $newPage->ID);
|
||||
$url = $newPage->CMSEditLink();
|
||||
$this->getResponse()->addHeader('X-ControllerURL', $url);
|
||||
$this->getRequest()->addHeader('X-Pjax', 'Content');
|
||||
$this->getResponse()->addHeader('X-Pjax', 'Content');
|
||||
@ -2325,7 +2322,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
array('title' => $newPage->Title)
|
||||
))
|
||||
);
|
||||
$url = Controller::join_links(CMSPageEditController::singleton()->Link('show'), $newPage->ID);
|
||||
$url = $newPage->CMSEditLink();
|
||||
$this->getResponse()->addHeader('X-ControllerURL', $url);
|
||||
$this->getRequest()->addHeader('X-Pjax', 'Content');
|
||||
$this->getResponse()->addHeader('X-Pjax', 'Content');
|
||||
|
Loading…
Reference in New Issue
Block a user