Success

User tests: Successful: Unsuccessful:

avatar obsidev
obsidev
5 Jun 2013

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.

avatar obsidev obsidev - open - 5 Jun 2013
avatar machadoug machadoug - close - 28 Jun 2013
avatar infograf768 infograf768 - close - 28 Jun 2013
avatar garyamort garyamort - reference | - 2 Dec 13
avatar machadoug
machadoug - comment - 27 Jan 2014

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.

avatar Bakual
Bakual - comment - 27 Jan 2014

@machadoug PR done, feel free to test :smile:

avatar machadoug
machadoug - comment - 27 Jan 2014

@Bakual, Nicely done!
Worked correctly.

Thanks for implementing it.

avatar machadoug
machadoug - comment - 4 Mar 2014

@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.

avatar Bakual
Bakual - comment - 4 Mar 2014

There is already a PR done by Marko D: #3127

Add a Comment

Login with GitHub to post a comment