Use {$global->..->NbIns} instead of {insert name="getNbIns"}
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 1 Nov 2007 20:14:16 +0000 (21:14 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 1 Nov 2007 20:14:16 +0000 (21:14 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
plugins/modifier.number_format.php [moved from plugins/insert.getNbIns.php with 76% similarity]
templates/skin/common.title.header.tpl

similarity index 76%
rename from plugins/insert.getNbIns.php
rename to plugins/modifier.number_format.php
index b12c73f..80cbb7f 100644 (file)
  *  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:
 ?>
index fd0222a..f093aaf 100644 (file)
                 </script>
               </td>
               <td class="inscrits">
-                {insert name="getNbIns"} polytechniciens sur le web
+                {$globals->core->NbIns|number_format} polytechniciens sur le web
                 <form action="search" method="get">
                     <div>
                         <input type="text" size="30" name="quick" class="quick_search"
                                value="{$smarty.request.quick|default:"recherche dans l'annuaire"}"
                                onfocus="if (this.value == '{$smarty.request.quick|default:"recherche dans l'annuaire"|escape:javascript}') this.value=''"
-                               onblur="if (this.value == '') this.value='{$smarty.request.quick|default:"recherche dans l'annuaire"|escape:javascript}'"/>                        
+                               onblur="if (this.value == '') this.value='{$smarty.request.quick|default:"recherche dans l'annuaire"|escape:javascript}'"/>
                     </div>
                 </form>
                 {if $smarty.session.auth gt AUTH_PUBLIC && $smarty.session.notifs}