$this->compile_check = !empty($globals->debug);
$this->changeTpl($tpl, $type);
- $this->_errors = array();
+ $this->_errors = array('errors' => array());
$this->_jsonVars = array();
$this->_failure = false;
if ($globals->mode != 'rw') {
- $this->_errors[] = "En raison d'une maintenance, une partie des fonctionnalités du site sont actuellement"
- . " désactivée, en particuliers aucune donnée ne sera sauvegardée";
+ $this->trig("En raison d'une maintenance, une partie des fonctionnalités du site sont"
+ . " actuellement désactivée, en particuliers aucune donnée ne sera sauvegardée");
}
$this->register_prefilter('at_to_globals');
$this->addJsLink('xorg.js');
$this->register_prefilter('form_force_encodings');
$this->register_prefilter('wiki_include');
$this->register_prefilter('if_has_perms');
- $this->assign('xorg_errors', $this->_errors);
+ $this->assign('xorg_triggers', $this->_errors);
+ $this->assign('xorg_errors', $this->nb_errs());
$this->assign('xorg_failure', $this->_failure);
$this->assign('globals', $globals);
public function nb_errs()
{
- return count($this->_errors);
+ return count($this->_errors['errors']);
}
// }}}
// {{{ function trig()
- public function trig($msg)
+ public function trig($msg, $type = 'errors')
{
- $this->_errors[] = $msg;
+ if (!isset($this->_errors[$type])) {
+ $this->_errors[$type] = array();
+ }
+ $this->_errors[$type][] = $msg;
+ }
+
+ public function trigError($msg)
+ {
+ $this->trig($msg, 'errors');
+ }
+
+ public function trigSuccess($msg)
+ {
+ $this->trig($msg, 'success');
}
// }}}
text-align: justify;
}
+.errors {
+ margin-top: 10px;
+ border: 1px solid #f00;
+ background-color: #fcc;
+ width: 98%;
+}
+
+.success {
+ margin-top: 10px;
+ border: 1px solid #0d2;
+ background-color: #cfd;
+ width: 98%;
+}
+
.erreur {
font-weight: bold;
color: #ff0000;
text-indent: 0;
}
+.errors {
+ width: 98%;
+ border: 1px solid #f00;
+ margin-top: 10px;
+ background-color: #200;
+}
+
+.success {
+ width: 98%;
+ border: 1px solid #0d3;
+ margin-top: 10px;
+ background-color: #021;
+}
+
.erreur {
font-weight: bold;
color: #d00;
text-align: justify;
}
+.errors {
+ margin-top: 10px;
+ border: 1px solid #f00;
+ background-color: #fcc;
+ width: 98%;
+}
+
+.success {
+ margin-top: 10px;
+ border: 1px solid #0d2;
+ background-color: #cfd;
+ width: 98%;
+}
+
.erreur {
font-weight: bold;
color: #ff0000;
<div style="clear: both"></div>
</div>
<div class="wiz_content" style="clear: both">
- {foreach from=$xorg_errors item=err}
- <div class="erreur">{$err|smarty:nodefaults}</div>
- {/foreach}
+ {include file="skin/common.triggers.tpl"}
{include file=$wiz_page}
</div>
</div>
<h1>Télépaiements</h1>
-{if $smarty.request.op eq "submit" and !$xorg_errors|count}
+{if $smarty.request.op eq "submit" and !$xorg_errors}
<table class="bicol">
<tr>
{**************************************************************************}
-{if $formulaire eq 0 and !$xorg_errors|count}
+{if $formulaire eq 0 and !$xorg_errors}
{if !$simple}
{if !$advanced}
{include file=search/quick.form.tpl show_js=1}
{/if}
{if !$xorg_no_errors || $xorg_failure}
-{foreach from=$xorg_errors item=err}
-<div class="erreur">{$err|smarty:nodefaults}</div>
-{/foreach}
+{include file="skin/common.triggers.tpl"}
{/if}
{if !$xorg_failure && $xorg_tpl}{include file=$xorg_tpl}{/if}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2008 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 *}
+{* *}
+{**************************************************************************}
+
+{foreach from=$xorg_triggers key=type item=triggers}
+{if $triggers|@count}
+<div class="{$type}">
+ <ul>
+ {foreach from=$triggers item=err}
+ <li>{$err|smarty:nodefaults}</li>
+ {/foreach}
+ </ul>
+</div>
+{/if}
+{/foreach}
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}