Skip to content

Commit

Permalink
Added hint (placeholder) option
Browse files Browse the repository at this point in the history
Closes joomla#151
  • Loading branch information
laoneo committed Jun 21, 2016
1 parent 4947b1b commit 56ac05c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions administrator/components/com_fields/models/forms/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
<field name="label" type="text" label="COM_FIELDS_FIELD_LABEL_LABEL"
description="COM_FIELDS_FIELD_LABEL_DESC" class="input-xxlarge"
size="40" required="true" />
<field name="hint" type="text" label="COM_FIELDS_FIELD_HINT_LABEL"
description="COM_FIELDS_FIELD_HINT_DESC" class="input-xxlarge"
size="40" />
<field name="image" type="media" label="COM_FIELDS_FIELD_IMAGE_LABEL"
description="COM_FIELDS_FIELD_IMAGE_DESC" />
<field name="image_alt" type="text"
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_fields.ini
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ COM_FIELDS_FIELD_IMAGE_DESC="Image label."
COM_FIELDS_FIELD_IMAGE_LABEL="Image"
COM_FIELDS_FIELD_LABEL_DESC="The label of the field to display."
COM_FIELDS_FIELD_LABEL_LABEL="Label"
COM_FIELDS_FIELD_HINT_DESC="The hint if the field, also called placeholder."
COM_FIELDS_FIELD_HINT_LABEL="Hint"
COM_FIELDS_FIELD_LANGUAGE_DESC="Assign a language to this field."
COM_FIELDS_FIELD_NOTE_DESC="An optional note for the field."
COM_FIELDS_FIELD_NOTE_LABEL="Note"
Expand Down
1 change: 1 addition & 0 deletions libraries/joomla/form/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ public function appendXMLFieldTag ($field, DOMElement $parent, JForm $form)
$node->setAttribute('label', $field->label);
$node->setAttribute('description', $field->description);
$node->setAttribute('class', $field->class);
$node->setAttribute('hint', $field->params->get('hint', 0));
$node->setAttribute('required', $field->required ? 'true' : 'false');
$node->setAttribute('readonly', $field->params->get('readonly', 0) ? 'true' : 'false');

Expand Down

0 comments on commit 56ac05c

Please sign in to comment.