From 9ebd7594408dd96a58b10de4de156d58bb124ecd Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Thu, 1 Nov 2007 21:14:16 +0100 Subject: [PATCH] Use {$global->..->NbIns} instead of {insert name="getNbIns"} Signed-off-by: Florent Bruneau --- ...sert.getNbIns.php => modifier.number_format.php} | 21 +++------------------ templates/skin/common.title.header.tpl | 4 ++-- 2 files changed, 5 insertions(+), 20 deletions(-) rename plugins/{insert.getNbIns.php => modifier.number_format.php} (76%) diff --git a/plugins/insert.getNbIns.php b/plugins/modifier.number_format.php similarity index 76% rename from plugins/insert.getNbIns.php rename to plugins/modifier.number_format.php index b12c73f..80cbb7f 100644 --- a/plugins/insert.getNbIns.php +++ b/plugins/modifier.number_format.php @@ -19,25 +19,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -/* - * Smarty plugin - * ------------------------------------------------------------- - * File: insert.getNbIns.php - * Type: insert - * Name: getNbIns - * Purpose: - * ------------------------------------------------------------- - */ - -function smarty_insert_getNbIns($params, &$smarty) +function smarty_modifier_number_format($string, $decimal = 0) { - global $globals; - $cnt = $globals->core->NbIns; - if ($cnt == 0) { - update_NbIns(); - $cnt = $globals->core->NbIns; - } - return number_format($cnt, 0, ",", "."); + return number_format($string, $decimal, ',', '.'); } + // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?> diff --git a/templates/skin/common.title.header.tpl b/templates/skin/common.title.header.tpl index fd0222a..f093aaf 100644 --- a/templates/skin/common.title.header.tpl +++ b/templates/skin/common.title.header.tpl @@ -29,13 +29,13 @@ - {insert name="getNbIns"} polytechniciens sur le web + {$globals->core->NbIns|number_format} polytechniciens sur le web
+ onblur="if (this.value == '') this.value='{$smarty.request.quick|default:"recherche dans l'annuaire"|escape:javascript}'"/>
{if $smarty.session.auth gt AUTH_PUBLIC && $smarty.session.notifs} -- 2.1.4