Commit c352a1b8 authored by Evan Goldenberg's avatar Evan Goldenberg Committed by Francois Marier
Browse files

usability: add pieforms support for fieldset help, and use it for resume fields


Signed-off-by: default avatarEvan Goldenberg <evang@catalyst.net.nz>
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent fd095185
...@@ -80,13 +80,13 @@ $coverletterform = pieform(array( ...@@ -80,13 +80,13 @@ $coverletterform = pieform(array(
'cols' => 70, 'cols' => 70,
'rows' => 10, 'rows' => 10,
'defaultvalue' => ((!empty($coverletter)) ? $coverletter->get('description') : null), 'defaultvalue' => ((!empty($coverletter)) ? $coverletter->get('description') : null),
'help' => true,
), ),
'save' => array( 'save' => array(
'type' => 'submit', 'type' => 'submit',
'value' => get_string('save'), 'value' => get_string('save'),
), ),
) ),
'help' => true,
) )
) )
)); ));
...@@ -108,13 +108,13 @@ $interestsform = pieform(array( ...@@ -108,13 +108,13 @@ $interestsform = pieform(array(
'defaultvalue' => ((!empty($interest)) ? $interest->get('description') : null), 'defaultvalue' => ((!empty($interest)) ? $interest->get('description') : null),
'cols' => 70, 'cols' => 70,
'rows' => 10, 'rows' => 10,
'help' => true,
), ),
'save' => array( 'save' => array(
'type' => 'submit', 'type' => 'submit',
'value' => get_string('save'), 'value' => get_string('save'),
), ),
) ),
'help' => true,
) )
) )
)); ));
...@@ -134,9 +134,9 @@ $contactinformationform = pieform(array( ...@@ -134,9 +134,9 @@ $contactinformationform = pieform(array(
'contactinformation' => array( 'contactinformation' => array(
'type' => 'html', 'type' => 'html',
'value' => $contactinformation_value, 'value' => $contactinformation_value,
'help' => true,
), ),
) ),
'help' => true,
) )
) )
)); ));
......
...@@ -69,6 +69,16 @@ function pieform_element_fieldset(Pieform $form, $element) {/*{{{*/ ...@@ -69,6 +69,16 @@ function pieform_element_fieldset(Pieform $form, $element) {/*{{{*/
else { else {
$result .= '>' . Pieform::hsc($element['legend']); $result .= '>' . Pieform::hsc($element['legend']);
} }
// Help icon
if (!empty($element['help'])) {
$function = $form->get_property('helpcallback');
if (function_exists($function)) {
$result .= $function($form, $element);
}
else {
$result .= '<span class="help"><a href="" title="' . Pieform::hsc($element['help']) . '" onclick="return false;">?</a></span>';
}
}
$result .= "</legend>\n"; $result .= "</legend>\n";
} }
......
...@@ -332,7 +332,7 @@ fieldset.collapsed table { ...@@ -332,7 +332,7 @@ fieldset.collapsed table {
border: 0; border: 0;
margin: 0; margin: 0;
} }
fieldset legend a { fieldset.collapsible legend a {
padding-left: 15px; padding-left: 15px;
background: url(../images/icon_fieldset_down.gif) 2px center no-repeat; background: url(../images/icon_fieldset_down.gif) 2px center no-repeat;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment