function pl_error_handler($errno, $errstr, $errfile, $errline)
{
+ static $errortype;
if (!error_reporting())
return;
- $errortype = array (
- E_ERROR => "Error",
- E_WARNING => "Warning",
- E_PARSE => "Parsing Error",
- E_NOTICE => "Notice",
- E_CORE_ERROR => "Core Error",
- E_CORE_WARNING => "Core Warning",
- E_COMPILE_ERROR => "Compile Error",
- E_COMPILE_WARNING => "Compile Warning",
- E_USER_ERROR => "User Error",
- E_USER_WARNING => "User Warning",
- E_USER_NOTICE => "User Notice",
- E_STRICT => "Runtime Notice"
- );
+ if (!isset($errortype)) {
+ $errortype = array (
+ E_ERROR => "Error",
+ E_WARNING => "Warning",
+ E_PARSE => "Parsing Error",
+ E_NOTICE => "Notice",
+ E_CORE_ERROR => "Core Error",
+ E_CORE_WARNING => "Core Warning",
+ E_COMPILE_ERROR => "Compile Error",
+ E_COMPILE_WARNING => "Compile Warning",
+ E_USER_ERROR => "User Error",
+ E_USER_WARNING => "User Warning",
+ E_USER_NOTICE => "User Notice",
+ E_STRICT => "Runtime Notice"
+ );
+ }
global $globals;
if (isset($globals) && !$globals->debug) {
- if (strpos($errortype[$errno], 'Notice') !== false) {
+ if ($errno == E_NOTICE || $errno == E_USER_NOTICE || $errno == E_STRICT) {
return;
}
}
function pl_print_errors()
{
- print join("\n", $GLOBALS['pl_errors']);
+ if (!empty($GLOBALS['pl_errors'])) {
+ print join("\n", $GLOBALS['pl_errors']);
+ }
}
set_error_handler('pl_error_handler', E_ALL | E_STRICT);
-{**************************************************************************}\r
-{* *}\r
-{* Copyright (C) 2003-2007 Polytechnique.org *}\r
-{* http://opensource.polytechnique.org/ *}\r
-{* *}\r
-{* This program is free software; you can redistribute it and/or modify *}\r
-{* it under the terms of the GNU General Public License as published by *}\r
-{* the Free Software Foundation; either version 2 of the License, or *}\r
-{* (at your option) any later version. *}\r
-{* *}\r
-{* This program is distributed in the hope that it will be useful, *}\r
-{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}\r
-{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}\r
-{* GNU General Public License for more details. *}\r
-{* *}\r
-{* You should have received a copy of the GNU General Public License *}\r
-{* along with this program; if not, write to the Free Software *}\r
-{* Foundation, Inc., *}\r
-{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}\r
-{* *}\r
-{**************************************************************************}\r
-\r
-<h1>Mes groupes X sur Polytechnique.net</h1>\r
-\r
-{foreach from=$assos item="asso"}\r
-<div style="width:48%;float:left" >\r
-<fieldset style="margin:0.6em">\r
- <legend style="padding:4px"><strong><a href="http://www.polytechnique.net/login/{$asso.diminutif}">{$asso.nom}</a></strong></legend>\r
- {if $asso.has_logo}\r
- <img alt="[ LOGO ]" src="http://www.polytechnique.net/{$asso.diminutif}/logo"\r
- style="width: 30%; display: block; float: right;" />\r
- {/if}\r
- <ul style="padding-top:0px;padding-bottom:0px">\r
- <li><a href="http://www.polytechnique.net/{$asso.diminutif}/annuaire">annuaire</a></li>\r
- <li><a href="http://www.polytechnique.net/{$asso.diminutif}/trombi">trombino</a></li>\r
- <li><a href="http://www.polytechnique.net/{$asso.diminutif}/geoloc">carte</a></li>\r
- {if $asso.lists}\r
- <li><a href="http://www.polytechnique.net/{$asso.diminutif}/lists">listes mails</a></li>\r
- {/if}\r
- {if $asso.events}\r
- <li><a href="http://www.polytechnique.net/{$asso.diminutif}/events">{$asso.events} événement{if $asso.events > 1}s{/if}</a></li>\r
- {/if}\r
- {if !$asso.lists}\r
- <li style="display:block"> </li>\r
- {/if}\r
- {if !$asso.events}\r
- <li style="display:block"> </li>\r
- {/if}\r
- </ul>\r
-</fieldset>\r
-</div>\r
-{/foreach}\r
-\r
-<div class="spacer"></div>\r
-\r
-<p class="center">\r
-[<a href="http://www.polytechnique.net/login">Tous les groupes X</a>]\r
-</p>\r
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2007 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h1>Mes groupes X sur Polytechnique.net</h1>
+
+<p class="center">
+[<a href="http://www.polytechnique.net/login/plan">Tous les groupes X</a>]
+</p>
+
+{foreach from=$assos item="asso"}
+<div style="width:48%;float:left" >
+<fieldset style="margin:0.6em">
+ <legend style="padding:4px"><strong><a href="http://www.polytechnique.net/login/{$asso.diminutif}">{$asso.nom}</a></strong></legend>
+ {if $asso.has_logo}
+ <a href="http://www.polytechnique.net/login/{$asso.diminutif}" style="width: 30%; display: block; float: right; ">
+ <img alt="[ LOGO ]" src="http://www.polytechnique.net/{$asso.diminutif}/logo" style="width: 100%" />
+ </a>
+ {/if}
+ <ul style="padding-top:0px;padding-bottom:0px">
+ <li><a href="http://www.polytechnique.net/{$asso.diminutif}/annuaire">annuaire</a></li>
+ <li><a href="http://www.polytechnique.net/{$asso.diminutif}/trombi">trombino</a></li>
+ <li><a href="http://www.polytechnique.net/{$asso.diminutif}/geoloc">carte</a></li>
+ {if $asso.lists}
+ <li><a href="http://www.polytechnique.net/{$asso.diminutif}/lists">listes mails</a></li>
+ {/if}
+ {if $asso.events}
+ <li><a href="http://www.polytechnique.net/{$asso.diminutif}/events">{$asso.events} événement{if $asso.events > 1}s{/if}</a></li>
+ {/if}
+ {if !$asso.lists}
+ <li style="display:block"> </li>
+ {/if}
+ {if !$asso.events}
+ <li style="display:block"> </li>
+ {/if}
+ </ul>
+</fieldset>
+</div>
+{/foreach}
+
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}