Index: /extensions/SmartAlbums/admin.php
===================================================================
--- /extensions/SmartAlbums/admin.php	(revision 11391)
+++ /extensions/SmartAlbums/admin.php	(revision 11392)
@@ -2,27 +2,25 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-global $conf, $template;
+global $conf, $template, $page;
+
 load_language('plugin.lang', SMART_PATH);
 if (!is_array($conf['SmartAlbums'])) $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']);
 
-
-// Enregistrement de la configuration
-if (isset($_POST['submit']))
-{
-	$conf['SmartAlbums'] = array(
-    'update_on_upload' => isset($_POST['update_on_upload']), 
-    );    
-	
-  conf_update_param('SmartAlbums', serialize($conf['SmartAlbums']));
-	array_push($page['infos'], l10n('Information data registered in database'));
-}
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+$page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'albums';
+  
+$tabsheet = new tabsheet();
+$tabsheet->add('albums', l10n('All SmartAlbums'), SMART_ADMIN.'-albums');
+$tabsheet->add('config', l10n('Configuration'),   SMART_ADMIN.'-config');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
 
 $template->assign(array(
   'SMART_PATH' => SMART_PATH,
-	'update_on_upload' => $conf['SmartAlbums']['update_on_upload'],
 ));
-	
-$template->set_filename('SmartAlbums_conf', dirname(__FILE__).'/template/admin.tpl');
-$template->assign_var_from_handle('ADMIN_CONTENT', 'SmartAlbums_conf');
+
+include(SMART_PATH.'admin/'.$page['tab'].'.inc.php');
+$template->set_filename('SmartAlbums_content', dirname(__FILE__).'/admin/template/'.$page['tab'].'.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'SmartAlbums_content');
 
 ?>
Index: /extensions/SmartAlbums/admin/albums.inc.php
===================================================================
--- /extensions/SmartAlbums/admin/albums.inc.php	(revision 11392)
+++ /extensions/SmartAlbums/admin/albums.inc.php	(revision 11392)
@@ -0,0 +1,183 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+if (isset($_GET['hide_messages']))
+{
+  $conf['SmartAlbums']['show_list_messages'] = false;
+  conf_update_param('SmartAlbums', serialize($conf['SmartAlbums']));
+}
+
+// +-----------------------------------------------------------------------+
+// |                            initialization                             |
+// +-----------------------------------------------------------------------+
+$base_url = get_root_url().'admin.php?page=';
+$self_url = SMART_ADMIN.'-albums';
+
+$categories = array();
+$query = '
+SELECT id, name, permalink, dir, rank, status
+  FROM '.CATEGORIES_TABLE.' AS cat
+  INNER JOIN '.CATEGORY_FILTERS_TABLE.' AS cf
+    ON cf.category_id = cat.id
+  ORDER BY rank ASC
+;';
+$categories = hash_from_query($query, 'id');
+
+// +-----------------------------------------------------------------------+
+// |                    virtual categories management                      |
+// +-----------------------------------------------------------------------+
+// request to delete a album
+if (isset($_GET['delete']) and is_numeric($_GET['delete']))
+{
+  delete_categories(array($_GET['delete']));
+  $_SESSION['page_infos'] = array(l10n('SmartAlbum deleted'));
+  update_global_rank();
+  redirect($self_url);
+}
+// request to add a album
+else if (isset($_POST['submitAdd']))
+{
+  $output_create = create_virtual_category(
+    $_POST['virtual_name'],
+    @$_POST['parent_id']
+    );
+
+  if (isset($output_create['error']))
+  {
+    array_push($page['errors'], $output_create['error']);
+  }
+  else
+  {
+    $_SESSION['page_infos'] = array(l10n('SmartAlbum added'));
+    $redirect_url = $base_url.'cat_modify&amp;cat_id='.$output_create['id'].'&amp;new_smart';
+    redirect($redirect_url);
+  }
+}
+// request to regeneration
+else if (isset($_GET['smart_generate']))
+{
+  /* regenerate photo list | all (sub) categories */
+  if ($_GET['smart_generate'] == 'all')
+  {
+    foreach ($categories as $category)
+    {
+      $associated_images = smart_make_associations($category['id']);
+      array_push(
+        $page['infos'], 
+        l10n_args(get_l10n_args(
+          '%d photos associated to album &laquo;%s&raquo;', 
+          array(
+            count($associated_images), 
+            trigger_event(
+              'render_category_name',
+              $category['name'],
+              'admin_cat_list'
+              )
+            )
+          ))
+        );
+    }
+  }
+  /* regenerate photo list | one category */
+  else
+  {
+    $associated_images = smart_make_associations($_GET['smart_generate']);    
+    array_push(
+      $page['infos'], 
+      l10n_args(get_l10n_args(
+        '%d photos associated to album &laquo;%s&raquo;', 
+        array(
+          count($associated_images), 
+          trigger_event(
+            'render_category_name',
+            $categories[$_GET['smart_generate']]['name'],
+            'admin_cat_list'
+            )
+          )
+        ))
+      );
+  }
+  
+  define('SMART_NOT_UPDATE', 1);
+  invalidate_user_cache();
+}
+
+// +-----------------------------------------------------------------------+
+// |                       template initialization                         |
+// +-----------------------------------------------------------------------+
+$template->assign(array(
+  'F_ACTION' => $self_url,
+  'PWG_TOKEN' => get_pwg_token(),
+ ));
+ 
+// retrieve all existing categories for album creation
+$query = '
+SELECT id,name,uppercats,global_rank
+  FROM '.CATEGORIES_TABLE.'
+;';
+
+display_select_cat_wrapper(
+  $query,
+  null,
+  'category_options'
+  );
+  
+if ($conf['SmartAlbums']['show_list_messages'])
+{
+  array_push($page['warnings'], l10n('Only SmartAlbums are displayed on this page'));
+  array_push($page['warnings'], l10n('To order albums please go the main albums management page'));
+  array_push($page['warnings'], '<a href="'.$self_url.'&hide_messages">['.l10n('Don\'t show this message again').']</a>');
+}
+
+// +-----------------------------------------------------------------------+
+// |                          Categories display                           |
+// +-----------------------------------------------------------------------+
+
+// get the categories containing images directly 
+$categories_with_images = array();
+if ( count($categories) )
+{
+  $query = '
+SELECT DISTINCT category_id 
+  FROM '.IMAGE_CATEGORY_TABLE.'
+  WHERE category_id IN ('.implode(',', array_keys($categories)).')';
+  $categories_with_images = array_flip( array_from_query($query, 'category_id') );
+}
+
+$template->assign('categories', array());
+
+foreach ($categories as $category)
+{
+  $tpl_cat =
+    array(
+      'NAME'       => get_cat_display_name_from_id($category['id'], $base_url.'cat_modify&amp;cat_id='),
+      'ID'         => $category['id'],
+      'RANK'       => $category['rank']*10,
+
+      'U_JUMPTO'   => make_index_url(
+        array(
+          'category' => $category
+          )
+        ),
+
+      'U_EDIT'     => $base_url.'cat_modify&amp;cat_id='.$category['id'],
+      'U_DELETE'   => $self_url.'&amp;delete='.$category['id'].'&amp;pwg_token='.get_pwg_token(),
+      'U_SMART'    => $self_url.'&amp;smart_generate='.$category['id'],
+    );
+
+  if ( array_key_exists($category['id'], $categories_with_images) )
+  {
+    $tpl_cat['U_MANAGE_ELEMENTS'] =
+      $base_url.'batch_manager&amp;cat='.$category['id'];
+  }
+
+  if ('private' == $category['status'])
+  {
+    $tpl_cat['U_MANAGE_PERMISSIONS'] =
+      $base_url.'cat_perm&amp;cat='.$category['id'];
+  }
+  
+  $template->append('categories', $tpl_cat);
+}
+
+?>
Index: /extensions/SmartAlbums/admin/config.inc.php
===================================================================
--- /extensions/SmartAlbums/admin/config.inc.php	(revision 11392)
+++ /extensions/SmartAlbums/admin/config.inc.php	(revision 11392)
@@ -0,0 +1,17 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Enregistrement de la configuration
+if (isset($_POST['submit']))
+{
+	$conf['SmartAlbums']['update_on_upload'] = isset($_POST['update_on_upload']);
+	
+  conf_update_param('SmartAlbums', serialize($conf['SmartAlbums']));
+	array_push($page['infos'], l10n('Information data registered in database'));
+}
+
+$template->assign(array(
+	'update_on_upload' => $conf['SmartAlbums']['update_on_upload'],
+));
+
+?>
Index: /extensions/SmartAlbums/admin/index.php
===================================================================
--- /extensions/SmartAlbums/admin/index.php	(revision 11392)
+++ /extensions/SmartAlbums/admin/index.php	(revision 11392)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2011 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/admin/template/albums.tpl
===================================================================
--- /extensions/SmartAlbums/admin/template/albums.tpl	(revision 11392)
+++ /extensions/SmartAlbums/admin/template/albums.tpl	(revision 11392)
@@ -0,0 +1,74 @@
+<div class="titrePage">
+	<h2>SmartAlbums</h2>
+</div>
+
+<h3>
+  <a href="{$F_ACTION}">{'All SmartAlbums'|@translate}</a>
+  {if count($categories)>9 }
+  <a href="#EoP" class="button" style="border:0;">
+  <img src="{$themeconf.admin_icon_dir}/page_end.png" title="{'Page end'|@translate}" class="button" alt="page_end" style="margin-bottom:-0.6em;"></a>
+  {/if}
+</h3>
+
+<form id="addVirtual" action="{$F_ACTION}" method="post">
+  <fieldset>
+    <legend>{'Add a SmartAlbum'|@translate}</legend>
+  
+    <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
+    {'Album name'|@translate} : <input type="text" name="virtual_name">
+    {'Parent album'|@translate} :
+    <select class="categoryDropDown" name="parent_id">
+      <option value="0">------------</option>
+      {html_options options=$category_options}
+    </select>
+    <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitAdd">
+  
+  </fieldset>
+</form>
+
+{if count($categories) }
+<form id="categoryOrdering" action="{$F_ACTION}" method="post">
+  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
+
+  <div class="orderParams">
+    
+  </div>
+
+  <ul class="categoryUl">
+
+    {foreach from=$categories item=category}
+    <li class="categoryLi virtual_cat" id="cat_{$category.ID}">
+      <!-- category {$category.ID} -->
+      <ul class="categoryActions">
+        {if cat_admin_access($category.ID)}
+        <li><a href="{$category.U_JUMPTO}" title="{'jump to album'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to album'|@translate}"></a></li>
+        {/if}
+        <li><a href="{$category.U_EDIT}" title="{'edit album'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"></a></li>
+        {if isset($category.U_MANAGE_ELEMENTS) }
+        <li><a href="{$category.U_MANAGE_ELEMENTS}" title="{'manage album photos'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'Photos'|@translate}"></a></li>
+        {/if}
+        {if isset($category.U_MANAGE_PERMISSIONS) }
+        <li><a href="{$category.U_MANAGE_PERMISSIONS}" title="{'edit album permissions'|@translate}" ><img src="{$themeconf.admin_icon_dir}/category_permissions.png" class="button" alt="{'Permissions'|@translate}"></a></li>
+        {/if}
+        <li><a href="{$category.U_SMART}" title="{'Regenerate photos list of this SmartAlbum'|@translate}"><img src="{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{'Regenerate photos list of this SmartAlbum'|@translate}"></a></li>
+        {if isset($category.U_DELETE) }
+        <li><a href="{$category.U_DELETE}" title="{'delete album'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"><img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'delete album'|@translate}"></a></li>
+        {/if}
+      </ul>
+
+      <p>
+        <strong>{$category.NAME}</strong>
+      </p>
+
+    </li>
+    {/foreach}
+  </ul>
+</form>
+{/if}
+
+<form method="post" action="{$F_ACTION}&amp;smart_generate=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>
+
+<a name="EoP"></a>
Index: /extensions/SmartAlbums/admin/template/config.tpl
===================================================================
--- /extensions/SmartAlbums/admin/template/config.tpl	(revision 11392)
+++ /extensions/SmartAlbums/admin/template/config.tpl	(revision 11392)
@@ -0,0 +1,19 @@
+<div class="titrePage">
+	<h2>SmartAlbums</h2>
+</div>
+
+<form method="post" action="" class="properties" ENCTYPE="multipart/form-data"> 
+	<fieldset>
+		<legend>{'Configuration'|@translate}</legend>	  
+		<ul>			
+			<li>
+        <label>
+          <span class="property">{'Update albums on file upload'|@translate}</span>
+          <input type="checkbox" name="update_on_upload" value="true" {if $update_on_upload}checked="checked"{/if}/>
+        </label>
+			</li>
+		</ul>
+	</fieldset>
+		
+	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
+</form>
Index: /extensions/SmartAlbums/admin/template/index.php
===================================================================
--- /extensions/SmartAlbums/admin/template/index.php	(revision 11392)
+++ /extensions/SmartAlbums/admin/template/index.php	(revision 11392)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2011 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/include/init_cat_list.php
===================================================================
--- /extensions/SmartAlbums/include/init_cat_list.php	(revision 11391)
+++ /extensions/SmartAlbums/include/init_cat_list.php	(revision 11392)
@@ -31,11 +31,5 @@
 ;';
   
-  $result = pwg_query($query);
-  $smart_cats = array();
-  while ($cat = pwg_db_fetch_assoc($result))
-  {
-    $smart_cats[$cat['id']] = trigger_event('render_category_name', $cat['name']);
-  }
-  
+  $smart_cats = hash_from_query($query, 'id'); 
   $smart_count = count($smart_cats);
   
@@ -45,12 +39,19 @@
     if ($_GET['smart_generate'] == 'all')
     {
-      foreach ($smart_cats as $cat => $name)
+      foreach ($smart_cats as $category)
       {
-        $associated_images = smart_make_associations($cat);
+        $associated_images = smart_make_associations($category['id']);
         array_push(
           $page['infos'], 
           l10n_args(get_l10n_args(
             '%d photos associated to album &laquo;%s&raquo;', 
-            array(count($associated_images), $name)
+            array(
+              count($associated_images), 
+              trigger_event(
+                'render_category_name',
+                $category['name'],
+                'admin_cat_list'
+                )
+              )
             ))
           );
@@ -65,5 +66,12 @@
         l10n_args(get_l10n_args(
           '%d photos associated to album &laquo;%s&raquo;', 
-          array(count($associated_images), $smart_cats[$_GET['smart_generate']])
+          array(
+            count($associated_images), 
+            trigger_event(
+              'render_category_name',
+              $smart_cats[$_GET['smart_generate']]['name'],
+              'admin_cat_list'
+              )
+            )
           ))
         );
@@ -98,5 +106,5 @@
   $replacement[0] = '
 {if isset($SMART_URL[$category.ID])}
-        <li><a href="{$SMART_URL[$category.ID]}" title="{\'Regenerate photos list of this SmartAlbum\'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{\'regenerate photos list\'|@translate}"></a></li>
+        <li><a href="{$SMART_URL[$category.ID]}" title="{\'Regenerate photos list of this SmartAlbum\'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{\'Regenerate photos list of this SmartAlbum\'|@translate}"></a></li>
 {/if}'
 .$search[0];
Index: /extensions/SmartAlbums/include/init_cat_modify.php
===================================================================
--- /extensions/SmartAlbums/include/init_cat_modify.php	(revision 11391)
+++ /extensions/SmartAlbums/include/init_cat_modify.php	(revision 11392)
@@ -87,4 +87,5 @@
         ),
       'limit' => array('limit' => 'limit'), // second filter not used
+      // TODO : new filter by album
       )
     );
@@ -130,4 +131,9 @@
   }
   
+  if (isset($_GET['new_smart']))
+  {
+    $template->assign('new_smart', true);
+  }
+  
   $template->assign(array(
     'SMART_PATH' => SMART_PATH,
@@ -141,5 +147,5 @@
 function smart_cat_modify_prefilter($content, &$smarty)
 {
-  $search = '<form action="{$F_ACTION}" method="POST" id="links">';
+  $search = '<form action="{$F_ACTION}" method="POST" id="catModify">';
   $replacement = file_get_contents(SMART_PATH.'template/cat_modify.tpl')."\n".$search;
   return str_replace($search, $replacement, $content);
Index: /extensions/SmartAlbums/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/SmartAlbums/language/en_UK/plugin.lang.php	(revision 11391)
+++ /extensions/SmartAlbums/language/en_UK/plugin.lang.php	(revision 11392)
@@ -22,4 +22,5 @@
 $lang['date filter'] = 'date filter';
 $lang['limit filter'] = 'limit filter';
+$lang['Add filters here'] = 'Add filters here';
 $lang['This album is a SmartAlbum'] = 'This album is a SmartAlbum';
 $lang['Count'] = 'Count';
@@ -27,4 +28,11 @@
 $lang['Regenerate photos list of all SmartAlbums'] = 'Regenerate photos list of all SmartAlbums';
 $lang['Update albums on file upload'] = 'Update albums on file upload';
+$lang['All SmartAlbums'] = 'All SmartAlbums';
+$lang['Add a SmartAlbum'] = 'Add a SmartAlbum';
+$lang['SmartAlbum deleted'] = 'SmartAlbum deleted';
+$lang['SmartAlbum added'] = 'SmartAlbum added';
+$lang['Only SmartAlbums are displayed on this page'] = 'Only SmartAlbums are displayed on this page';
+$lang['To order albums please go the main albums management page'] = 'To order albums please go the main albums management page';
+$lang['Don\'t show this message again'] = 'Don\'t show this message again';
 
 ?>
Index: /extensions/SmartAlbums/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/SmartAlbums/language/fr_FR/plugin.lang.php	(revision 11391)
+++ /extensions/SmartAlbums/language/fr_FR/plugin.lang.php	(revision 11392)
@@ -2,5 +2,5 @@
 
 $lang['%d photos associated to album &laquo;%s&raquo;'] = '%d photos associées à l\'album &laquo;%s&raquo;';
-$lang['No filter selected'] = 'Aucun filter sélectionné';
+$lang['No filter selected'] = 'Aucun filtre sélectionné';
 $lang['No tag selected'] = 'Aucun tag sélectionné';
 $lang['Date string is malformed'] = 'La date n\'est pas correcte';
@@ -22,4 +22,5 @@
 $lang['date filter'] = 'filtrer par date';
 $lang['limit filter'] = 'nombre max. d\'éléments';
+$lang['Add filters here'] = 'Ajoutez des filtres ici';
 $lang['This album is a SmartAlbum'] = 'Cet album est un SmartAlbum';
 $lang['Count'] = 'Compter';
@@ -27,4 +28,11 @@
 $lang['Regenerate photos list of all SmartAlbums'] = 'Régénérer les photos de tous les SmartAlbums';
 $lang['Update albums on file upload'] = 'Mettre à jour les albums après la mise en ligne d\'un fichier';
+$lang['All SmartAlbums'] = 'Tous les SmartAlbums';
+$lang['Add a SmartAlbum'] = 'Ajouter un SmartAlbum';
+$lang['SmartAlbum deleted'] = 'SmartAlbum ajouté';
+$lang['SmartAlbum added'] = 'SmartAlbum supprimé';
+$lang['Only SmartAlbums are displayed on this page'] = 'Seuls les SmartAlbums sont affichés sur cette page';
+$lang['To order albums please go the main albums management page'] = 'Pour ordonner les albums veuillez vous rendre sur la page principale de gestion des albums';
+$lang['Don\'t show this message again'] = 'Ne plus afficher ce message';
 
 ?>
Index: /extensions/SmartAlbums/main.inc.php
===================================================================
--- /extensions/SmartAlbums/main.inc.php	(revision 11391)
+++ /extensions/SmartAlbums/main.inc.php	(revision 11392)
@@ -15,4 +15,5 @@
 define('SMART_PATH', PHPWG_PLUGINS_PATH.SMART_DIR.'/');
 define('CATEGORY_FILTERS_TABLE', $prefixeTable.'category_filters');
+define('SMART_ADMIN', get_root_url().'admin.php?page=plugin-' . SMART_DIR);
 
 add_event_handler('invalidate_user_cache', 'smart_make_all_associations');
@@ -39,5 +40,7 @@
 		array_push($menu, array(
 			'NAME' => 'SmartAlbums',
-			'URL' => get_root_url().'admin.php?page=plugin-' . SMART_DIR));
+			'URL' => SMART_ADMIN,
+      )
+    );
 		return $menu;
 	}
Index: /extensions/SmartAlbums/maintain.inc.php
===================================================================
--- /extensions/SmartAlbums/maintain.inc.php	(revision 11391)
+++ /extensions/SmartAlbums/maintain.inc.php	(revision 11392)
@@ -26,4 +26,5 @@
     \''.serialize(array(
         'update_on_upload' => true,
+        'show_list_messages' => true,
         )
       ).'\',
@@ -36,7 +37,5 @@
 function plugin_activate()
 { 
-  $sa_config = pwg_query('SELECT * FROM `' . CONFIG_TABLE . '` WHERE param = \'SmartAlbums\';');
-  
-  if (!pwg_db_num_rows($sa_config))
+  if (!isset($conf['SmartAlbums']))
   {
     pwg_query('
@@ -46,4 +45,5 @@
     \''.serialize(array(
         'update_on_upload' => true,
+        'show_list_messages' => true,
         )
       ).'\',
Index: tensions/SmartAlbums/template/admin.tpl
===================================================================
--- /extensions/SmartAlbums/template/admin.tpl	(revision 11391)
+++ 	(revision )
@@ -1,19 +1,0 @@
-<div class="titrePage">
-	<h2>SmartAlbums</h2>
-</div>
-
-<form method="post" action="" class="properties" ENCTYPE="multipart/form-data"> 
-	<fieldset>
-		<legend>{'Configuration'|@translate}</legend>	  
-		<ul>			
-			<li>
-        <label>
-          <span class="property">{'Update albums on file upload'|@translate}</span>
-          <input type="checkbox" name="update_on_upload" value="true" {if $update_on_upload}checked="checked"{/if}/>
-        </label>
-			</li>
-		</ul>
-	</fieldset>
-		
-	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
-</form>
Index: /extensions/SmartAlbums/template/cat_modify.tpl
===================================================================
--- /extensions/SmartAlbums/template/cat_modify.tpl	(revision 11391)
+++ /extensions/SmartAlbums/template/cat_modify.tpl	(revision 11392)
@@ -42,4 +42,6 @@
     return false;
   });
+  
+
   
   function add_filter(type) {
@@ -100,4 +102,14 @@
 	}
   
+  function doBlink(obj,start,finish) { 
+    jQuery(obj).fadeOut(400).fadeIn(400); 
+    if(start!=finish) { 
+      doBlink(obj,start+1,finish);
+    } else {
+      jQuery(obj).fadeOut(400);
+    }
+  }
+    
+  doBlink('.new_smart', 0, 3);
   init_jquery_handlers();
 });
@@ -111,7 +123,7 @@
   <legend>{'SmartAlbums'|@translate}</legend>
   
-  <label><input type="checkbox" name="is_smart" {if isset($filters)}checked="checked"{/if}/> {'This album is a SmartAlbum'|@translate}</label>
+  <label><input type="checkbox" name="is_smart" {if isset($filters) OR isset($new_smart)}checked="checked"{/if}/> {'This album is a SmartAlbum'|@translate}</label>
   
-<div id="SmartAlbum_options" style="margin-top:1em;{if !isset($filters)}display:none;{/if}">
+<div id="SmartAlbum_options" style="margin-top:1em;{if !isset($filters) AND !isset($new_smart)}display:none;{/if}">
   <ul id="filterList">
     {counter start=0 assign=i}
@@ -151,4 +163,5 @@
       </select>
       <a id="removeFilters">{'Remove all filters'|@translate}</a>
+      {if isset($new_smart)}<span class="new_smart">{'Add filters here'|@translate}</span>{/if}
   </p>
 </div>
@@ -156,5 +169,5 @@
   <p class="actionButtons" id="applyFilterBlock">
     <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitFilters"/>
-    <input class="submit" type="submit" value="{'Count'|@translate}" name="countImages" {if !isset($filters)}style="display:none;"{/if}/>
+    <input class="submit" type="submit" value="{'Count'|@translate}" name="countImages" {if !isset($filters) AND !isset($new_smart)}style="display:none;"{/if}/>
     <span class="count_images_display">{$IMAGE_COUNT}</span>
   </p>
Index: /extensions/SmartAlbums/template/style.css
===================================================================
--- /extensions/SmartAlbums/template/style.css	(revision 11391)
+++ /extensions/SmartAlbums/template/style.css	(revision 11392)
@@ -12,2 +12,11 @@
   margin-bottom:0px !important; 
 }
+
+.new_smart {
+  color:#00AA00;
+  background-color:#C2F5C2;
+  font-weight:bold;
+  padding:3px 10px;
+  border-radius:4px;
+  box-shadow:0 0 2px #0a0;
+}
