Index: /extensions/UserCollections/include/collections.inc.php
===================================================================
--- /extensions/UserCollections/include/collections.inc.php	(revision 16596)
+++ /extensions/UserCollections/include/collections.inc.php	(revision 16597)
@@ -8,6 +8,9 @@
 switch ($page['sub_section'])
 {
+  /* list */
   case 'list':
   {
+    if (is_a_guest()) access_denied();
+    
     $template->set_filename('index', dirname(__FILE__) . '/../template/list.tpl');
     
@@ -125,5 +128,4 @@
     {
       $col['date_creation'] = format_date($col['date_creation'], true);
-      $col['U_VIEW'] = USER_COLLEC_PUBLIC.'view/'.$col['id'];
       $col['U_EDIT'] = USER_COLLEC_PUBLIC.'edit/'.$col['id'];
       $col['U_ACTIVE'] = USER_COLLEC_PUBLIC.'&amp;action=set_active&amp;col_id='.$col['id'];
@@ -133,4 +135,5 @@
       {
         $col['name'] = 'temp #'.$col['id'];
+        $col['U_VIEW'] = $col['U_EDIT'];
         $col['U_SAVE'] = USER_COLLEC_PUBLIC.'&amp;action=save&amp;col_id='.$col['id'];
         $template->append('temp_col', $col);
@@ -138,4 +141,5 @@
       else
       {
+        $col['U_VIEW'] = USER_COLLEC_PUBLIC.'view/'.$col['id'];
         $template->append('collections', $col);
       }
@@ -145,5 +149,6 @@
     break;
   }
-    
+  
+  /* edit */
   case 'edit':
   {
@@ -165,4 +170,9 @@
     try {
       $UserCollection = new UserCollection($page['col_id']);
+      
+      if (!is_admin() and $UserCollection->getParam('user_id') != $user['id'])
+      {
+        access_denied();
+      }
       
       // save properties
@@ -199,4 +209,6 @@
       
       include(PHPWG_ROOT_PATH . 'include/category_default.inc.php');
+      
+      $template->concat('TITLE', $conf['level_separator'].$UserCollection->getParam('name'));
     }
     catch (Exception $e)
@@ -208,4 +220,5 @@
   }
   
+  /* view */
   case 'view':
   {
@@ -234,7 +247,4 @@
       
       $template->assign('collection', $UserCollection->getCollectionInfo());
-      
-      include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
-      $template->assign('OWNER', get_username($UserCollection->getParam('user_id')));
       
       $page['start'] = isset($_GET['start']) ? $_GET['start'] : 0;
@@ -254,18 +264,18 @@
       
       include(PHPWG_ROOT_PATH . 'include/category_default.inc.php');
+      
+      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'))).')'
+        );
     }
     catch (Exception $e)
     {
-      array_push($page['errors'], $e->getMessage());
+      access_denied();
     }
     
     break;
   }
-    
-  // case 'send':
-  // {
-    
-    // break;
-  // }
 }
 
Index: /extensions/UserCollections/include/events.inc.php
===================================================================
--- /extensions/UserCollections/include/events.inc.php	(revision 16596)
+++ /extensions/UserCollections/include/events.inc.php	(revision 16597)
@@ -7,7 +7,4 @@
 function user_collections_init()
 {
-  global $conf;
-  
-  // $conf['user_collections'] = unserialize($conf['user_collections']);
   load_language('plugin.lang', USER_COLLEC_PATH);
 }
@@ -24,20 +21,11 @@
     $page['title'] = '<a href="'.USER_COLLEC_PUBLIC.'">'.l10n('Collections').'</a>';
     
-    switch (@$tokens[1])
-    {
-      case 'edit':
-        $page['sub_section'] = 'edit';
-        $page['title'].= $conf['level_separator'].' '.l10n('Edit');
-        break;
-      case 'view':
-        $page['sub_section'] = 'view';
-        $page['title'].= $conf['level_separator'].' '.l10n('View');
-        break;
-      // case 'send':
-        // $page['sub_section'] = 'send';
-        // $page['title'].= $conf['level_separator'].' '.l10n('Send');
-        // break;
-      default:
-        $page['sub_section'] = 'list';
+    if (in_array(@$tokens[1], array('edit','view','list')))
+    {
+       $page['sub_section'] = $tokens[1];
+    }
+    else
+    {
+      $page['sub_section'] = 'list';
     }
     
@@ -64,4 +52,6 @@
 function user_collections_index_actions()
 {
+  if (is_a_guest()) return;
+  
   global $page, $UserCollection;
      
@@ -80,4 +70,6 @@
 function user_collections_thumbnails_list($tpl_thumbnails_var, $pictures)
 {
+  if (is_a_guest()) return $tpl_thumbnails_var;
+  
   global $page, $template, $UserCollection;
   
@@ -99,5 +91,4 @@
     $collection = array();
   }
-  
   
   
@@ -142,4 +133,6 @@
 function user_collections_picture_page()
 {
+  if (is_a_guest()) return;
+  
   global $template, $picture, $UserCollection;
   
@@ -186,10 +179,22 @@
 function user_collections_add_menublock($menu_ref_arr)
 {
+  if (is_a_guest()) return;
+  
+  global $user;
+  
   $menu = &$menu_ref_arr[0];
   if ($menu->get_id() != 'menubar') return;
   
-  if (get_current_collection_id(false) === false) return;
-  
-  $menu->register_block(new RegisteredBlock('mbUserCollection', l10n('Download Basket'), 'UserCollection'));
+  $query = '
+SELECT id
+  FROM '.COLLECTIONS_TABLE.'
+  WHERE user_id = '.$user['id'].'
+  LIMIT 1
+;';
+  $result = pwg_query($query);
+  
+  if (!pwg_db_num_rows($result)) return;
+  
+  $menu->register_block(new RegisteredBlock('mbUserCollection', l10n('Collections'), 'UserCollection'));
 }
 
@@ -201,31 +206,35 @@
   if (($block = $menu->get_block('mbUserCollection')) != null)
   {
-    if (empty($UserCollection))
-    {
-      $UserCollection = new UserCollection(get_current_collection_id());
-    }
-    
-    $data = array(
-      'U_LIST' => USER_COLLEC_PUBLIC,
-      'current' => array(
-        'NAME' => $UserCollection->getParam('name'),
-        'NB_IMAGES' => $UserCollection->getParam('nb_images'),
-        ),
-      'links' => array(),
-      );
-      
-    if ($data['current']['NB_IMAGES'] > 0)
-    {
-      $data['links'] = array(
-        array(
-          'URL' => USER_COLLEC_PUBLIC.'view/'.$UserCollection->getParam('col_id'),
-          'NAME' => l10n('View'),
+    if (($col_id = get_current_collection_id(false)) !== false)
+    {
+      if (empty($UserCollection))
+      {
+        $UserCollection = new UserCollection($col_id);
+      }
+    
+      $data = array(
+        'current' => array(
+          'NAME' => $UserCollection->getParam('name'),
+          'NB_IMAGES' => $UserCollection->getParam('nb_images'),
           ),
-        array(
-          'URL' => USER_COLLEC_PUBLIC.'&amp;action=clear&amp;col_id='.$UserCollection->getParam('col_id'),
-          'NAME' => l10n('Clear'),
-          ),
+        'links' => array(),
         );
-    }
+        
+      if ($data['current']['NB_IMAGES'] > 0)
+      {
+        $data['links'] = array(
+          array(
+            'URL' => USER_COLLEC_PUBLIC.'edit/'.$UserCollection->getParam('col_id'),
+            'NAME' => l10n('Display collection'),
+            ),
+          array(
+            'URL' => USER_COLLEC_PUBLIC.'&amp;action=clear&amp;col_id='.$UserCollection->getParam('col_id'),
+            'NAME' => l10n('Clear collection'),
+            ),
+          );
+      }
+    }
+    
+    $data['U_LIST'] = USER_COLLEC_PUBLIC;
       
     $template->set_template_dir(USER_COLLEC_PATH . 'template/');
Index: /extensions/UserCollections/language/en_UK/description.txt
===================================================================
--- /extensions/UserCollections/language/en_UK/description.txt	(revision 16596)
+++ /extensions/UserCollections/language/en_UK/description.txt	(revision 16597)
@@ -0,0 +1,1 @@
+Registered users can select pictures from the gallery and save them into collections, like advanced favorites.
Index: /extensions/UserCollections/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/UserCollections/language/en_UK/plugin.lang.php	(revision 16596)
+++ /extensions/UserCollections/language/en_UK/plugin.lang.php	(revision 16597)
@@ -1,5 +1,25 @@
 <?php
 
-
+$lang['Copied'] = 'Copied';
+$lang['Public collection'] = 'Public';
+$lang['Copy to clipboard'] = 'Copy to clipboard';
+$lang['Return to collections list'] = 'Return to collections list';
+$lang['This collection is empty'] = 'This collection is empty';
+$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['Current collection:'] = 'Current collection:';
+$lang['See all my collections'] = 'See all my collections';
+$lang['Please give a name'] = 'Please give a name';
+$lang['Invalid collection'] = 'Invalid collection';
+$lang['by %s'] = 'by %s';
+$lang['Collections'] = 'Collections';
+$lang['Remove from collection'] = 'Remove from collection';
+$lang['Add to collection'] = 'Add to collection';
+$lang['Display collection'] = 'Display';
+$lang['Clear collection'] = 'Clear';
 
 ?>
Index: /extensions/UserCollections/language/fr_FR/description.txt
===================================================================
--- /extensions/UserCollections/language/fr_FR/description.txt	(revision 16596)
+++ /extensions/UserCollections/language/fr_FR/description.txt	(revision 16597)
@@ -0,0 +1,1 @@
+Les utilisateurs inscrits peuvent sélectionner des photos et es sauvegarder dans des collections, comme des favoris avancés.
Index: /extensions/UserCollections/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/UserCollections/language/fr_FR/plugin.lang.php	(revision 16596)
+++ /extensions/UserCollections/language/fr_FR/plugin.lang.php	(revision 16597)
@@ -1,5 +1,25 @@
 <?php
 
-
+$lang['Copied'] = 'Copié';
+$lang['Public collection'] = 'Publique';
+$lang['Copy to clipboard'] = 'Copier dans le press-papier';
+$lang['Return to collections list'] = 'Retourner à la liste des collections';
+$lang['This collection is empty'] = 'Cette collection est vide';
+$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['Current collection:'] = 'Collection actuelle:';
+$lang['See all my collections'] = 'Voir toutes mes collections';
+$lang['Please give a name'] = 'Veuillez donner un nom';
+$lang['Invalid collection'] = 'Collection invalide';
+$lang['by %s'] = 'par %s';
+$lang['Collections'] = 'Collections';
+$lang['Remove from collection'] = 'Supprimer de la collection';
+$lang['Add to collection'] = 'Ajouter à la collection';
+$lang['Display collection'] = 'Afficher';
+$lang['Clear collection'] = 'Vider';
 
 ?>
Index: /extensions/UserCollections/main.inc.php
===================================================================
--- /extensions/UserCollections/main.inc.php	(revision 16596)
+++ /extensions/UserCollections/main.inc.php	(revision 16597)
@@ -3,6 +3,6 @@
 Plugin Name: User Collections
 Version: auto
-Description: Registered users can select pictures from the gallery and save them into collections, kind of advanced favorites.
-Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
+Description: Registered users can select pictures from the gallery and save them into collections, like advanced favorites.
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=615
 Author: Mistic
 Author URI: http://www.strangeplanet.fr
@@ -13,9 +13,9 @@
 global $conf, $prefixeTable;
 
-define('USER_COLLEC_PATH',      PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
-define('COLLECTIONS_TABLE',     $prefixeTable.'collections');
+define('USER_COLLEC_PATH',       PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
+define('COLLECTIONS_TABLE',      $prefixeTable.'collections');
 define('COLLECTION_IMAGES_TABLE',$prefixeTable.'collection_images');
-define('USER_COLLEC_ADMIN',     get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
-define('USER_COLLEC_PUBLIC',    make_index_url(array('section' => 'collections')) . '/');
+define('USER_COLLEC_ADMIN',      get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
+define('USER_COLLEC_PUBLIC',     make_index_url(array('section' => 'collections')) . '/');
 
 
Index: /extensions/UserCollections/template/edit.tpl
===================================================================
--- /extensions/UserCollections/template/edit.tpl	(revision 16596)
+++ /extensions/UserCollections/template/edit.tpl	(revision 16597)
@@ -29,5 +29,5 @@
 
 <div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
-<div class="titrePage{if isset($chronology.TITLE)} calendarTitleBar{/if}">
+<div class="titrePage">
   <ul class="categoryActions">
   {if !empty($COLLECTION_ACTIONS)}{$COLLECTION_ACTIONS}{/if}
@@ -47,9 +47,9 @@
   <p class="title"><label for="name">{'Name'|@translate}</label></p>
   <p><input type="text" name="name" id="name" value="{$collection.NAME}" size="60"></p>
-  <p class="title">{'Public'|@translate}</p>
+  <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 clipborad'|@translate}">&nbsp;</span><span class="url">{$collection.U_PUBLIC}</span></span>
+    <span id="publicURL" {if not $collection.PUBLIC}style="display:none;"{/if}><span class="button" title="{'Copy to clipboard'|@translate}">&nbsp;</span><span class="url">{$collection.U_PUBLIC}</span></span>
   </p>
   <p>
Index: /extensions/UserCollections/template/list.tpl
===================================================================
--- /extensions/UserCollections/template/list.tpl	(revision 16596)
+++ /extensions/UserCollections/template/list.tpl	(revision 16597)
@@ -4,6 +4,10 @@
 jQuery(".save_col").click(function() {ldelim}
   var name = prompt("{'Collection name:'|@translate}");
-  $(this).attr("href",  $(this).attr("href") +"&name="+ name);
-  return true;
+  if (name != null) {ldelim}
+    $(this).attr("href",  $(this).attr("href") +"&name="+ name);
+    return true;
+  } else {ldelim}
+    return false;
+  }
 });
 {/footer_script}
Index: /extensions/UserCollections/template/menublock.tpl
===================================================================
--- /extensions/UserCollections/template/menublock.tpl	(revision 16596)
+++ /extensions/UserCollections/template/menublock.tpl	(revision 16597)
@@ -1,4 +1,5 @@
 <dt>{$block->get_title()}</dt>
 <dd>
+{if $block->data.current}
   {'Current collection:'|@translate} <b>{$block->data.current.NAME}</b>, {'%d images'|@translate|@sprintf:$block->data.current.NB_IMAGES}
 	<ul>{strip}
@@ -7,4 +8,5 @@
 		{/foreach}
 	{/strip}</ul>
+{/if}
   <a href="{$block->data.U_LIST}" rel="nofollow">{'See all my collections'|@translate}</a>
 </dd>
Index: /extensions/UserCollections/template/view.tpl
===================================================================
--- /extensions/UserCollections/template/view.tpl	(revision 16596)
+++ /extensions/UserCollections/template/view.tpl	(revision 16597)
@@ -4,5 +4,5 @@
 
 <div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
-<div class="titrePage{if isset($chronology.TITLE)} calendarTitleBar{/if}">
+<div class="titrePage">
   <ul class="categoryActions">
   {if !empty($COLLECTION_ACTIONS)}{$COLLECTION_ACTIONS}{/if}
@@ -14,19 +14,4 @@
 {include file='infos_errors.tpl'}
 {/if}
-
-{if $collection}
-<fieldset id="colProperties">
-  <legend>{'Properties'|@translate}</legend>
-  
-  <p class="title">{'Name'|@translate}</p>
-  <p>{$collection.NAME}</p>
-  <p class="title">{'Owner'|@translate}</p>
-  <p>{$OWNER}</p>
-  <p class="title">{'Creation date'|@translate}</p>
-  <p>{$collection.DATE_CREATION}</p>
-</fieldset>
-</form>
-{/if}
-
 
 {if !empty($THUMBNAILS)}
