[imp] using $browser->getBrowser() from within imp/config/prefs.php?

liamr@umich.edu liamr@umich.edu
Tue, 13 Aug 2002 22:53:02 -0400


Hey guys -

I'm trying to preset some user preferences depending on browser version (ie 
"auto_expand"), but I get this:

[13-Aug-2002 22:09:29] PHP Fatal error:
    Call to a member function on a non-object in 
    /usr/local/projects/webmail/html-ssl/horde-2.1UM/imp/config/prefs.php
    on line 759

I was trying to do something like:

if ( ($browser->getBrowser() == 'msie' 
    || $browser->getBrowser() == 'mozilla') 
    && $browser->majorVersion >= 5) {
    $_prefs['auto_expand'] = array(
        'value' => 1,
        'locked' => false,
        'shared' => false,
        'type' => 'checkbox',
        'desc' => _("Expand names in the compose window automatically in the 
                    background?")
    );
} else {
    $_prefs['auto_expand'] = array(
...some other stuff...
};

This may be a basic php syntax problem, but should I be able to do something 
like this?

Liam