User tests: Successful: Unsuccessful:
Integration of the new feature made during the "Bug Squad" of the J&Beyond 2013 with Peter van Westen and myself.
The new feature allow to hide and show some elements in the configuration depending other configured elements. So the FTP options are not displayed if the FTP is not activated. Same thing for the SMTP/Sendmail options.
Different views in the configuration has been updated in order to use a new (generic) layout which support the "showon" option.
It would be great if this feature was available for the entire framework, not only in com_content and com_config.
I would like to add it on my own extension's Configuration.
@machadoug PR done, feel free to test
@Bakual,
Based on your changes I have tried to implement this in /libraries/joomla/form/field.php, getControlGroup() method, so it would be available for plugins as well, but I could not figure it out why it did not work.
Can you submit a Pull Request with that feature?
Here is what I've done, but it did not work.
public function getControlGroup()
{
if ($this->hidden)
{
return $this->getInput();
}
$class = '';
$rel = '';
if ($showon = $this->getAttribute('showon')) :
JHtml::_('jquery.framework');
JHtml::_('script', 'jui/cms.js', false, true);
if($this->formControl){
$id = $this->formControl;
}else{
$id = '';
}
$showon = explode(':', $showon, 2);
$class = ' showon_' . implode(' showon_', explode(',', $showon[1]));
$rel = ' rel="showon_' . $id . '['. $showon[0] . ']"';
endif;
return
'<div class="control-group'.$class.'"'.$rel.'>'
. '<div class="control-label">' . $this->getLabel() . '</div>'
. '<div class="controls">' . $this->getInput() . '</div>'
. '</div>';
}
Thanks for your help.
Feature Tracker:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8549&tracker_item_id=31100