mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
b12a00c391
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73509 467b73ca-7a2a-4603-9d3b-597d59a354a9
30 lines
802 B
PHP
30 lines
802 B
PHP
<?php
|
|
/**
|
|
* This is a form decorator that lets you place a form inside another form.
|
|
* The actions will be appropriately rewritten so that the nested form gets called, rather than the parent form.
|
|
*
|
|
* @package sapphire
|
|
* @subpackage forms
|
|
*/
|
|
class NestedForm extends ViewableData {
|
|
protected $form;
|
|
|
|
/**
|
|
* Represent the given form in a tabular style
|
|
* @param form The form to decorate.
|
|
*/
|
|
function __construct(Form $form) {
|
|
$this->form = $form;
|
|
$this->failover = $form;
|
|
parent::__construct();
|
|
}
|
|
|
|
function Actions() {
|
|
$actions = $this->form->Actions();
|
|
foreach($actions as $action) {
|
|
$action->setFullAction('action_' . $action->actionName()
|
|
.'?formController=' . str_replace(array('?','.'), array('&','%2e'), $this->form->FormAction()) );
|
|
}
|
|
return $actions;
|
|
}
|
|
} |