[dev] Re: [cvs] commit: imp folders.php
Jon Parise
jon at horde.org
Wed Dec 31 11:39:27 PST 2003
On Wed, Dec 24, 2003 at 01:25:55PM -0800, Michael M Slusarz wrote:
> slusarz 2003/12/24 13:25:55 PST
>
> Modified files:
> . folders.php
> Log:
> Various cleanups.
>
> Revision Changes Path
> 2.236 +15 -18 imp/folders.php
>
> Chora Links:
> http://cvs.horde.org/diff.php/imp/folders.php?r1=2.235&r2=2.236&ty=u
I'm not sure I like this that much:
function _initializeTree(&$imptree, $showall)
{
- global $prefs;
+ global $subscribe, $prefs;
- $imptree->init($prefs->getValue('subscribe') && !$showall);
+ $imptree->init($subscribe && !$showall);
We're now calling $imptree->init() with a global $subscribe and a
$showall parameter. Both $subscribe and $showall are globals, though.
Here's the (current) call to _initializeTree():
/* Decide whether or not to show all the unsubscribed folders */
$subscribe = $prefs->getValue('subscribe');
$showAll = ($subscribe && isset($imp['showunsub'])) ?
$imp['showunsub'] : false;
/* Initialize the IMP_Tree object. */
$imptree = &IMP_Tree::IMP_Tree_Cache();
if (empty($imptree)) {
$imptree = &new IMP_Tree($imp['dotfiles'], $imp['hierarchies']);
_initializeTree($imptree, $showAll);
}
I'd prefer that either $subscribe and $showAll were both passed in as
parameters or _initializeTree() referenced both of them as globals.
--
Jon Parise (jon at horde.org) :: The Horde Project (http://horde.org/)
More information about the dev
mailing list