Quote from: ganeshXL at Dec 27, 2007, 02:34 AM
Wouldn’t you rather use $GLOBALS instead of $GLOBAL?
http://ch2.php.net/manual/en/reserved.variables.php#reserved.variables.globals
http://ch2.php.net/global
I tried to use it as mentioned in docs (-;
Using $GLOBALS changes nothing.
plugin (even simplier case):
---------
$e = &$modx->Event;
switch ($e->name) {
case "OnBeforeAddToGroup":
$GLOBALS[’groupsArray’][]=’stylists’;
break;
default :
return; // stop here
break;
}
---------
i’ve also changed a line in webloginpe class, register function from
if (count($groupArray > 0))
//(i havenot found any definition of what is $groupArray)
to
if (count($GLOBALS[’groupsArray’] > 0))
and my OnBeforeAddToGroup looks like this:
function OnBeforeAddToGroup($groups = array())
{
global $modx;
$parameters = array(’groups’ => $groups, ’wlpe’ => &$this); // pixelchutes - reference $wlpe instance);
$modx->invokeEvent(’OnBeforeAddToGroup’, $parameters);
}
ps: could anybody answer me how to debug plugin calls like this? How can i output some debug info?