Index: /extensions/UserCollections/admin.php
===================================================================
--- /extensions/UserCollections/admin.php	(revision 23550)
+++ /extensions/UserCollections/admin.php	(revision 23551)
@@ -15,5 +15,5 @@
   if (isset($_GET['col_id']))
   {
-    $tabsheet->add('export', l10n('Export'), USER_COLLEC_ADMIN . '-export&amp;col_id='.$_GET['col_id']);
+    $tabsheet->add('export', l10n('Export image list'), USER_COLLEC_ADMIN . '-export&amp;col_id='.$_GET['col_id']);
   }
   else
Index: /extensions/UserCollections/admin/config.php
===================================================================
--- /extensions/UserCollections/admin/config.php	(revision 23550)
+++ /extensions/UserCollections/admin/config.php	(revision 23551)
@@ -17,5 +17,5 @@
 
 
-$template->set_filename('user_collections', dirname(__FILE__) . '/template/config.tpl');
+$template->set_filename('user_collections', realpath(USER_COLLEC_PATH . 'admin/template/config.tpl'));
 
 ?>
Index: /extensions/UserCollections/admin/export.php
===================================================================
--- /extensions/UserCollections/admin/export.php	(revision 23550)
+++ /extensions/UserCollections/admin/export.php	(revision 23551)
@@ -55,5 +55,5 @@
 $template->assign('inactive_fields', pwg_get_session_var('uc_export_inactive_fields', $default_inactive_fields));
 
-$template->set_filename('user_collections', dirname(__FILE__) . '/template/export.tpl');
+$template->set_filename('user_collections', realpath(USER_COLLEC_PATH . 'admin/template/export.tpl'));
 
 ?>
Index: /extensions/UserCollections/admin/sets.php
===================================================================
--- /extensions/UserCollections/admin/sets.php	(revision 23550)
+++ /extensions/UserCollections/admin/sets.php	(revision 23551)
@@ -46,5 +46,5 @@
 {
   $template->append('sets', array(
-    'NAME' => $row['name'],
+    'NAME' => trigger_event('render_category_name', $row['name']),
     'NB_IMAGES' => $row['nb_images'],
     'DATE_CREATION' => format_date($row['date_creation'], true),
@@ -70,14 +70,11 @@
   );
 
-$template->assign('order_options', $page['order_by_items']);
-$template->assign('order_selected',
-    isset($_POST['order_by']) ? $_POST['order_by'] : '');
-
-$template->assign('direction_options', $page['direction_items']);
-$template->assign('direction_selected',
-    isset($_POST['direction']) ? $_POST['direction'] : '');
-
 
 $template->assign(array(
+  'order_options' => $page['order_by_items'],
+  'order_selected' => isset($_POST['order_by']) ? $_POST['order_by'] : '',
+  'direction_options' => $page['direction_items'],
+  'direction_selected' => isset($_POST['direction']) ? $_POST['direction'] : '',
+  
   'F_USERNAME' => @htmlentities($_POST['username'], ENT_COMPAT, 'UTF-8'),
   'F_NAME' => @htmlentities($_POST['name'], ENT_COMPAT, 'UTF-8'),
@@ -86,5 +83,5 @@
 
 
-$template->set_filename('user_collections', dirname(__FILE__) . '/template/sets.tpl');
+$template->set_filename('user_collections', realpath(USER_COLLEC_PATH . 'admin/template/sets.tpl'));
 
 ?>
Index: /extensions/UserCollections/admin/template/sets.tpl
===================================================================
--- /extensions/UserCollections/admin/template/sets.tpl	(revision 23550)
+++ /extensions/UserCollections/admin/template/sets.tpl	(revision 23551)
@@ -56,6 +56,6 @@
     <td style="padding-left:25px;">
       <a href="{$set.U_EDIT}" title="{'Edit this collection'|@translate}"><img src="{$themeconf.admin_icon_dir}/edit_s.png"></a>
-      <a href="{$set.U_EXPORT}" title="{'Export image list'|@translate}"><img src="{$themeconf.admin_icon_dir}/plug_install.png"></a>
-      <a href="{$set.U_DELETE}" title="{'Delete this collection'|@translate}" onClick="return confirm('{'Are your sure?'|@translate}');"><img src="{$themeconf.admin_icon_dir}/delete.png"></a>
+      <a href="{$set.U_EXPORT}" title="{'Export image list'|@translate}"><img src="{$themeconf.admin_icon_dir}/plug_install.png"><span class="icon-upload"></span></a> <!-- temp 2.5/2.6 -->
+      <a href="{$set.U_DELETE}" title="{'Delete this collection'|@translate}" onClick="return confirm('{'Are you sure?'|@translate}');"><img src="{$themeconf.admin_icon_dir}/delete.png"></a>
     </td>
   </tr>
@@ -64,5 +64,5 @@
   {if not $sets}
   <tr class="row2">
-    <td colspan="8" style="text-align:center;font-style:italic;">{'No result'|@translate}</td>
+    <td colspan="8" style="text-align:center;font-style:italic;">{'No results'|@translate}</td>
   </tr>
   {/if}
Index: /extensions/UserCollections/include/UserCollection.class.php
===================================================================
--- /extensions/UserCollections/include/UserCollection.class.php	(revision 23550)
+++ /extensions/UserCollections/include/UserCollection.class.php	(revision 23551)
@@ -9,8 +9,8 @@
   /**
    * __construct
-   * @param: mixed col id (##|'new'|'active')
+   * @param: mixed col id (##|'new')
    * @param: array images
    */
-  function __construct($col_id, $images=array(), $name=null, $active=false, $public=false, $user_id=null)
+  function __construct($col_id, $name=null, $comment=null, $public=false, $user_id=null)
   {
     global $user;
@@ -25,6 +25,6 @@
       'name' => null,
       'date_creation' => '0000-00-00 00:00:00',
+      'domment' => null,
       'nb_images' => 0,
-      'active' => 0,
       'public' => 0,
       'public_id' => null,
@@ -71,5 +71,5 @@
           );
         
-        // make sur all pictures of the collection exist
+        // make sure all pictures of the collection exist
         $query = '
 DELETE FROM '.COLLECTION_IMAGES_TABLE.'
@@ -99,5 +99,5 @@
     {
       $this->data['name'] = $name;
-      $this->data['active'] = (int)$active;
+      $this->data['comment'] = $comment;
       $this->data['public'] = (int)$public;
       $this->data['public_id'] = 'uc'.hash('crc32', uniqid(serialize($this->data), true));
@@ -108,5 +108,5 @@
     name,
     date_creation,
-    active,
+    comment,
     public,
     public_id
@@ -116,5 +116,5 @@
     "'.$this->data['name'].'",
     NOW(),
-    '.(int)$this->data['active'].',
+    "'.$this->data['comment'].'",
     '.(int)$this->data['public'].',
     "'.$this->data['public_id'].'"
@@ -126,9 +126,4 @@
       $date = pwg_query('SELECT NOW();');
       list($this->data['date_creation']) = pwg_db_fetch_row($date);
-      
-      if (!empty($images))
-      {
-        $this->addImages($images);
-      }
     }
     else
@@ -283,6 +278,6 @@
       'ID' => $this->data['id'],
       'NAME' => $this->data['name'],
+      'COMMENT' => $this->data['comment'],
       'NB_IMAGES' => $this->data['nb_images'],
-      'ACTIVE' => (bool)$this->data['active'],
       'PUBLIC' => (bool)$this->data['public'],
       'DATE_CREATION' => $this->data['date_creation'],
@@ -317,5 +312,5 @@
     if (!verify_ephemeral_key(@$key))
     {
-      array_push($errors, l10n('Invalid or expired security key'));
+      array_push($errors, l10n('Invalid key'));
       $comment_action='reject';
     }
Index: /extensions/UserCollections/include/collections.inc.php
===================================================================
--- /extensions/UserCollections/include/collections.inc.php	(revision 23550)
+++ /extensions/UserCollections/include/collections.inc.php	(revision 23551)
@@ -19,5 +19,5 @@
     if (is_a_guest()) access_denied();
     
-    $template->set_filename('index', realpath(USER_COLLEC_PATH.'template/list.tpl'));
+    $template->set_filename('index', realpath(USER_COLLEC_PATH.'template/collections_list.tpl'));
     
     // actions
@@ -35,5 +35,5 @@
           else
           {
-            $UserCollection = new UserCollection('new', array(), $_GET['name'], 1);
+            $UserCollection = new UserCollection('new', $_GET['name']);
             
             if (isset($_GET['redirect']))
@@ -64,20 +64,4 @@
           break;
         }
-        
-        // set active
-        case 'toggle_active':
-        {
-          $query = '
-UPDATE '.COLLECTIONS_TABLE.'
-  SET active = IF(active=1, 0, 1)
-  WHERE
-    user_id = '.$user['id'].'
-    AND id = '.$_GET['col_id'].'
-;';
-          pwg_query($query);
-          
-          redirect(USER_COLLEC_PUBLIC);
-          break;
-        }
       }
     }
@@ -102,5 +86,5 @@
     }
     
-    $template->set_filename('index', realpath(USER_COLLEC_PATH.'template/edit.tpl'));
+    $template->set_filename('index', realpath(USER_COLLEC_PATH.'template/collection_edit.tpl'));
     
     $self_url = USER_COLLEC_PUBLIC . 'edit/'.$page['col_id'];
@@ -109,5 +93,4 @@
       'user_collections' => $conf['user_collections'],
       'F_ACTION' => $self_url,
-      'collection_toggle_url' => $self_url,
       'U_LIST' => USER_COLLEC_PUBLIC,
       'UC_IN_EDIT' => true,
@@ -133,4 +116,5 @@
         }
         $UserCollection->updateParam('public', $_POST['public']);
+        $UserCollection->updateParam('comment', stripslashes($_POST['comment']));
       }
       
@@ -182,5 +166,4 @@
       // add remove item links
       $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_button');
-      $template->set_prefilter('index', 'user_collections_thumbnails_list_cssjs');
       $template->set_prefilter('index_thumbnails', 'user_collections_add_colorbox');
       
@@ -211,6 +194,8 @@
       
       $template->concat('TITLE', 
-        $conf['level_separator'].$UserCollection->getParam('name')
+        $conf['level_separator'].trigger_event('render_category_name', $col['NAME'])
         );
+        
+      $template->assign('CONTENT_DESCRIPTION', trigger_event('render_category_description', nl2br($col['COMMENT'])));
     }
     catch (Exception $e)
@@ -232,11 +217,12 @@
     }
     
-    $template->set_filename('index', dirname(__FILE__).'/../template/view.tpl');
+    $template->set_filename('index', realpath(USER_COLLEC_PATH.'template/collection_view.tpl'));
     
     $self_url = USER_COLLEC_PUBLIC . 'view/'.$page['col_id'];
     
     try {
-      $UserCollection = new UserCollection($page['col_id']);
-      $page['col_id'] = $UserCollection->getParam('id');
+      $UserCollection = new UserCollection($page['col_id']); // public id
+      $page['col_id'] = $UserCollection->getParam('id'); // private id
+      $col = $UserCollection->getCollectionInfo();
       
       $template->set_prefilter('index_thumbnails', 'user_collections_add_colorbox');
@@ -248,7 +234,9 @@
       include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
       $template->concat('TITLE', 
-        $conf['level_separator'].$UserCollection->getParam('name').
-        ' ('.sprintf(l10n('by %s'), get_username($UserCollection->getParam('user_id'))).')'
+        $conf['level_separator'] . trigger_event('render_category_name', $col['NAME']) .
+        ' (' . sprintf(l10n('by %s'), get_username($UserCollection->getParam('user_id'))) . ')'
         );
+        
+      $template->assign('CONTENT_DESCRIPTION', trigger_event('render_category_description', nl2br($col['COMMENT'])));
     }
     catch (Exception $e)
@@ -264,14 +252,10 @@
 function user_collections_categories_list($content, &$samrty)
 {
-  $search[0] = '<div class="thumbnailCategory">';
-  $replace[0] = '<div class="thumbnailCategory {*if $cat.active}activeCollection{/if*}">
+  $search = '<div class="thumbnailCategory">';
+  $replace = '<div class="thumbnailCategory">
   <div class="collectionActions">
     <a href="{$cat.URL}" rel="nofollow">{"Edit"|@translate}</a>
     | <a href="{$cat.U_DELETE}" onClick="return confirm(\'{"Are you sure?"|@translate}\');" rel="nofollow">{"Delete"|@translate}</a>
-    {if $cat.U_ACTIVE}| <a href="{$cat.U_ACTIVE}" rel="nofollow">{if $cat.active}{"set inactive"|@translate}{else}{"set active"|@translate}{/if}</a>{/if}
   </div>';
-  
-  // $search[1] = '<a href="{$cat.URL}">{$cat.NAME}</a>';
-  // $replace[1] = '<a href="{$cat.URL}">{$cat.NAME}</a> {if $cat.active}<span class="collectionActive">({"active"|@translate})</span>{/if}';
   
   return str_replace($search, $replace, $content);
@@ -281,11 +265,7 @@
 function user_collections_add_colorbox($content)
 {
-  // add datas
   $search = '<a href="{$thumbnail.URL}"';
   $replace = $search.' class="preview-box" data-src="{$thumbnail.FILE_SRC}" data-id="{$thumbnail.id}"';
   
-  // colorbox script
-  $content.= file_get_contents(USER_COLLEC_PATH.'template/thumbnails_colorbox.tpl');
-  
   return str_replace($search, $replace, $content);
 }
Index: /extensions/UserCollections/include/display_collections.inc.php
===================================================================
--- /extensions/UserCollections/include/display_collections.inc.php	(revision 23550)
+++ /extensions/UserCollections/include/display_collections.inc.php	(revision 23551)
@@ -97,8 +97,7 @@
       'URL'   => USER_COLLEC_PUBLIC.'edit/'.$category['id'],
       'CAPTION_NB_IMAGES' => empty($counter) ? sprintf(l10n('%d photo'), 0) : $counter,
-      'NAME'  => $category['name'],
+      'NAME'  => trigger_event('render_category_name', $category['name']),
+      'DESCRIPTION'  => trigger_event('render_category_description', $category['comment'], 'subcatify_category_description'),
       'INFO_DATES' => format_date($category['date_creation'], true),
-      
-      // 'U_ACTIVE' => add_url_params(USER_COLLEC_PUBLIC, array('action'=>'toggle_active','col_id'=>$category['id'])),
       'U_DELETE' => add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$category['id'])),
       ));
Index: /extensions/UserCollections/include/display_thumbnails.inc.php
===================================================================
--- /extensions/UserCollections/include/display_thumbnails.inc.php	(revision 23550)
+++ /extensions/UserCollections/include/display_thumbnails.inc.php	(revision 23551)
@@ -134,7 +134,4 @@
         array('start')
       );
-      
-    $thumbnail['COLLECTION_SELECTED'] = true;
-    $thumbnail['COLLECTION_TOGGLE_URL'] = add_url_params($url, array('collection_toggle'=>$thumbnail['id']));
   }
   
Index: /extensions/UserCollections/include/events.inc.php
===================================================================
--- /extensions/UserCollections/include/events.inc.php	(revision 23550)
+++ /extensions/UserCollections/include/events.inc.php	(revision 23551)
@@ -47,9 +47,15 @@
 function user_collections_page()
 {
-  global $page;
+  global $page, $template;
 
   if (isset($page['section']) and $page['section'] == 'collections')
   {
     include(USER_COLLEC_PATH . '/include/collections.inc.php');
+  }
+  
+  if (!is_a_guest() && count($page['items']))
+  {
+    $template->set_filename('uc_tumbnails_cssjs', realpath(USER_COLLEC_PATH . 'template/thumbnails_css_js.tpl'));
+    $template->parse('uc_tumbnails_cssjs');
   }
 }
@@ -98,5 +104,5 @@
   // get all collections
   $query = '
-SELECT id, name, nb_images, active
+SELECT id, name, nb_images
   FROM '.COLLECTIONS_TABLE.'
   WHERE user_id = '.$user['id'].'
@@ -104,4 +110,10 @@
 ;';
   $collections = hash_from_query($query, 'id');
+  
+  foreach ($collections as &$col)
+  {
+    $col["name"] = trigger_event("render_category_name", $col["name"]);
+  }
+  unset($col);
   
   $template->assign(array(
@@ -112,5 +124,4 @@
   // thumbnails buttons
   $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_button');
-  $template->set_prefilter('index', 'user_collections_thumbnails_list_cssjs');
   
   return $tpl_thumbnails_var;
@@ -133,11 +144,4 @@
 }
 
-// add css & js and menu
-function user_collections_thumbnails_list_cssjs($content, &$smarty)
-{
-  $content.= file_get_contents(USER_COLLEC_PATH.'template/thumbnails_css_js.tpl');
-  return $content;
-}
-
 
 // +-----------------------------------------------------------------------+
@@ -167,5 +171,5 @@
   // get all collections
   $query = '
-SELECT id, name, nb_images, active
+SELECT id, name, nb_images
   FROM '.COLLECTIONS_TABLE.'
   WHERE user_id = '.$user['id'].'
@@ -173,4 +177,10 @@
 ;';
   $collections = hash_from_query($query, 'id');
+  
+  foreach ($collections as &$col)
+  {
+    $col["name"] = trigger_event("render_category_name", $col["name"]);
+  }
+  unset($col);
   
   $template->assign(array(
@@ -214,10 +224,8 @@
   {
     $query = '
-SELECT *
+SELECT id, name, nb_images
   FROM '.COLLECTIONS_TABLE.'
   WHERE user_id = '.$user['id'].'
-  ORDER BY
-    active DESC,
-    date_creation DESC
+  ORDER BY date_creation DESC
 ;';
     $collections = array_values(hash_from_query($query, 'id'));
@@ -226,5 +234,6 @@
     for ($i=0; $i<$max && $i<count($collections); $i++)
     {
-      $collections[$i]['U_EDIT'] = USER_COLLEC_PUBLIC.'edit/'.$collections[$i]['id'];
+      $collections[$i]['name'] = trigger_event('render_category_name', $collections[$i]['name']);
+      $collections[$i]['u_edit'] = USER_COLLEC_PUBLIC.'edit/'.$collections[$i]['id'];
       $data['collections'][] = $collections[$i];
     }
@@ -239,7 +248,6 @@
     $data['U_CREATE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0','redirect'=>'true'));
     
-    $template->set_template_dir(USER_COLLEC_PATH . 'template/');
     $block->set_title('<a href="'.USER_COLLEC_PUBLIC.'">'.l10n('Collections').'</a>');
-    $block->template = 'menublock_user_collec.tpl';
+    $block->template = realpath(USER_COLLEC_PATH . 'template/menublock.tpl');
     $block->data = $data;
   }
Index: /extensions/UserCollections/include/functions.inc.php
===================================================================
--- /extensions/UserCollections/include/functions.inc.php	(revision 23550)
+++ /extensions/UserCollections/include/functions.inc.php	(revision 23551)
@@ -1,34 +1,4 @@
 <?php
 defined('USER_COLLEC_PATH') or die('Hacking attempt!');
-
-function get_current_collection_id($create=true)
-{
-  global $user;
-  
-  // active in db
-  $query = '
-SELECT id
-  FROM '.COLLECTIONS_TABLE.'
-  WHERE
-    active = 1
-    AND user_id = '.$user['id'].'
-;';
-  $result = pwg_query($query);
-  
-  if (pwg_db_num_rows($result))
-  {
-    list($col_id) = pwg_db_fetch_row($result);
-    return $col_id;
-  }
-  
-  // new one
-  if ($create)
-  {
-    $UserCollection = new UserCollection('new', array(), 'temp', 1);
-    return $UserCollection->getParam('id');
-  }
-  
-  return false;
-}
 
 function uc_check_email_validity($mail_address)
Index: /extensions/UserCollections/include/install.inc.php
===================================================================
--- /extensions/UserCollections/include/install.inc.php	(revision 23550)
+++ /extensions/UserCollections/include/install.inc.php	(revision 23551)
@@ -24,6 +24,6 @@
   `name` varchar(255) NOT NULL,
   `date_creation` datetime NOT NULL,
+  `comment` text NULL,
   `nb_images` mediumint(8) NOT NULL DEFAULT 0,
-  `active` tinyint(1) DEFAULT 0,
   `public` tinyint(1) DEFAULT 0,
   `public_id` varchar(10) NULL,
@@ -48,4 +48,11 @@
     pwg_query('ALTER TABLE `'.$prefixeTable.'collection_images` ADD `add_date` DATETIME NULL;');
   }
+  
+  $result = pwg_query('SHOW COLUMNS FROM `'.$prefixeTable.'collections` LIKE "comment";');
+  if (!pwg_db_num_rows($result))
+  {
+    pwg_query('ALTER TABLE `'.$prefixeTable.'collections` ADD `comment` TEXT NULL;');
+    pwg_query('ALTER TABLE `'.$prefixeTable.'collections` DROP `active`;');
+  }
 }
 
Index: /extensions/UserCollections/include/ws_functions.inc.php
===================================================================
--- /extensions/UserCollections/include/ws_functions.inc.php	(revision 23550)
+++ /extensions/UserCollections/include/ws_functions.inc.php	(revision 23551)
@@ -12,6 +12,6 @@
     array(
       'name' => array(),
+      'comment' => array('default' => null),
       'user_id' => array('default' => null, 'info'=>'Admin parameter, default is current user'),
-      'active' => array('default' => 0),
       'public' => array('default' => 0),
       ),
@@ -32,11 +32,12 @@
     'ws_collections_getList',
     array(
-      'col_id' => array('default' => null),
       'user_id' => array('default' => null, 'info'=>'Admin parameter, default is current user'),
       'name' => array('default' => null),
       'public' => array('default' => null),
-      'active' => array('default' => null),
-      ),
-    'Retrive a list of collections.'
+      'per_page' => array('default'=>100, 'maxValue'=>ceil($conf['ws_max_images_per_page']/10)),
+      'page' => array('default'=>0),
+      'order' => array('default'=>'username ASC, name ASC'),
+      ),
+    'Returns a list of collections.'
     );
     
@@ -81,8 +82,17 @@
         'default'=>array('id','name','url','path'),
         'flags'=>WS_PARAM_FORCE_ARRAY,
-        'info'=>'Available options are: id, file, name, url, path'
+        'info'=>'Available options are: id,file,name,url,path,date_creation,collection_add_date,filesize,width,height'
         ),
       ),
     'Returns a serialized version of the collection in CSV.<br>The return type is plain/text whatever you select as response format.'
+    );
+    
+  $service->addMethod(
+    'pwg.collections.getInfo',
+    'ws_collections_getInfo',
+    array(
+      'col_id' => array('info'=>'The current user must be admin or owner of the collection'),
+      ),
+    'Returns basic info about a collection.'
     );
 }
@@ -135,15 +145,7 @@
   }
   
-  // check active
-  if ($params['active'] != 0 and $params['active'] != 1)
-  {
-    return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid "active" value, 0 or 1.');
-  }
-  
-  $UserCollection = new UserCollection('new', array(), $params['name'], $params['active'], $params['public'], $params['user_id']);
-  
-  $infos = array_change_key_case($UserCollection->getCollectionInfo(), CASE_LOWER);
-  
-  return $infos;
+  $UserCollection = new UserCollection('new', $params['name'], $params['comment'], $params['public'], $params['user_id']);
+  
+  return array_change_key_case($UserCollection->getCollectionInfo(), CASE_LOWER);
 }
 
@@ -233,10 +235,4 @@
   }
   
-  // check collection id
-  if ( !empty($params['col_id']) and !preg_match('#^[0-9]+$#', $params['col_id']) )
-  {
-    return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid collection id');
-  }
-  
   // check public
   if ( !empty($params['public']) and $params['public'] != 0 and $params['public'] != 1 )
@@ -245,16 +241,6 @@
   }
   
-  // check active
-  if ( !empty($params['active']) and $params['active'] != 0 and $params['active'] != 1 )
-  {
-    return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid "active" value, 0 or 1.');
-  }
-  
   // search
   $where_clauses = array('1=1');
-  if (!empty($params['col_id']))
-  {
-    $where_clauses[] = 'c.id = '.$params['col_id'];
-  }
   if (!empty($params['user_id']))
   {
@@ -265,12 +251,10 @@
     $where_clauses[] = 'public = '.$params['public'];
   }
-  if (!empty($params['active']))
-  {
-    $where_clauses[] = 'active = '.$params['active'];
-  }
   if (!empty($params['name']))
   {
     $where_clauses[] = 'name LIKE("%'.pwg_db_real_escape_string($params['name']).'%")';
   }
+  
+  $order_by = !empty($params['order']) ? $params['order'] : 'username ASC, name ASC';
   
   $query = '
@@ -283,16 +267,17 @@
   WHERE
     '.implode("\n    AND ", $where_clauses).'
-  ORDER BY username ASC, name ASC
+  ORDER BY '.$order_by.'
+  LIMIT '.(int)$params['per_page'].' OFFSET '.(int)($params['per_page']*$params['page']).'
 ;';
   $sets = hash_from_query($query, 'id');
   
-  $ret = array();
+  $data = array();
   foreach ($sets as $row)
   {
-    $ret[] = array(
+    $data[] = array(
       'id' => $row['id'],
       'name' => $row['name'],
+      'comment' => $row['comment'],
       'nb_images' => $row['nb_images'],
-      'active' => (bool)$row['active'],
       'public' => (bool)$row['public'],
       'date_creation' => $row['date_creation'],
@@ -303,4 +288,16 @@
       );
   }
+  
+  return array(
+    'paging' => new PwgNamedStruct(array(
+        'page' => $params['page'],
+        'per_page' => $params['per_page'],
+        'count' => count($data)
+        )),
+    'collections' => new PwgNamedArray(
+      $data,
+      'collection'
+      )
+    );
   
   return $ret;
@@ -413,41 +410,42 @@
   WHERE 
     '. implode("\n AND ", $where_clauses).'
-GROUP BY i.id
-'.$order_by.'
-LIMIT '.(int)$params['per_page'].' OFFSET '.(int)($params['per_page']*$params['page']);
-
-    $result = pwg_query($query);
-    while ($row = pwg_db_fetch_assoc($result))
-    {
-      $image = array();
-      foreach (array('id', 'width', 'height', 'hit') as $k)
+  GROUP BY i.id
+  '.$order_by.'
+  LIMIT '.(int)$params['per_page'].' OFFSET '.(int)($params['per_page']*$params['page']).'
+;';
+
+      $result = pwg_query($query);
+      while ($row = pwg_db_fetch_assoc($result))
       {
-        if (isset($row[$k]))
+        $image = array();
+        foreach (array('id', 'width', 'height', 'hit') as $k)
         {
-          $image[$k] = (int)$row[$k];
+          if (isset($row[$k]))
+          {
+            $image[$k] = (int)$row[$k];
+          }
         }
+        foreach (array('file', 'name', 'comment', 'date_creation', 'date_available') as $k)
+        {
+          $image[$k] = $row[$k];
+        }
+        $image = array_merge($image, ws_std_get_urls($row));
+        
+        array_push($images, $image);
       }
-      foreach (array('file', 'name', 'comment', 'date_creation', 'date_available') as $k)
-      {
-        $image[$k] = $row[$k];
-      }
-      $image = array_merge($image, ws_std_get_urls($row));
-      
-      array_push($images, $image);
     }
-  }
-
-  return array('images' => array(
-    WS_XML_ATTRIBUTES => array(
-      'page' => $params['page'],
-      'per_page' => $params['per_page'],
-      'count' => count($images)
-      ),
-    WS_XML_CONTENT => new PwgNamedArray(
-      $images, 
-      'image', 
-      ws_std_get_image_xml_attributes()
-      ),
-    ));
+    
+    return array(
+      'paging' => new PwgNamedStruct(array(
+          'page' => $params['page'],
+          'per_page' => $params['per_page'],
+          'count' => count($images)
+          )),
+      'images' => new PwgNamedArray(
+        $images,
+        'image',
+        ws_std_get_image_xml_attributes()
+        )
+      );
   }
   catch (Exception $e)
@@ -491,3 +489,34 @@
   }
 }
+
+/**
+ * get info about a collection
+ */
+function ws_collections_getInfo($params, &$service)
+{
+  global $conf, $user;
+  
+  // check status
+  if (is_a_guest())
+  {
+    return new PwgError(403, 'Forbidden');
+  }
+  
+  // check collection id
+  if (!preg_match('#^[0-9]+$#', $params['col_id']))
+  {
+    return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid collection id');
+  }
+
+  try {
+    $UserCollection = new UserCollection($params['col_id']);
+  
+    return array_change_key_case($UserCollection->getCollectionInfo(), CASE_LOWER);
+  }
+  catch (Exception $e)
+  {
+    return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid collection id');
+  }
+}
+
 ?>
Index: /extensions/UserCollections/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/UserCollections/language/en_UK/plugin.lang.php	(revision 23550)
+++ /extensions/UserCollections/language/en_UK/plugin.lang.php	(revision 23551)
@@ -8,8 +8,4 @@
 $lang['Collection name:'] = 'Collection name:';
 $lang['Create a new collection'] = 'Create a new collection';
-$lang['Unsaved collections'] = 'Unsaved collections';
-$lang['save'] = 'save';
-$lang['set active'] = 'set active';
-$lang['Saved collections'] = 'Saved collections';
 $lang['See all my collections'] = 'See all my collections';
 $lang['Please give a name'] = 'Please give a name';
@@ -24,5 +20,4 @@
 $lang['You have no collection'] = 'You have no collection';
 $lang['You have %d collections'] = 'You have %d collections';
-$lang['active'] = 'active';
 $lang['Save'] = 'Save';
 $lang['%d more...'] = '%d more...';
Index: /extensions/UserCollections/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/UserCollections/language/fr_FR/plugin.lang.php	(revision 23550)
+++ /extensions/UserCollections/language/fr_FR/plugin.lang.php	(revision 23551)
@@ -8,8 +8,4 @@
 $lang['Collection name:'] = 'Nom de la collection:';
 $lang['Create a new collection'] = 'Créer une nouvelle collection';
-$lang['Unsaved collections'] = 'Collections temporaires';
-$lang['save'] = 'sauvegarder';
-$lang['set active'] = 'choisir comme collection active';
-$lang['Saved collections'] = 'Collections sauvegardées';
 $lang['See all my collections'] = 'Voir toutes mes collections';
 $lang['Please give a name'] = 'Veuillez donner un nom';
@@ -24,5 +20,4 @@
 $lang['You have no collection'] = 'Vous n\'avez aucune collection';
 $lang['You have %d collections'] = 'Vous avez %d collections';
-$lang['active'] = 'active';
 $lang['Save'] = 'Sauvegarder';
 $lang['%d more...'] = 'et %d autres...';
Index: /extensions/UserCollections/main.inc.php
===================================================================
--- /extensions/UserCollections/main.inc.php	(revision 23550)
+++ /extensions/UserCollections/main.inc.php	(revision 23551)
@@ -19,9 +19,9 @@
 
 defined('USER_COLLEC_ID') or define('USER_COLLEC_ID', basename(dirname(__FILE__)));
-define('USER_COLLEC_PATH',       PHPWG_PLUGINS_PATH . USER_COLLEC_ID . '/');
-define('COLLECTIONS_TABLE',      $prefixeTable.'collections');
-define('COLLECTION_IMAGES_TABLE',$prefixeTable.'collection_images');
-define('USER_COLLEC_ADMIN',      get_root_url() . 'admin.php?page=plugin-' . USER_COLLEC_ID);
-define('USER_COLLEC_PUBLIC',     get_absolute_root_url() . make_index_url(array('section' => 'collections')) . '/');
+define('USER_COLLEC_PATH',        PHPWG_PLUGINS_PATH . USER_COLLEC_ID . '/');
+define('COLLECTIONS_TABLE',       $prefixeTable.'collections');
+define('COLLECTION_IMAGES_TABLE', $prefixeTable.'collection_images');
+define('USER_COLLEC_ADMIN',       get_root_url() . 'admin.php?page=plugin-' . USER_COLLEC_ID);
+define('USER_COLLEC_PUBLIC',      get_absolute_root_url() . make_index_url(array('section' => 'collections')) . '/');
 define('USER_COLLEC_VERSION',    'auto');
 
Index: /extensions/UserCollections/maintain.inc.php
===================================================================
--- /extensions/UserCollections/maintain.inc.php	(revision 23550)
+++ /extensions/UserCollections/maintain.inc.php	(revision 23551)
@@ -24,4 +24,5 @@
   global $prefixeTable;
   
+  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "user_collections" LIMIT 1;');
   pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'collections`;');
   pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'collection_images`;');
Index: /extensions/UserCollections/template/collection_edit.tpl
===================================================================
--- /extensions/UserCollections/template/collection_edit.tpl	(revision 23551)
+++ /extensions/UserCollections/template/collection_edit.tpl	(revision 23551)
@@ -0,0 +1,188 @@
+{combine_css path=$USER_COLLEC_PATH|cat:'template/style_collections.css'}
+{combine_script id='ZeroClipboard' path=$USER_COLLEC_PATH|cat:'template/resources/ZeroClipboard.min.js'}
+{include file=$USER_COLLEC_ABS_PATH|cat:'template/thumbnails_colorbox.tpl'}
+
+{footer_script require='jquery'}
+{if $user_collections.allow_public}
+ZeroClipboard.setDefaults( {ldelim} moviePath: "{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/ZeroClipboard.swf" } );
+var clip = new ZeroClipboard();
+
+clip.glue(jQuery("#publicURL .button").get());
+clip.addEventListener('onMouseOver', function() {ldelim}
+  clip.setText(jQuery("#publicURL .url").val());
+});
+clip.addEventListener('complete', function() {ldelim}
+  jQuery('.confirm').remove();
+  jQuery("#publicURL .url").select();
+  jQuery('<span class="confirm" style="display:none;">{'Copied'|@translate}</span>').appendTo("#publicURL")
+    .fadeIn(400).delay(1000).fadeOut(400, function(){ldelim} jQuery(this).remove(); });
+});
+
+jQuery("#publicURL .url").click(function() {ldelim}
+  jQuery(this).select();
+});
+
+jQuery("input[name='public']").change(function() {ldelim}
+  jQuery("#publicURL").fadeToggle("fast");
+});
+{/if}
+
+{if $collection.PUBLIC && $user_collections.allow_mails}
+  jQuery(window).load(function(){ldelim}
+    jQuery(".mail_colorbox_open").colorbox({ldelim}
+      {if isset($uc_mail_errors)}open: true, transition:"none",{/if}
+      inline:true
+    });
+    jQuery(".mail_colorbox_close").click(function() {ldelim}
+      jQuery(".mail_colorbox_open").colorbox.close();
+      return false;
+    })
+  });
+  jQuery("#mail_form").css('background-color', jQuery("#the_page #content").css('background-color'));
+{/if}
+
+jQuery("#edit_form_show").click(function() {ldelim}
+  jQuery("#edit_form_show").hide();
+  jQuery(".additional_info").hide();
+  jQuery("#edit_form").show();
+});
+jQuery("#edit_form_hide").click(function() {ldelim}
+  jQuery("#edit_form_show").show();
+  jQuery(".additional_info").show();
+  jQuery("#edit_form").hide();
+});
+{/footer_script}
+
+
+{* <!-- Menubar & titrePage --> *}
+{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/stripped.tpl'}
+  {assign var="clear" value="true"}
+{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/simple.tpl'}
+  {assign var="clear" value="true"}
+{else}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/default.tpl'}
+{/if}
+
+{if isset($errors) or not empty($infos)}
+{include file='infos_errors.tpl'}
+{/if}
+
+
+{if !empty($CONTENT_DESCRIPTION)}
+<div class="additional_info">
+	{$CONTENT_DESCRIPTION}
+</div>
+{/if}
+
+<p style="text-align:center;"><input type="submit" id="edit_form_show" value="{'Edit'|@translate}"></p>
+
+{* <!-- edit collection -->*}
+<form action="{$F_ACTION}" method="post" id="edit_form" style="display:none;">
+<fieldset id="colProperties">
+  <legend>{'Properties'|@translate}</legend>
+  
+  <p class="title"><label for="name">{'Name'|@translate}</label></p>
+  <p><input type="text" name="name" id="name" value="{$collection.NAME|escape:html}" size="60"></p>
+  
+  <p class="title"><label for="comment">{'Description'|@translate}</label></p>
+  <p><textarea name="comment" id="comment" style="width:400px;height:100px;">{$collection.COMMENT}</textarea></p>
+  
+{if $user_collections.allow_public}
+  <p class="title">{'Public collection'|@translate}</p>
+  <p>
+    <label><input type="radio" name="public" value="0" {if not $collection.PUBLIC}checked="checked"{/if}> {'No'|@translate}</label>
+    <label><input type="radio" name="public" value="1" {if $collection.PUBLIC}checked="checked"{/if}> {'Yes'|@translate}</label>
+    <span id="publicURL" {if not $collection.PUBLIC}style="display:none;"{/if}><!--
+    --><span class="button" title="{'Copy to clipboard'|@translate}">&nbsp;</span><!--
+    --><input type="text" class="url" value="{$collection.U_PUBLIC}" size="{$collection.U_PUBLIC|strlen}"><!--
+  --></span>
+  </p>
+{/if}
+
+  <p>
+    <input type="submit" name="save_col" value="{'Save'|@translate}">
+    <a id="edit_form_hide">{'Cancel'|@translate}</a>
+  </p>
+</fieldset>
+</form>
+
+
+{* <!-- send collection by mail -->*}
+{if $user_collections.allow_public && $user_collections.allow_mails}
+<div style="display:none;">
+  <form id="mail_form" action="{$F_ACTION}" method="post">
+  {if isset($uc_mail_errors)}
+    {assign var=errors value=$uc_mail_errors}
+    {include file='infos_errors.tpl'}
+  {/if}
+
+    <table>
+      <tr>
+        <td class="title"><label for="sender_name">{'Your name'|@translate}</label></td>
+        <td>
+          <input type="text" name="sender_name" id="sender_name" size="40" value="{$contact.sender_name}">
+        </td>
+      </tr>
+      <tr>
+        <td class="title"><label for="sender_email">{'Your e-mail'|@translate}</label></td>
+        <td>
+          <input type="text" name="sender_email" id="sender_email" size="40" value="{$contact.sender_email}">
+        </td>
+      </tr>
+      <tr>
+        <td class="title"><label for="recipient_name">{'Recipient name'|@translate}</label></td>
+        <td>
+          <input type="text" name="recipient_name" id="recipient_name" size="40" value="{$contact.recipient_name}">
+        </td>
+      </tr>
+      <tr>
+        <td class="title"><label for="recipient_email">{'Recipient e-mail'|@translate}</label></td>
+        <td>
+          <input type="text" name="recipient_email" id="recipient_email" size="40" value="{$contact.recipient_email}">
+        </td>
+      </tr>
+      <tr>
+        <td class="title"><label for="nb_images">{'Number of images'|@translate}</label></td>
+        <td>
+          <select name="nb_images">
+            <option value="2" {if $contact.nb_images==2}selected="selected"{/if}>2</option>
+            <option value="4" {if $contact.nb_images==4}selected="selected"{/if}>4</option>
+            <option value="8" {if $contact.nb_images==8}selected="selected"{/if}>8</option>
+          </select>
+        </td>
+      </tr>
+      <tr>
+        <td class="title"><label for="message">{'Message (optional)'|@translate}</label></td>
+        <td><textarea name="message" id="message" rows="6" style="width:350px;">{$contact.message}</textarea></td>
+      </tr>
+      <tr>
+        <td class="title">&nbsp;</td>
+        <td>
+          <input class="submit" type="submit" name="send_mail" value="{'Send'|@translate}">
+          <a class="mail_colorbox_close" href="#">{'Cancel'|@translate}</a>
+          <input type="hidden" name="key" value="{$contact.KEY}" />
+        </td>
+      </tr>
+    </table>
+  </form>
+</div>
+{/if}
+
+
+{* <!-- collection content -->*}
+{if $collection.NB_IMAGES > 0}
+<ul class="thumbnails" id="thumbnails">
+{$THUMBNAILS}
+</ul>
+{else}
+<p><i>{'This collection is empty'|@translate}</i></p>
+{/if}
+
+{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+
+
+{if isset($clear)}<div style="clear: both;"></div>
+</div>{/if}
+</div>{* <!-- content --> *}
Index: /extensions/UserCollections/template/collection_view.tpl
===================================================================
--- /extensions/UserCollections/template/collection_view.tpl	(revision 23551)
+++ /extensions/UserCollections/template/collection_view.tpl	(revision 23551)
@@ -0,0 +1,36 @@
+{combine_css path=$USER_COLLEC_PATH|cat:'template/style_collections.css'}
+{include file=$USER_COLLEC_ABS_PATH|cat:'template/thumbnails_colorbox.tpl'}
+
+
+{* <!-- Menubar & titrePage --> *}
+{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/stripped.tpl'}
+  {assign var="clear" value="true"}
+{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/simple.tpl'}
+  {assign var="clear" value="true"}
+{else}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/default.tpl'}
+{/if}
+
+{if isset($errors) or not empty($infos)}
+{include file='infos_errors.tpl'}
+{/if}
+
+{if !empty($CONTENT_DESCRIPTION)}
+<div class="additional_info">
+	{$CONTENT_DESCRIPTION}
+</div>
+{/if}
+
+{if !empty($THUMBNAILS)}
+<ul class="thumbnails" id="thumbnails">
+{$THUMBNAILS}
+</ul>
+{/if}
+
+{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+
+{if isset($clear)}<div style="clear: both;"></div>
+</div>{/if}
+</div>{* <!-- content --> *}
Index: /extensions/UserCollections/template/collections_list.tpl
===================================================================
--- /extensions/UserCollections/template/collections_list.tpl	(revision 23551)
+++ /extensions/UserCollections/template/collections_list.tpl	(revision 23551)
@@ -0,0 +1,43 @@
+{combine_css path=$USER_COLLEC_PATH|cat:'template/style_collections.css'}
+
+{footer_script require='jquery'}
+jQuery(".new_col").click(function() {ldelim}
+  var name = prompt("{'Collection name:'|@translate}");
+  if (name != null) {ldelim}
+    $(this).attr("href",  $(this).attr("href") +"&name="+ name);
+    return true;
+  } else {ldelim}
+    return false;
+  }
+});
+
+jQuery(".titrePage h2").append(" [{$COLLECTIONS_COUNT}]");
+{/footer_script}
+
+{* <!-- Menubar & titrePage --> *}
+{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/stripped.tpl'}
+  {assign var="clear" value="true"}
+{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/simple.tpl'}
+  {assign var="clear" value="true"}
+{else}
+  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/default.tpl'}
+{/if}
+
+{if isset($errors) or not empty($infos)}
+{include file='infos_errors.tpl'}
+{/if}
+
+
+<p style="text-align:left;font-weight:bold;margin:20px;"><a href="{$U_CREATE}" class="new_col">{'Create a new collection'|@translate}</a></p>
+
+{if !empty($CATEGORIES)}
+{$CATEGORIES}
+{else}
+{'You have no collection'|@translate}
+{/if}
+
+{if isset($clear)}<div style="clear: both;"></div>
+</div>{/if}
+</div>{* <!-- content --> *}
Index: tensions/UserCollections/template/edit.tpl
===================================================================
--- /extensions/UserCollections/template/edit.tpl	(revision 23550)
+++ 	(revision )
@@ -1,164 +1,0 @@
-{combine_css path=$USER_COLLEC_PATH|@cat:"template/style.css"}
-{combine_script id='ZeroClipboard' path=$USER_COLLEC_PATH|@cat:"template/resources/ZeroClipboard.min.js"}
-
-{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
-{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
-
-{footer_script require='jquery'}
-{if $user_collections.allow_public}
-ZeroClipboard.setDefaults( {ldelim} moviePath: "{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/ZeroClipboard.swf" } );
-var clip = new ZeroClipboard();
-clip.glue(jQuery("#publicURL .button").get());
-clip.addEventListener('onMouseOver', function() {ldelim}
-  clip.setText(jQuery("#publicURL .url").val());
-});
-clip.addEventListener('complete', function() {ldelim}
-  jQuery('.confirm').remove();
-  jQuery("#publicURL .url").select();
-  jQuery('<span class="confirm" style="display:none;">{'Copied'|@translate}</span>').appendTo("#publicURL")
-    .fadeIn(400).delay(1000).fadeOut(400, function(){ldelim} jQuery(this).remove(); });
-});
-
-jQuery("#publicURL .url").click(function() {ldelim}
-  jQuery(this).select();
-});
-
-jQuery("input[name='public']").change(function() {ldelim}
-  jQuery("#publicURL").fadeToggle("fast");
-});
-{/if}
-
-{if $collection.PUBLIC && $user_collections.allow_mails}
-  jQuery(window).load(function(){ldelim}
-    jQuery(".mail_colorbox_open").colorbox({ldelim}
-      {if isset($uc_mail_errors)}open: true, transition:"none",{/if}
-      inline:true
-    });
-    jQuery(".mail_colorbox_close").click(function() {ldelim}
-      jQuery(".mail_colorbox_open").colorbox.close();
-      return false;
-    })
-  });
-  jQuery("#mail_form").css('background-color', jQuery("#the_page #content").css('background-color'));
-{/if}
-{/footer_script}
-
-
-{* <!-- Menubar & titrePage --> *}
-{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/stripped.tpl'}
-  {assign var="clear" value="true"}
-{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/simple.tpl'}
-  {assign var="clear" value="true"}
-{else}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/default.tpl'}
-{/if}
-
-{if isset($errors) or not empty($infos)}
-{include file='infos_errors.tpl'}
-{/if}
-
-
-{if $collection}
-{* <!-- edit collection -->*}
-<form action="{$F_ACTION}" method="post">
-<fieldset id="colProperties">
-  <legend>{'Properties'|@translate}</legend>
-  
-  <p class="title"><label for="name">{'Name'|@translate}</label></p>
-  <p><input type="text" name="name" id="name" value="{$collection.NAME|escape:html}" size="60"></p>
-{if $user_collections.allow_public}
-  <p class="title">{'Public collection'|@translate}</p>
-  <p>
-    <label><input type="radio" name="public" value="0" {if not $collection.PUBLIC}checked="checked"{/if}> {'No'|@translate}</label>
-    <label><input type="radio" name="public" value="1" {if $collection.PUBLIC}checked="checked"{/if}> {'Yes'|@translate}</label>
-    <span id="publicURL" {if not $collection.PUBLIC}style="display:none;"{/if}><!--
-    --><span class="button" title="{'Copy to clipboard'|@translate}">&nbsp;</span><!--
-    --><input type="text" class="url" value="{$collection.U_PUBLIC}" size="{$collection.U_PUBLIC|strlen}"><!--
-  --></span>
-  </p>
-{/if}
-  <p>
-    <input type="submit" name="save_col" value="{'Save'|@translate}">
-    <a href="{$U_LIST}" rel="nofollow">{'Return to collections list'|@translate}</a>
-  </p>
-</fieldset>
-</form>
-
-{* <!-- send collection by mail -->*}
-{if $user_collections.allow_public && $user_collections.allow_mails}
-<div style="display:none;">
-  <form id="mail_form" action="{$F_ACTION}" method="post">
-  {if isset($uc_mail_errors)}
-    {assign var=errors value=$uc_mail_errors}
-    {include file='infos_errors.tpl'}
-  {/if}
-
-    <table>
-      <tr>
-        <td class="title"><label for="sender_name">{'Your name'|@translate}</label></td>
-        <td>
-          <input type="text" name="sender_name" id="sender_name" size="40" value="{$contact.sender_name}">
-        </td>
-      </tr>
-      <tr>
-        <td class="title"><label for="sender_email">{'Your e-mail'|@translate}</label></td>
-        <td>
-          <input type="text" name="sender_email" id="sender_email" size="40" value="{$contact.sender_email}">
-        </td>
-      </tr>
-      <tr>
-        <td class="title"><label for="recipient_name">{'Recipient name'|@translate}</label></td>
-        <td>
-          <input type="text" name="recipient_name" id="recipient_name" size="40" value="{$contact.recipient_name}">
-        </td>
-      </tr>
-      <tr>
-        <td class="title"><label for="recipient_email">{'Recipient e-mail'|@translate}</label></td>
-        <td>
-          <input type="text" name="recipient_email" id="recipient_email" size="40" value="{$contact.recipient_email}">
-        </td>
-      </tr>
-      <tr>
-        <td class="title"><label for="nb_images">{'Number of images'|@translate}</label></td>
-        <td>
-          <select name="nb_images">
-            <option value="2" {if $contact.nb_images==2}selected="selected"{/if}>2</option>
-            <option value="4" {if $contact.nb_images==4}selected="selected"{/if}>4</option>
-            <option value="8" {if $contact.nb_images==8}selected="selected"{/if}>8</option>
-          </select>
-        </td>
-      </tr>
-      <tr>
-        <td class="title"><label for="message">{'Message (optional)'|@translate}</label></td>
-        <td><textarea name="message" id="message" rows="6" style="width:350px;">{$contact.message}</textarea></td>
-      </tr>
-      <tr>
-        <td class="title">&nbsp;</td>
-        <td>
-          <input class="submit" type="submit" name="send_mail" value="{'Send'|@translate}">
-          <a class="mail_colorbox_close" href="#">{'Cancel'|@translate}</a>
-          <input type="hidden" name="key" value="{$contact.KEY}" />
-        </td>
-      </tr>
-    </table>
-  </form>
-</div>
-{/if}
-
-{* <!-- collection content -->*}
-{if $collection.NB_IMAGES > 0}
-<ul class="thumbnails" id="thumbnails">
-{$THUMBNAILS}
-</ul>
-{else}
-<p><i>{'This collection is empty'|@translate}</i></p>
-{/if}
-
-{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
-{/if}
-
-{if $clear}<div style="clear: both;"></div>
-</div>{/if}
-</div>{* <!-- content --> *}
Index: tensions/UserCollections/template/list.tpl
===================================================================
--- /extensions/UserCollections/template/list.tpl	(revision 23550)
+++ 	(revision )
@@ -1,43 +1,0 @@
-{combine_css path=$USER_COLLEC_PATH|@cat:"template/style.css"}
-
-{footer_script require='jquery'}
-jQuery(".new_col").click(function() {ldelim}
-  var name = prompt("{'Collection name:'|@translate}");
-  if (name != null) {ldelim}
-    $(this).attr("href",  $(this).attr("href") +"&name="+ name);
-    return true;
-  } else {ldelim}
-    return false;
-  }
-});
-
-jQuery(".titrePage h2").append(" [{$COLLECTIONS_COUNT}]");
-{/footer_script}
-
-{* <!-- Menubar & titrePage --> *}
-{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/stripped.tpl'}
-  {assign var="clear" value="true"}
-{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/simple.tpl'}
-  {assign var="clear" value="true"}
-{else}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/default.tpl'}
-{/if}
-
-{if isset($errors) or not empty($infos)}
-{include file='infos_errors.tpl'}
-{/if}
-
-
-<p style="text-align:left;font-weight:bold;margin:20px;"><a href="{$U_CREATE}" class="new_col">{'Create a new collection'|@translate}</a></p>
-
-{if !empty($CATEGORIES)}
-{$CATEGORIES}
-{else}
-{'You have no collection'|@translate}
-{/if}
-
-{if $clear}<div style="clear: both;"></div>
-</div>{/if}
-</div>{* <!-- content --> *}
Index: /extensions/UserCollections/template/menublock.tpl
===================================================================
--- /extensions/UserCollections/template/menublock.tpl	(revision 23551)
+++ /extensions/UserCollections/template/menublock.tpl	(revision 23551)
@@ -0,0 +1,21 @@
+<dt>{$block->get_title()}</dt>
+<dd>
+  <p>
+    {if $block->data.NB_COL == 0}
+      {'You have no collection'|@translate}
+    {else}
+      <a href="{$block->data.U_LIST}">{$pwg->l10n_dec('You have %d collection', 'You have %d collections', $block->data.NB_COL)}</a>
+    {/if}</p>
+  {if $block->data.collections}
+  <ul>{strip}
+		{foreach from=$block->data.collections item=col}
+		<li>
+      <a href="{$col.u_edit}" rel="nofollow">{$col.name}</a>&nbsp; 
+      <span class="menuInfoCat">[<span class="nbImagesCollec-{$col.id}">{$col.nb_images}</span>]</span>
+    </li>
+		{/foreach}
+    {if isset($block->data.MORE)}<li class="menuInfoCat"><a href="{$block->data.U_LIST}">{'%d more...'|@translate|sprintf:$block->data.MORE}</a></li>{/if}
+	{/strip}</ul>
+  {/if}
+  <p><a href="{$block->data.U_CREATE}" rel="nofollow">{'Create a new collection'|@translate}</a></p>
+</dd>
Index: tensions/UserCollections/template/menublock_user_collec.tpl
===================================================================
--- /extensions/UserCollections/template/menublock_user_collec.tpl	(revision 23550)
+++ 	(revision )
@@ -1,22 +1,0 @@
-<dt>{$block->get_title()}</dt>
-<dd>
-  <p>
-    {if $block->data.NB_COL == 0}
-      {'You have no collection'|@translate}
-    {else}
-      <a href="{$block->data.U_LIST}">{$pwg->l10n_dec('You have %d collection', 'You have %d collections', $block->data.NB_COL)}</a>
-    {/if}</p>
-  {if $block->data.collections}
-  <ul>{strip}
-		{foreach from=$block->data.collections item=col}
-		<li>
-      <a href="{$col.U_EDIT}" {*if $col.active}style="font-weight:bold;"{/if*} rel="nofollow">{$col.name}</a>&nbsp; 
-      {*if $col.active}<i class="menuInfoCat">({'active'|@translate})</i>&nbsp;{/if*} 
-      <span class="menuInfoCat">[<span class="nbImagesCollec-{$col.id}">{$col.nb_images}</span>]</span>
-    </li>
-		{/foreach}
-    {if $block->data.MORE}<li class="menuInfoCat"><a href="{$block->data.U_LIST}">{'%d more...'|@translate|sprintf:$block->data.MORE}</a></li>{/if}
-	{/strip}</ul>
-  {/if}
-  <p><a href="{$block->data.U_CREATE}" rel="nofollow">{'Create a new collection'|@translate}</a></p>
-</dd>
Index: tensions/UserCollections/template/style.css
===================================================================
--- /extensions/UserCollections/template/style.css	(revision 23550)
+++ 	(revision )
@@ -1,169 +1,0 @@
-#colProperties {}
-  #colProperties p {
-    text-align:left;
-    margin:2px 0;
-  }
-  #colProperties p.title {
-    font-weight:bold;
-  }
-  #colProperties p:not(.title) {
-    margin-bottom:10px;
-  }
-  
-#publicURL {
-  display:inline-block;
-  height:22px;
-}
-  #publicURL .url {
-    display:inline-block;
-    height:14px;
-    vertical-align:bottom;
-    padding:3px 10px;
-    background:#fff;
-    font-family:monospace;
-    font-size:12px;
-    color:#666;
-    border:1px solid #999;
-    border-radius:0 3px 3px 0;
-  }
-  #publicURL .button {
-    display:inline-block;
-    background:#e7e7e7 url('resources/link.png') center center no-repeat;
-    width:25px;
-    height:20px;
-    vertical-align:bottom;
-    border:1px solid #999;
-    border-right:none;
-    border-radius:3px 0 0 3px;
-    cursor:pointer;
-  }
-  #publicURL .confirm {
-    font-weight:bold;
-    margin-left:5px;
-  }
-
-/* .thumbnailCategory.activeCollection {
-  border:1px solid #999;
-} */
-.thumbnailCategory {
-  position:relative;
-}
-.thumbnailCategory .collectionActions {
-  display:none;
-  position:absolute;
-  right:5px;
-  bottom:5px;
-}
-.thumbnailCategory:hover .collectionActions {
-  display:block;
-}
-/* .thumbnailCategory .collectionActive {
-  font-weight:normal;
-  font-style:italic;
-} */
-
-/* SEND BY MAIL */
-#mail_form {
-  width:540px;
-  padding:10px;
-}
-  #mail_form table td {
-    padding-bottom:5px;
-    text-align:left;
-  }
-  #mail_form table td.title {
-    font-weight:bold;
-    text-align:right !important;
-    padding-top:3px;
-    vertical-align:top;
-    width:120px;
-  }
-  #mail_form input[type="text"], #mail_form textarea, #mail_form select {
-    border-radius:2px;
-    padding:3px;
-  }
-  
-/* TipTip CSS - Version 1.2 */
-#tiptip_holder {
-	display: none;
-	position: absolute;
-	top: 0;
-	left: 0;
-	z-index: 99999;
-}
-#tiptip_holder.tip_top {
-	padding-bottom: 5px;
-}
-#tiptip_holder.tip_bottom {
-	padding-top: 5px;
-}
-#tiptip_holder.tip_right {
-	padding-left: 5px;
-}
-#tiptip_holder.tip_left {
-	padding-right: 5px;
-}
-#tiptip_content {
-	font-size: 11px;
-	color: #fff;
-	text-shadow: 0 0 2px #000;
-	padding: 4px 8px;
-	border: 1px solid rgba(255,255,255,0.25);
-	background-color: rgb(25,25,25);
-	background-color: rgba(25,25,25,0.92);
-	background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));
-	border-radius: 3px;
-	-webkit-border-radius: 3px;
-	-moz-border-radius: 3px;
-	box-shadow: 0 0 3px #555;
-	-webkit-box-shadow: 0 0 3px #555;
-	-moz-box-shadow: 0 0 3px #555;
-}
-#tiptip_arrow, #tiptip_arrow_inner {
-	position: absolute;
-	border-color: transparent;
-	border-style: solid;
-	border-width: 6px;
-	height: 0;
-	width: 0;
-}
-#tiptip_holder.tip_top #tiptip_arrow {
-	border-top-color: #fff;
-	border-top-color: rgba(255,255,255,0.35);
-}
-#tiptip_holder.tip_bottom #tiptip_arrow {
-	border-bottom-color: #fff;
-	border-bottom-color: rgba(255,255,255,0.35);
-}
-#tiptip_holder.tip_right #tiptip_arrow {
-	border-right-color: #fff;
-	border-right-color: rgba(255,255,255,0.35);
-}
-#tiptip_holder.tip_left #tiptip_arrow {
-	border-left-color: #fff;
-	border-left-color: rgba(255,255,255,0.35);
-}
-#tiptip_holder.tip_top #tiptip_arrow_inner {
-	margin-top: -7px;
-	margin-left: -6px;
-	border-top-color: rgb(25,25,25);
-	border-top-color: rgba(25,25,25,0.92);
-}
-#tiptip_holder.tip_bottom #tiptip_arrow_inner {
-	margin-top: -5px;
-	margin-left: -6px;
-	border-bottom-color: rgb(25,25,25);
-	border-bottom-color: rgba(25,25,25,0.92);
-}
-#tiptip_holder.tip_right #tiptip_arrow_inner {
-	margin-top: -6px;
-	margin-left: -5px;
-	border-right-color: rgb(25,25,25);
-	border-right-color: rgba(25,25,25,0.92);
-}
-#tiptip_holder.tip_left #tiptip_arrow_inner {
-	margin-top: -6px;
-	margin-left: -7px;
-	border-left-color: rgb(25,25,25);
-	border-left-color: rgba(25,25,25,0.92);
-}
Index: /extensions/UserCollections/template/style_collections.css
===================================================================
--- /extensions/UserCollections/template/style_collections.css	(revision 23551)
+++ /extensions/UserCollections/template/style_collections.css	(revision 23551)
@@ -0,0 +1,77 @@
+#colProperties {}
+  #colProperties p {
+    text-align:left;
+    margin:2px 0;
+  }
+  #colProperties p.title {
+    font-weight:bold;
+  }
+  #colProperties p:not(.title) {
+    margin-bottom:10px;
+  }
+  
+#publicURL {
+  display:inline-block;
+  height:22px;
+}
+  #publicURL .url {
+    display:inline-block;
+    height:14px;
+    vertical-align:bottom;
+    padding:3px 10px;
+    background:#fff;
+    font-family:monospace;
+    font-size:12px;
+    color:#666;
+    border:1px solid #999;
+    border-radius:0 3px 3px 0;
+  }
+  #publicURL .button {
+    display:inline-block;
+    background:#e7e7e7 url('resources/link.png') center center no-repeat;
+    width:25px;
+    height:20px;
+    vertical-align:bottom;
+    border:1px solid #999;
+    border-right:none;
+    border-radius:3px 0 0 3px;
+    cursor:pointer;
+  }
+  #publicURL .confirm {
+    font-weight:bold;
+    margin-left:5px;
+  }
+
+.thumbnailCategory {
+  position:relative;
+}
+.thumbnailCategory .collectionActions {
+  display:none;
+  position:absolute;
+  right:5px;
+  bottom:5px;
+}
+.thumbnailCategory:hover .collectionActions {
+  display:block;
+}
+
+/* SEND BY MAIL */
+#mail_form {
+  width:540px;
+  padding:10px;
+}
+  #mail_form table td {
+    padding-bottom:5px;
+    text-align:left;
+  }
+  #mail_form table td.title {
+    font-weight:bold;
+    text-align:right !important;
+    padding-top:3px;
+    vertical-align:top;
+    width:120px;
+  }
+  #mail_form input[type="text"], #mail_form textarea, #mail_form select {
+    border-radius:2px;
+    padding:3px;
+  }
Index: /extensions/UserCollections/template/style_thumbnails.css
===================================================================
--- /extensions/UserCollections/template/style_thumbnails.css	(revision 23550)
+++ /extensions/UserCollections/template/style_thumbnails.css	(revision 23551)
@@ -27,4 +27,5 @@
   left:0;
   box-shadow:2px 2px 10px #000;
+  z-index:1000;
 }
 
Index: /extensions/UserCollections/template/themes/stripped.tpl
===================================================================
--- /extensions/UserCollections/template/themes/stripped.tpl	(revision 23550)
+++ /extensions/UserCollections/template/themes/stripped.tpl	(revision 23551)
@@ -8,5 +8,5 @@
     <ul class="categoryActions group1">
     {if isset($U_CADDIE) }
-      <li class="mainAction"><a href="{$U_CADDIE}" title="{'add to caddie'|@translate}">{'caddie'|@translate}</a></li>
+      <li class="mainAction"><a href="{$U_CADDIE}" title="{'Add to caddie'|@translate}">{'Caddie'|@translate}</a></li>
     {/if}
         
Index: /extensions/UserCollections/template/thumbnails_colorbox.tpl
===================================================================
--- /extensions/UserCollections/template/thumbnails_colorbox.tpl	(revision 23550)
+++ /extensions/UserCollections/template/thumbnails_colorbox.tpl	(revision 23551)
@@ -1,4 +1,4 @@
 {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
-{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
+{combine_css path='themes/default/js/plugins/colorbox/style2/colorbox.css'}
 
 {footer_script}
@@ -8,5 +8,5 @@
   title: function() {ldelim}
     var title = $(this).children("img.thumbnail").attr("alt");
-    {if $F_ACTION} title+= ' · <a href="{$collection_toggle_url}&amp;collection_toggle='+ $(this).data('id') +'" class="addCollection" data-id="'+ $(this).data('id') +'">{'Remove from collection'|@translate}</a>';{/if}
+    {if $F_ACTION} title+= ' · <a class="addCollection" data-id="'+ $(this).data('id') +'" rel="nofollow">{'Remove from collection'|@translate}</a>';{/if}
     title+= ' · <a href="'+ $(this).attr('href') +'" target="_blank">{'jump to photo'|@translate} →</a>';
     return  title;
Index: /extensions/UserCollections/template/thumbnails_css_js.tpl
===================================================================
--- /extensions/UserCollections/template/thumbnails_css_js.tpl	(revision 23550)
+++ /extensions/UserCollections/template/thumbnails_css_js.tpl	(revision 23551)
@@ -1,3 +1,3 @@
-{combine_css path=$USER_COLLEC_PATH|@cat:"template/style_thumbnails.css"}
+{combine_css path=$USER_COLLEC_PATH|cat:'template/style_thumbnails.css'}
 
 {* <!-- all pages but collection edit page --> *}
@@ -29,5 +29,5 @@
     jQuery(this).val("{'Name'|@translate}");
     
-    if (name == "") return;
+    if (name == "" || name == null) return;
     
     jQuery.ajax({ldelim}
@@ -39,5 +39,4 @@
         method: "pwg.collections.create",
         name: name,
-        active: 1,
       },
       success: function(data) {ldelim}
@@ -103,5 +102,5 @@
         if (method == "pwg.collections.addImages" && col_ids.indexOf(col_id) == -1)
           col_ids[ col_ids.length ] = col_id;
-        else
+        else if (method == "pwg.collections.removeImages")
           col_ids.splice(col_ids.indexOf(col_id), 1);
         $target.data("col", col_ids);
@@ -206,5 +205,4 @@
   });
   
-  // not working, the event is fired twice
   event.stopPropagation();
   event.preventDefault();
Index: tensions/UserCollections/template/view.tpl
===================================================================
--- /extensions/UserCollections/template/view.tpl	(revision 23550)
+++ 	(revision )
@@ -1,30 +1,0 @@
-{combine_css path=$USER_COLLEC_PATH|@cat:"template/style.css"}
-
-
-{* <!-- Menubar & titrePage --> *}
-{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/stripped.tpl'}
-  {assign var="clear" value="true"}
-{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/simple.tpl'}
-  {assign var="clear" value="true"}
-{else}
-  {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/default.tpl'}
-{/if}
-
-{if isset($errors) or not empty($infos)}
-{include file='infos_errors.tpl'}
-{/if}
-
-
-{if !empty($THUMBNAILS)}
-<ul class="thumbnails" id="thumbnails">
-{$THUMBNAILS}
-</ul>
-{/if}
-
-{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
-
-{if $clear}<div style="clear: both;"></div>
-</div>{/if}
-</div>{* <!-- content --> *}
