From: Stéphane Jacob Date: Tue, 20 Jan 2009 20:13:23 +0000 (+0100) Subject: Gives nicer display to the MySQL errors gathering page. X-Git-Tag: core/1.0.1~30 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=02c018dd176578c612327219a1564c4b29e7b4db;p=platal.git Gives nicer display to the MySQL errors gathering page. --- diff --git a/modules/core.php b/modules/core.php index 5aec747..7d537c5 100644 --- a/modules/core.php +++ b/modules/core.php @@ -176,19 +176,18 @@ class CoreModule extends PLModule exit; } - function handler_sqlerror(&$page, $clear = null) { + function handler_sqlerror(&$page) { global $globals; + $page->coreTpl('sql_errors.tpl'); $file = @fopen($globals->spoolroot . '/spool/tmp/query_errors', 'r'); if ($file !== false) { - echo ''; - fpassthru($file); + $page->assign('errors', fpassthru($file)); fclose($file); - echo ''; } - if ($clear == 'clear') { + if (Post::has('clear')) { @unlink($globals->spoolroot . '/spool/tmp/query_errors'); + $page->trigSuccess("Erreurs MySQL effacées."); } - exit; } } diff --git a/templates/sql_errors.tpl b/templates/sql_errors.tpl new file mode 100644 index 0000000..d7eb9de --- /dev/null +++ b/templates/sql_errors.tpl @@ -0,0 +1,38 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2009 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 *} +{* *} +{**************************************************************************} + +

Erreurs MySQL

+

+ {if $errors} + {$errors} + {else} + Il n'y pas d'erreurs actuellement recencées. + {/if} +

+
+
+ +
+
+ + +{* vim:set et sws=2 sts=2 sw=2 enc=utf-8: *}