added rfe #740: Thingy Pre-Text

This commit is contained in:
Yung Han Khoe 2008-10-20 16:08:09 +00:00
parent 0b21273065
commit 9e2ec505c0
7 changed files with 54 additions and 7 deletions

View file

@ -634,7 +634,13 @@ sub getEditFieldForm {
});
$f->raw($self->getHtmlWithModuleWrapper($dialogPrefix."_defaultValue_module",$defaultValueForm,
$i18n->get('default value label'),$i18n->get('default value description')));
$f->text(
-name=>"pretext",
-value=>$field->{pretext},
-label=>$i18n->get('pretext label'),
-hoverHelp=>$i18n->get('pretext description'),
);
$f->text(
-name=>"subtext",
-value=>$field->{subtext},
@ -1603,6 +1609,9 @@ sub www_editThing {
else{
$formElement = $self->getFormElement($field);
}
if ($field->{pretext}){
$formElement = '<span class="formPretext">'.$field->{pretext}.'</span><br />'.$formElement;
}
if ($field->{subtext}){
$formElement .= '<br /><span class="formSubtext">'.$field->{subtext}.'</span>';
}
@ -1997,6 +2006,7 @@ sub www_editFieldSave {
fieldType=>$fieldType,
defaultValue=>$defaultValue,
possibleValues=>$self->session->form->process("possibleValues"),
pretext=>$self->session->form->process("pretext"),
subtext=>$self->session->form->process("subtext"),
status=>$self->session->form->process("status"),
size=>$self->session->form->process("size"),
@ -2030,6 +2040,9 @@ sub www_editFieldSave {
else{
$formElement = $self->getFormElement(\%properties);
}
if ($properties{pretext}){
$formElement = '<span class="formSubtext">'.$properties{pretext}.'</span><br />'.$formElement;
}
if ($properties{subtext}){
$formElement .= '<br /><span class="formSubtext">'.$properties{subtext}.'</span>';
}
@ -2243,6 +2256,7 @@ sub editThingData {
"isHidden" => $hidden,
"isVisible" => ($field{status} eq "visible" && !$hidden),
"isRequired" => ($field{status} eq "required" && !$hidden),
"pretext" => $field{pretext},
"subtext" => $field{subtext},
);
push(@field_loop, { map {("field_".$_ => $fieldProperties{$_})} keys(%fieldProperties) });

View file

@ -73,6 +73,7 @@ our $HELP = {
{ 'name' => 'field_name' },
{ 'name' => 'field_value' },
{ 'name' => 'field_subtext' },
{ 'name' => 'field_pretext' },
],
},
{ 'name' => 'listOfThings',

View file

@ -464,15 +464,28 @@ this field using a hash, then the default value has to be a key in that hash, an
lastUpdated => 1031514049
},
'subtext description' => {
message => q|An extension of the label, this is additional information such as a description of what should go in the field or optional instructions for the field.|,
lastUpdated => 1133811301,
'subtext description' => {
message => q|An extension of the label, this is additional information such as a description of what should
go in the field or optional instructions for the field. It will be displayed below/after the form element.|,
lastUpdated => 1224518799,
},
'pretext label' => {
message => q|Pre-text|,
lastUpdated => 1224518799,
},
'pretext description' => {
message => q|An extra extension of the label, this is additional information such as a description of what should
go in the field or optional instructions for the field. It will be displayed above/before the form element.|,
lastUpdated => 1224518799,
},
'fieldstatus hidden label' => {
message => q|Hidden|,
lastUpdated => 1031514049
},
'fieldstatus visible label' => {
message => q|Visible|,
lastUpdated => 1031514049
@ -812,9 +825,16 @@ field.|,
lastUpdated => 1104630516,
},
'field_pretext' => {
message => q|An extra description of the field so that users know what to put in the field. To be
displayed above/before the form element.|,
lastUpdated => 1224518799,
},
'field_subtext' => {
message => q|A description of the field so that users know what to put in the field.|,
lastUpdated => 1104630516,
message => q|A description of the field so that users know what to put in the field. To be displayed
below/after the form element.|,
lastUpdated => 1224518799,
},
'form_start' => {