Index: /extensions/SmartAlbums/include/count_images.php
===================================================================
--- /extensions/SmartAlbums/include/count_images.php	(revision 11289)
+++ /extensions/SmartAlbums/include/count_images.php	(revision 11290)
@@ -10,15 +10,23 @@
 include_once(SMART_PATH.'include/functions.inc.php');
 
-$filters = array();
-$limit_is_set = false;
-foreach ($_POST['filters'] as $filter)
+if (isset($_POST['filters']))
 {
-  if (($filter = smart_check_filter($filter)) != false)
+  $filters = array();
+  $limit_is_set = false;
+  foreach ($_POST['filters'] as $filter)
   {
-    array_push($filters, $filter);
+    if (($filter = smart_check_filter($filter)) != false)
+    {
+      array_push($filters, $filter);
+    }
   }
+
+  $associated_images = smart_get_pictures($_POST['cat_id'], $filters);
+}
+else
+{
+  $associated_images = array();
 }
 
-$associated_images = smart_get_pictures($_POST['cat_id'], $filters);
 echo l10n_dec('%d photo', '%d photos', count($associated_images));
 
Index: /extensions/SmartAlbums/init_cat_list.php
===================================================================
--- /extensions/SmartAlbums/init_cat_list.php	(revision 11289)
+++ /extensions/SmartAlbums/init_cat_list.php	(revision 11290)
@@ -4,8 +4,9 @@
  * Add a link into categories list to regenerate associations
  */
- 
+$smart_count = 0;
+
 function smart_cat_list()
 {
-  global $template, $page;
+  global $template, $page, $smart_count;
   include_once(SMART_PATH.'include/functions.inc.php');
   $self_url = get_root_url().'admin.php?page=cat_list'.(isset($_GET['parent_id']) ? '&amp;parent_id='.$_GET['parent_id'] : null);
@@ -28,9 +29,11 @@
   
   $result = pwg_query($query);
-  $categories = array();
+  $smart_cats = array();
   while ($cat = pwg_db_fetch_assoc($result))
   {
-    $categories[$cat['id']] = trigger_event('render_category_name', $cat['name']);
+    $smart_cats[$cat['id']] = trigger_event('render_category_name', $cat['name']);
   }
+  
+  $smart_count = count($smart_cats);
   
   if (isset($_GET['smart_generate']))
@@ -39,5 +42,5 @@
     if ($_GET['smart_generate'] == 'all')
     {
-      foreach ($categories as $cat => $name)
+      foreach ($smart_cats as $cat => $name)
       {
         $associated_images = smart_make_associations($cat);
@@ -54,5 +57,5 @@
       array_push($page['infos'], l10n_args(get_l10n_args(
         '%d photos associated to album &laquo;%s&raquo;', 
-        array(count($associated_images), $categories[$_GET['smart_generate']])
+        array(count($associated_images), $smart_cats[$_GET['smart_generate']])
       )));
     }
@@ -63,5 +66,5 @@
   // create regenerate link
   $tpl_cat = array();
-  foreach ($categories as $cat => $name)
+  foreach ($smart_cats as $cat => $name)
   {
     $tpl_cat[$cat] = $self_url.'&amp;smart_generate='.$cat;
@@ -80,18 +83,23 @@
 function smart_cat_list_prefilter($content, &$smarty)
 {
-$search[0] = '<ul class="categoryActions">';
-$replacement[0] = $search[0].'
+  global $smart_count;
+  
+  $search[0] = '<ul class="categoryActions">';
+  $replacement[0] = $search[0].'
 {if isset($SMART_URL[$category.ID])}
         <li><a href="{$SMART_URL[$category.ID]}" title="{\'regenerate photos list\'|@translate}"><img src="{$SMART_PATH}template/refresh.png" class="button" alt="{\'regenerate photos list\'|@translate}"></a></li>
 {/if}';
 
-$search[1] = '</ul>
+  if ($smart_count > 0)
+  {
+    $search[1] = '</ul>
 </form>
 {/if}';
-$replacement[1] = $search[1].'
+    $replacement[1] = $search[1].'
 <form method="post" action="{$SMART_URL.all}">
   <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
   <p><input class="submit" type="submit" value="{\'regenerate photos list of all SmartAlbums\'|@translate}"></p>
 </form>';
+  }
 
   return str_replace($search, $replacement, $content);
Index: /extensions/SmartAlbums/language/en_UK/description.txt
===================================================================
--- /extensions/SmartAlbums/language/en_UK/description.txt	(revision 11290)
+++ /extensions/SmartAlbums/language/en_UK/description.txt	(revision 11290)
@@ -0,0 +1,1 @@
+Easily create dynamic albums with tags, date and other criteria
Index: /extensions/SmartAlbums/language/en_UK/index.php
===================================================================
--- /extensions/SmartAlbums/language/en_UK/index.php	(revision 11290)
+++ /extensions/SmartAlbums/language/en_UK/index.php	(revision 11290)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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                                          |
+// |                                                                       |
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/SmartAlbums/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/SmartAlbums/language/en_UK/plugin.lang.php	(revision 11290)
+++ /extensions/SmartAlbums/language/en_UK/plugin.lang.php	(revision 11290)
@@ -0,0 +1,24 @@
+<?php
+
+$lang['%d photos associated to album &laquo;%s&raquo;'] = '%d photos associated to album &laquo;%s&raquo;';
+$lang['No filter selected'] = 'No filter selected';
+$lang['No tag selected'] = 'No tag selected';
+$lang['Date string is malformed'] = 'Date string is malformed';
+$lang['Limit must be an integer'] = 'Limit must be an integer';
+$lang['You can\'t use more than one limit'] = 'You can\'t use more than one limit';
+$lang['All these tags'] = 'All these tags';
+$lang['One of these tags'] = 'One of these tags';
+$lang['None of these tags'] = 'None of these tags';
+$lang['Only these tags'] = 'Only these tags';
+$lang['Added the'] = 'Added the';
+$lang['Added before the'] = 'Added before the';
+$lang['Added after the'] = 'Added after the';
+$lang['%d photo'] = '%d photo';
+$lang['%d photos'] = '%d photos';
+$lang['tags filter'] = 'tags filter';
+$lang['date filter'] = 'date filter';
+$lang['limit filter'] = 'limit filter';
+$lang['This album is a SmartAlbum'] = 'This album is a SmartAlbum';
+$lang['Count'] = 'Count';
+
+?>
Index: /extensions/SmartAlbums/language/fr_FR/description.txt
===================================================================
--- /extensions/SmartAlbums/language/fr_FR/description.txt	(revision 11290)
+++ /extensions/SmartAlbums/language/fr_FR/description.txt	(revision 11290)
@@ -0,0 +1,1 @@
+Créez facilement des albums dynamiques avec tags, date, et autres contraintes
Index: /extensions/SmartAlbums/language/fr_FR/index.php
===================================================================
--- /extensions/SmartAlbums/language/fr_FR/index.php	(revision 11290)
+++ /extensions/SmartAlbums/language/fr_FR/index.php	(revision 11290)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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                                          |
+// |                                                                       |
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/SmartAlbums/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/SmartAlbums/language/fr_FR/plugin.lang.php	(revision 11290)
+++ /extensions/SmartAlbums/language/fr_FR/plugin.lang.php	(revision 11290)
@@ -0,0 +1,24 @@
+<?php
+
+$lang['%d photos associated to album &laquo;%s&raquo;'] = '%d photos associées à album &laquo;%s&raquo;';
+$lang['No filter selected'] = 'Aucun filter sélectionné';
+$lang['No tag selected'] = 'Aucun tag sélectionné';
+$lang['Date string is malformed'] = 'La date n\'est pas correcte';
+$lang['Limit must be an integer'] = 'La limite doit être un entier';
+$lang['You can\'t use more than one limit'] = 'Vous ne pouvez utiliser qu\'une seule limite';
+$lang['All these tags'] = 'Tous les tags';
+$lang['One of these tags'] = 'Un des tags';
+$lang['None of these tags'] = 'Aucun des tags';
+$lang['Only these tags'] = 'Tous les tags';
+$lang['Added the'] = 'Ajouté le';
+$lang['Added before the'] = 'Ajouté avant le';
+$lang['Added after the'] = 'Ajouté après le';
+$lang['%d photo'] = '%d photo';
+$lang['%d photos'] = '%d photos';
+$lang['tags filter'] = 'filtrer par tags';
+$lang['date filter'] = 'filtrer par date';
+$lang['limit filter'] = 'nombre max. d\'éléments';
+$lang['This album is a SmartAlbum'] = 'Cet album est un SmartAlbum';
+$lang['Count'] = 'Compter';
+
+?>
Index: /extensions/SmartAlbums/language/index.php
===================================================================
--- /extensions/SmartAlbums/language/index.php	(revision 11290)
+++ /extensions/SmartAlbums/language/index.php	(revision 11290)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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                                          |
+// |                                                                       |
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/SmartAlbums/main.inc.php
===================================================================
--- /extensions/SmartAlbums/main.inc.php	(revision 11289)
+++ /extensions/SmartAlbums/main.inc.php	(revision 11290)
@@ -18,4 +18,6 @@
 if (script_basename() == 'admin')
 {
+  load_language('plugin.lang', SMART_PATH);
+  
   add_event_handler('loc_begin_cat_modify', 'smart_init_cat_modify'); 
   function smart_init_cat_modify()
@@ -33,4 +35,3 @@
 }
 
-
 ?>
