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:
Andrew Short 2009-10-11 00:08:03 +00:00 committed by Sam Minnee
parent ed127fabf3
commit 5ff81a3e51

12
code/ModelAdmin.php Normal file → Executable file
View 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));
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////