Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT Removed automatic redirection to admin URLs in ContentCon…

…troller, too counter-intuitive and hard to implement consistently, while still allowing linkage of pages without CMS around them. Use $SilverStripeNavigator in custom Page.ss to link a page to its admin view for logged-in users.
  • Loading branch information...
commit dacdade4b0c8628a482591702e98788f45037f50 1 parent 6d26a88
@chillu chillu authored
View
2  admin/code/LeftAndMain.php
@@ -1122,7 +1122,7 @@ public function isCurrentPage(DataObject $record) {
public function PreviewLink() {
$record = $this->getRecord($this->currentPageID());
$baseLink = ($record && $record instanceof Page) ? $record->Link('?stage=Stage') : Director::absoluteBaseURL();
- return Controller::join_links($baseLink, '?cms-preview-disabled=1');
+ return $baseLink;
}
/**
View
11 admin/javascript/LeftAndMain.Preview.js
@@ -47,7 +47,6 @@
// var url = ui.xmlhttp.getResponseHeader('x-frontend-url');
var url = $('.cms-edit-form').find(':input[name=StageURLSegment]').val();
if(url) {
- url = url.replace(/\?.*/, '') + jQuery.query.load(url).set('cms-preview-disabled', '1').toString();
self.loadUrl(url);
self.unblock();
} else {
@@ -109,14 +108,8 @@
var href = links[i].getAttribute('href');
if(!href) continue;
- if (href.match(/^http:\/\//)) {
- // Disable external links
- links[i].setAttribute('href', 'javascript:false');
- } else {
- // Add GET parameter to internal links to avoid double redirects and infinitely nested CMS UIs
- var previewUrl = href.replace(/\?.*/, '') + jQuery.query.load(href).set('cms-preview-disabled', '1').toString();
- links[i].setAttribute('href', previewUrl);
- }
+ // Disable external links
+ if (href.match(/^http:\/\//)) links[i].setAttribute('href', 'javascript:false');
}
},
Please sign in to comment.
Something went wrong with that request. Please try again.