mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX #3724: Updated Link() methods to accept an action parameter.
From: Andrew Short <andrewjshort@gmail.com> git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@88512 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ed127fabf3
commit
5ff81a3e51
12
code/ModelAdmin.php
Normal file → Executable file
12
code/ModelAdmin.php
Normal file → Executable file
@ -297,10 +297,11 @@ class ModelAdmin_CollectionController extends Controller {
|
||||
/**
|
||||
* Appends the model class to the URL.
|
||||
*
|
||||
* @return unknown
|
||||
* @param string $action
|
||||
* @return string
|
||||
*/
|
||||
function Link() {
|
||||
return Controller::join_links($this->parentController->Link(), "$this->modelClass");
|
||||
function Link($action = null) {
|
||||
$this->parentController->Link(Controller::join_links($this->modelClass, $action));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -853,10 +854,9 @@ class ModelAdmin_RecordController extends Controller {
|
||||
|
||||
/**
|
||||
* Link fragment - appends the current record ID to the URL.
|
||||
*
|
||||
*/
|
||||
function Link() {
|
||||
return Controller::join_links($this->parentController->Link(), "/{$this->currentRecord->ID}");
|
||||
public function Link($action = null) {
|
||||
return $this->parentController->Link(Controller::join_links($this->currentRecord->ID, $action));
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user