Page 1 of 1

Differences: template options radio vs. boolean for t/f

Posted: Thu Mar 13, 2008 3:43 pm
by Don Chambers
In bulletproof, many of our template options are radio buttons like this:

Code: Select all

    array(
        'var'           => 'firbtitle',
        'name'          => FIR_BTITLE,
        'type'          => 'radio',
        'radio'         => array('value' => array('true', 'false'),
                                 'desc'  => array(YES, NO)),
        'default'       => 'true',
    ),
But they could just have easily been this:

Code: Select all

    array(
        'var'           => 'firbtitle',
        'name'          => FIR_BTITLE,
        'type'          => 'boolean',
        'default'       => 'true',
    );
What is the real implication? I know we get a language variable with the type=radio.... does that not happen with a boolean or is there some other difference, or are these methods otherwise identical?

Re: Differences: template options radio vs. boolean for t/f

Posted: Thu Mar 13, 2008 4:19 pm
by garvinhicking
Hi!
What is the real implication?
Not really any, just a matter of personal preference. Like if you write "Hello!" or "Hi!" in your emails. ;-)

Regards,
Garvin

Posted: Thu Mar 13, 2008 5:41 pm
by Don Chambers
Thanks Garvin - seems boolean changes by language settings too. Think I will use that one from now on instead of the array with yes/no.

Posted: Fri Mar 14, 2008 9:56 am
by garvinhicking
Hi!
Don Chambers wrote:Thanks Garvin - seems boolean changes by language settings too. Think I will use that one from now on instead of the array with yes/no.
Yeah, that's less to type :)

Regards,
Garvin

Posted: Fri Mar 14, 2008 10:38 am
by yellowled
garvinhicking wrote:
Don Chambers wrote:Thanks Garvin - seems boolean changes by language settings too. Think I will use that one from now on instead of the array with yes/no.
Yeah, that's less to type :)
Jeez, there are 19 instances of this in BP's config.inc.php ... I'll edit and commit that asap.

YL

Posted: Fri Mar 14, 2008 2:43 pm
by Don Chambers
Guess you are going to beat me to it YL - which is fine as I am trying to track down something else!

Posted: Fri Mar 14, 2008 3:33 pm
by yellowled
Don Chambers wrote:Guess you are going to beat me to it YL
I already did :)
Don Chambers wrote:which is fine as I am trying to track down something else!
You know, sometimes these things would maybe be easier to solve if you were a tad more elaborate.

YL

Posted: Fri Mar 14, 2008 5:07 pm
by Don Chambers
yellowled wrote:
Don Chambers wrote:which is fine as I am trying to track down something else!
You know, sometimes these things would maybe be easier to solve if you were a tad more elaborate.

YL
Sorry for being vague - problem I am trying to track down has nothing to do with bp.