mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Refactored CMS page-URL accessing to use ->AbsoluteLink(), which can be overridden by defining alternateAbsoluteLink()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41283 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
df2b2f695a
commit
1bd7dce68a
@ -282,8 +282,14 @@ JS;
|
||||
|
||||
$idField->setValue($id);
|
||||
|
||||
if($record->ID && is_numeric( $record->ID ) ) $liveURLField->setValue(DB::query("SELECT URLSegment FROM SiteTree_Live WHERE ID = $id")->value());
|
||||
if(!$record->DeletedFromStage) $stageURLField->setValue($record->URLSegment);
|
||||
if($record->ID && is_numeric( $record->ID ) ) {
|
||||
$liveRecord = Versioned::get_one_by_stage('SiteTree', 'Live', "`SiteTree`.ID = $record->ID");
|
||||
if($liveRecord) $liveURLField->setValue($liveRecord->AbsoluteLink());
|
||||
}
|
||||
|
||||
if(!$record->DeletedFromStage) {
|
||||
$stageURLField->setValue($record->AbsoluteLink());
|
||||
}
|
||||
|
||||
// getAllCMSActions can be used to completely redefine the action list
|
||||
if($record->hasMethod('getAllCMSActions')) {
|
||||
|
@ -433,7 +433,7 @@ StageLink.prototype = {
|
||||
var linkVal = linkField ? linkField.value : null;
|
||||
if(linkVal) {
|
||||
if(this.id != 'viewArchivedSite') this.style.display = '';
|
||||
this.href = this.baseURL() + linkVal + '/' + this.getVars;
|
||||
this.href = linkVal + this.getVars;
|
||||
} else {
|
||||
if(this.id != 'viewArchivedSite') this.style.display = 'none';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user