Skip to content

Commit

Permalink
backport radiobutton - create options from php code
Browse files Browse the repository at this point in the history
  • Loading branch information
pollen8 committed Jan 7, 2014
1 parent 953edf7 commit a37e601
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 10 deletions.
57 changes: 47 additions & 10 deletions plugins/fabrik_element/radiobutton/forms/fields.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,74 @@
<form>
<fields addfieldpath="/administrator/components/com_fabrik/models/fields" name="params">
<fieldset name="plg-element-radiobutton">

<field type="helplink"
url="PLG_ELEMENT_RADIO_HELP_SERVER" />

<field label="COM_FABRIK_SUBOPTIONS" name="sub_options" type="suboptions"/>
<field name="sub_options"
type="suboptions"
label="COM_FABRIK_SUBOPTIONS"/>

<field default="0" description="PLG_ELEMENT_RADIO_ELEMENT_BEFORE_LABEL_DESC" label="PLG_ELEMENT_RADIO_ELEMENT_BEFORE_LABEL_LABEL" name="radio_element_before_label" type="radio">
<field name="radio_element_before_label"
type="radio"
default="0"
description="PLG_ELEMENT_RADIO_ELEMENT_BEFORE_LABEL_DESC"
label="PLG_ELEMENT_RADIO_ELEMENT_BEFORE_LABEL_LABEL">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field default="4" label="PLG_ELEMENT_RADIO_OPTIONS_PER_ROW_LABEL" name="options_per_row" size="2" type="width"/>
<field name="options_per_row"
default="4"
class="input-mini"
label="PLG_ELEMENT_RADIO_OPTIONS_PER_ROW_LABEL"
size="2"
type="width"/>

</fieldset>

<fieldset label="PLG_ELEMENT_RADIO_FRONT_END_ADDITIONS" name="plg-radiobutton-add">
<field default="0" description="PLG_ELEMENT_RADIO_ADD_OPTION_DESC" label="PLG_ELEMENT_RADIO_ADD_OPTION_LABEL" name="allow_frontend_addtoradio" type="radio">

<field name="allow_frontend_addtoradio"
type="radio"
default="0"
class="btn-group"
description="PLG_ELEMENT_RADIO_ADD_OPTION_DESC"
label="PLG_ELEMENT_RADIO_ADD_OPTION_LABEL">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field default="0" description="PLG_ELEMENT_RADIO_ONLY_ADD_LABEL_DESC" label="PLG_ELEMENT_RADIO_ONLY_ADD_LABEL_LABEL" name="rad-allowadd-onlylabel" type="radio">

<field name="rad-allowadd-onlylabel"
type="radio"
default="0"
class="btn-group"
description="PLG_ELEMENT_RADIO_ONLY_ADD_LABEL_DESC"
label="PLG_ELEMENT_RADIO_ONLY_ADD_LABEL_LABEL">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field default="0" description="PLG_ELEMENT_RADIO_SAVE_NEW_ADDITIONS_DESC" label="PLG_ELEMENT_RADIO_SAVE_NEW_ADDITIONS_LABEL" name="rad-savenewadditions" type="radio">

<field name="rad-savenewadditions"
type="radio"
default="0"
class="btn-group"
description="PLG_ELEMENT_RADIO_SAVE_NEW_ADDITIONS_DESC"
label="PLG_ELEMENT_RADIO_SAVE_NEW_ADDITIONS_LABEL">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>


</fieldset>

<fieldset label="Advanced" name="plg-dropdown-advanced">

<field name="dropdown_populate"
type="fabrikeditor"
mode="php"
description="PLG_ELEMENT_RADIO_POPULATE_DESC"
label="PLG_ELEMENT_RADIO_POPULATE_LABEL" />

</fieldset>
</fields>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ PLG_ELEMENT_RADIO_ONLY_ADD_LABEL_LABEL="Only add label"
PLG_ELEMENT_RADIO_OPTIONS_PER_ROW_LABEL="Options per row"
PLG_ELEMENT_RADIO_SAVE_NEW_ADDITIONS_DESC="If yes selected then any new sub-options created by the user are available for others to select. If NO selected you MUST select 'yes' for the 'only add label' option"
PLG_ELEMENT_RADIO_SAVE_NEW_ADDITIONS_LABEL="Save new additions"
PLG_ELEMENT_RADIO_POPULATE_DESC="PHP Code to create options, should return an array of JHTML select.options,<pre> e.g. return array(JHTML: :_('select.option', '1', 'one'));</pre>."
PLG_ELEMENT_RADIO_POPULATE_LABEL="Eval populate"

;front end
PLG_ELEMENT_RADIO_ENTER_VALUE_LABEL="Please enter a value and/or label"

0 comments on commit a37e601

Please sign in to comment.