mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT Allow setting of the legend value in the Form template by use of Form->setLegend('my legend')
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@67422 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
5f7f762f7a
commit
33960f1af3
@ -63,6 +63,15 @@ class Form extends RequestHandler {
|
|||||||
*/
|
*/
|
||||||
protected $target;
|
protected $target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Legend value, to be inserted into the
|
||||||
|
* <legend> element before the <fieldset>
|
||||||
|
* in Form.ss template.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $legend;
|
||||||
|
|
||||||
protected $buttonClickedFunc;
|
protected $buttonClickedFunc;
|
||||||
|
|
||||||
protected $message;
|
protected $message;
|
||||||
@ -456,7 +465,15 @@ class Form extends RequestHandler {
|
|||||||
function setTarget($target) {
|
function setTarget($target) {
|
||||||
$this->target = $target;
|
$this->target = $target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the legend value to be inserted into
|
||||||
|
* the <legend> element in the Form.ss template.
|
||||||
|
*/
|
||||||
|
function setLegend($legend) {
|
||||||
|
$this->legend = $legend;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the encoding type of the form.
|
* Returns the encoding type of the form.
|
||||||
* This will be either "multipart/form-data"" if there are any {@link FileField} instances,
|
* This will be either "multipart/form-data"" if there are any {@link FileField} instances,
|
||||||
@ -662,6 +679,16 @@ class Form extends RequestHandler {
|
|||||||
function getRecord() {
|
function getRecord() {
|
||||||
return $this->record;
|
return $this->record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the legend value to be inserted into the
|
||||||
|
* <legend> element in Form.ss
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getLegend() {
|
||||||
|
return $this->legend;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processing that occurs before a form is executed.
|
* Processing that occurs before a form is executed.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
|
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend></legend>
|
<legend>$Legend</legend>
|
||||||
<% control Fields %>
|
<% control Fields %>
|
||||||
$FieldHolder
|
$FieldHolder
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user