Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

API CHANGE Using Controller::join_links() to construct links in Compl…

…exTableField and TableListField (partially merged from r88495, r96775)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@113321 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 2d1d5363c8b931994e27aa525e71b53a641de135 1 parent 09d25b0
@chillu chillu authored sminnee committed
Showing with 12 additions and 12 deletions.
  1. +12 −12 forms/ComplexTableField.php
View
24 forms/ComplexTableField.php
@@ -364,7 +364,7 @@ function sourceID() {
function AddLink() {
- return $this->Link() . '/add';
+ return Controller::join_links($this->Link(), 'add');
}
/**
@@ -651,7 +651,7 @@ function saveComplexTableField($data, $form, $params) {
$message = sprintf(
_t('ComplexTableField.SUCCESSADD', 'Added %s %s %s'),
$childData->singular_name(),
- '<a href="' . $this->Link() . '/item/' . $childData->ID . '/edit">' . $childData->Title . '</a>',
+ '<a href="' . Controller::join_links($this->Link(), 'item', $childData->ID, 'edit') . '">' . $childData->Title . '</a>',
$closeLink
);
@@ -675,7 +675,7 @@ class ComplexTableField_ItemRequest extends RequestHandler {
);
function Link() {
- return $this->ctf->Link() . '/item/' . $this->itemID;
+ return Controller::join_links($this->ctf->Link(), 'item', $this->itemID);
}
function __construct($ctf, $itemID) {
@@ -838,7 +838,7 @@ function PopupFirstLink() {
}
$start = 0;
- return Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}");
+ return Controller::join_links($this->Link(), $this->methodName, "?ctf[start]={$start}");
}
function PopupLastLink() {
@@ -847,7 +847,7 @@ function PopupLastLink() {
}
$start = $this->totalCount - 1;
- return Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}");
+ return Controller::join_links($this->Link(), $this->methodName, "?ctf[start]={$start}");
}
function PopupNextLink() {
@@ -856,7 +856,7 @@ function PopupNextLink() {
}
$start = $_REQUEST['ctf']['start'] + 1;
- return Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}");
+ return Controller::join_links($this->Link(), $this->methodName, "?ctf[start]={$start}");
}
function PopupPrevLink() {
@@ -865,7 +865,7 @@ function PopupPrevLink() {
}
$start = $_REQUEST['ctf']['start'] - 1;
- return Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}");
+ return Controller::join_links($this->Link(), $this->methodName, "?ctf[start]={$start}");
}
/**
@@ -888,7 +888,7 @@ function Pagination() {
}
for($i = $offset;$i <= $offset + $this->pageSize && $i <= $this->totalCount;$i++) {
$start = $i - 1;
- $links['link'] = Controller::join_links($this->Link() . "$this->methodName?ctf[start]={$start}");
+ $links['link'] = Controller::join_links($this->Link(), $this->methodName, "?ctf[start]={$start}");
$links['number'] = $i;
$links['active'] = $i == $currentItem ? false : true;
$result->push(new ArrayData($links));
@@ -988,19 +988,19 @@ function __construct(DataObject $item, ComplexTableField $parent, $start) {
}
function Link() {
- return $this->parent->Link() . '/item/' . $this->item->ID;
+ return Controller::join_links($this->parent->Link(), 'item', $this->item->ID);
}
function EditLink() {
- return $this->Link() . "/edit";
+ return Controller::join_links($this->Link(), "edit");
}
function ShowLink() {
- return $this->Link() . "/show";
+ return Controller::join_links($this->Link(), "show");
}
function DeleteLink() {
- return $this->Link() . "/delete";
+ return Controller::join_links($this->Link(), "delete");
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.