mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02: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;
|
||||
|
||||
/**
|
||||
* Legend value, to be inserted into the
|
||||
* <legend> element before the <fieldset>
|
||||
* in Form.ss template.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $legend;
|
||||
|
||||
protected $buttonClickedFunc;
|
||||
|
||||
protected $message;
|
||||
@ -456,7 +465,15 @@ class Form extends RequestHandler {
|
||||
function setTarget($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.
|
||||
* This will be either "multipart/form-data"" if there are any {@link FileField} instances,
|
||||
@ -662,6 +679,16 @@ class Form extends RequestHandler {
|
||||
function getRecord() {
|
||||
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.
|
||||
|
@ -7,7 +7,7 @@
|
||||
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
|
||||
<% end_if %>
|
||||
<fieldset>
|
||||
<legend></legend>
|
||||
<legend>$Legend</legend>
|
||||
<% control Fields %>
|
||||
$FieldHolder
|
||||
<% end_control %>
|
||||
|
Loading…
Reference in New Issue
Block a user