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

Discussion corner for Developers of Serendipity.
Post Reply
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

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

Post 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?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post 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.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post 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!
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post 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.
=Don=
Post Reply