- $soup_menu = array('Mozilla/3','Mozilla/2','Mozilla/1', 'Opera 4',
- 'Opera/4', 'OmniWeb', 'Lynx');
- sqgetGlobalVar('HTTP_USER_AGENT', $user_agent, SQ_SERVER);
- foreach($soup_menu as $browser) {
- if(stristr($user_agent, $browser)) {
- return 1;
+ /* Loop over the plugins that registered the hook */
+ $currentHookName = $name;
+ foreach ($squirrelmail_plugin_hooks[$name] as $function) {
+ if (function_exists($function)) {
+ $ret = $function($parm);
+ if ($ret) {
+ $yea++;
+ } else {
+ $nay++;
+ }
+ }
+ }
+ $currentHookName = '';
+
+ /* Examine the aftermath and assign the return value appropriately */
+ if (($priority > 0) && ($yea)) {
+ $ret = true;
+ } elseif (($priority < 0) && ($nay)) {
+ $ret = false;
+ } elseif ($yea > $nay) {
+ $ret = true;
+ } elseif ($nay > $yea) {
+ $ret = false;
+ } else {
+ // There's a tie, no action needed.