Recent Topics

Conditional Plugin Settings

Started by on Feb 23, 2011 – Contents updated: Feb 23, 2011

Feb 23, 2011 12:59    

PHP

function GetDefaultSettings( & $params 
    {
$DefaultSettings array(
                    'setting1' => array(),
 
      //setting 2 should be available only if setting 1 is true
if  ($this->Settings->get'txtr_setting1' ) {
 
'setting2' => array(),
  )
return $DefaultSettings ;
}

How can you make a plugin/skin setting available depending on some other option ?

Feb 28, 2011 02:54

Check out the test plugin. There's a decent example of a setting based on another setting.

Feb 28, 2011 04:28

Afwas wrote:

Check out the test plugin. There's a decent example of a setting based on another setting.

thanks, i sure will.
Nice to see you here :D

Mar 22, 2011 12:16

You have to use javascript for this. Ministats plugin does it perfectly (widget settings).

This should work too

PHP

function GetDefaultSettings( & $params )  
{
    $r[] = array'setting1' => array() );
 
    if( $whatever )
    {
        $r[] = array'setting2' => array() );
    }
 
    return $r;
}


Form is loading...

Free CMS – This forum is powered by b2evolution CMS, a complete engine for your website.