Index: extensions/Back2Front/Back2Front.php
===================================================================
--- extensions/Back2Front/Back2Front.php	(revision 12358)
+++ extensions/Back2Front/Back2Front.php	(revision 12361)
@@ -8,5 +8,5 @@
  */
 function Back2Front_picture_content($content, $image)
- {
+{
   global $template, $user, $conf;
 
@@ -33,5 +33,8 @@
     
     /* websize picture */
-    $template->assign('VERSO_URL', $verso['path']);
+    $template->assign(array(
+      'B2F_PATH' => B2F_PATH,
+      'VERSO_URL' => $verso['path'],
+      ));
     
     /* admin link */
@@ -79,7 +82,6 @@
 
     /* template & output */
-    $template->set_filenames(array('B2F_picture_content' => dirname(__FILE__).'/template/picture_content.tpl') );    
+    $template->set_filename('B2F_picture_content', dirname(__FILE__).'/template/picture_content.tpl');    
     $template->assign(array(
-      'B2F_PATH' => B2F_PATH,
       'b2f_switch_mode' => $conf['back2front'][1],
       'b2f_transition' => $conf['back2front'][2],
@@ -92,5 +94,5 @@
     {
       case 'toolbar':
-        $template->set_prefilter('picture', 'Back2Front_toolbar_prefilter');  
+        $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('B2F_picture_content', true));
         break;
       case 'top':
@@ -104,11 +106,4 @@
   
   return $content;
-}
-
-function Back2Front_toolbar_prefilter($content, &$smarty)
-{
-  $search = '{/if}{/strip}{*caddie management END*}';
-  $replacement = $search."\n".file_get_contents(B2F_PATH.'template/picture_content.tpl');
-  return str_replace($search, $replacement, $content);
 }
 
@@ -322,3 +317,39 @@
 }
 
+
+/*
+ * Add mark on thumbnails list
+ */
+function Back2Front_thumbnails($tpl_thumbnails_var, $pictures)
+{
+  global $conf;
+  
+  $conf['back2front'] = explode(',',$conf['back2front']);
+  if (!$conf['back2front'][5]) return $tpl_thumbnails_var;
+  
+  $ids = array();
+  foreach ($pictures as $row)
+  {
+    array_push($ids, $row['id']);
+  }
+    
+  /* has the pictures a verso ? */
+  $query = "SELECT image_id, verso_id
+    FROM ".B2F_TABLE."
+    WHERE image_id IN(".implode(',', $ids).");";
+  $result = hash_from_query($query, 'image_id');
+  
+  $ids = array_keys($result);
+  
+  foreach($tpl_thumbnails_var as &$tpl_var)
+  {
+    if (in_array($tpl_var['ID'], $ids))
+    {
+      $tpl_var['NAME'].= ' <img class="has_verso" src="'.B2F_PATH.'template/rotate_1.png" title="'.l10n('This picture has a backside :').'"/>';
+    }
+  }
+  
+  return $tpl_thumbnails_var;
+}
+
 ?>
Index: extensions/Back2Front/admin.php
===================================================================
--- extensions/Back2Front/admin.php	(revision 12358)
+++ extensions/Back2Front/admin.php	(revision 12361)
@@ -11,5 +11,5 @@
 if (isset($_POST['submit']))
 {
-	$conf['back2front'] = array(
+  $conf['back2front'] = array(
     $conf['back2front'][0], 
     $_POST['switch_mode'], 
@@ -17,8 +17,9 @@
     $_POST['position'],
     serialize(stripslashes_deep(str_replace(array("'",'"',','), null, $_POST['link_name']))),
+    isset($_POST['show_thumbnail']),
   );
-	
+  
   conf_update_param('back2front', implode (',', $conf['back2front']));
-	array_push($page['infos'], l10n('Information data registered in database'));
+  array_push($page['infos'], l10n('Information data registered in database'));
 }
 
@@ -33,5 +34,5 @@
 foreach (get_languages() as $language_code => $language_name)
 {
-	$template->append('link_name', array(
+  $template->append('link_name', array(
     'LANGUAGE_NAME' => $language_name,
     'LANGUAGE_CODE' => $language_code,
@@ -43,9 +44,10 @@
 $template->assign(array(
   'B2F_PATH' => B2F_PATH,
-	'SWITCH_MODE' => $conf['back2front'][1],
-	'TRANSITION' => $conf['back2front'][2],
+  'SWITCH_MODE' => $conf['back2front'][1],
+  'TRANSITION' => $conf['back2front'][2],
   'POSITION' => $conf['back2front'][3],
+  'SHOW_THUMBNAIL' => $conf['back2front'][5],
 ));
-	
+  
 $template->set_filename('back2front_conf', dirname(__FILE__).'/template/admin.tpl');
 $template->assign_var_from_handle('ADMIN_CONTENT', 'back2front_conf');
Index: extensions/Back2Front/language/en_UK/plugin.lang.php
===================================================================
--- extensions/Back2Front/language/en_UK/plugin.lang.php	(revision 12358)
+++ extensions/Back2Front/language/en_UK/plugin.lang.php	(revision 12361)
@@ -15,4 +15,5 @@
 $lang['Toolbar'] = 'Toolbar';
 $lang['Link name'] = 'Button name';
+$lang['Display a mark on thumbnails list'] = 'Display a mark on thumbnails list';
 
 $lang['Seperate the two labels with the | symbol. Leave blank to use default translation.'] = 'Seperate the two labels with the | symbol. Leave blank to use default translation.';
@@ -22,5 +23,5 @@
 $lang['Backside management'] = 'Backside management';
 $lang['Move backside to private album'] = 'Move backside to private album';
-$lang['This picture has a backside : '] = 'This picture has a backside : ';
+$lang['This picture has a backside :'] = 'This picture has a backside : ';
 
 $lang['Backside and frontside can\'t be the same picture'] = 'Backside and frontside can\'t be the same picture';
Index: extensions/Back2Front/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/Back2Front/language/fr_FR/plugin.lang.php	(revision 12358)
+++ extensions/Back2Front/language/fr_FR/plugin.lang.php	(revision 12361)
@@ -15,4 +15,5 @@
 $lang['Toolbar'] = 'Barre d\'outils';
 $lang['Link name'] = 'Nom du bouton';
+$lang['Display a mark on thumbnails list'] = 'Marquer les versos sur la liste des miniatures';
 
 $lang['Seperate the two labels with the | symbol. Leave blank to use default translation.'] = 'Séparez les deux textes par le symbole |. Laissez vide pour utiliser la traduction par défaut.';
@@ -22,5 +23,5 @@
 $lang['Backside management'] = 'Gestion des recto-verso';
 $lang['Move backside to private album'] = 'Déplacer le verso vers un album privé';
-$lang['This picture has a backside : '] = 'Cette image a un verso : ';
+$lang['This picture has a backside :'] = 'Cette image a un verso : ';
 
 $lang['Backside and frontside can\'t be the same picture'] = 'Verso et recto ne peuvent être la même image';
Index: extensions/Back2Front/language/it_IT/plugin.lang.php
===================================================================
--- extensions/Back2Front/language/it_IT/plugin.lang.php	(revision 12358)
+++ extensions/Back2Front/language/it_IT/plugin.lang.php	(revision 12361)
@@ -22,5 +22,5 @@
 $lang['Backside management'] = 'Gestione delle fronte-retro';
 $lang['Move backside to private album'] = 'Spostare il retro verso un\'album privato';
-$lang['This picture has a backside : '] = 'Questa foto a un retro : ';
+$lang['This picture has a backside :'] = 'Questa foto a un retro :';
 
 $lang['Backside and frontside can\'t be the same picture'] = 'Retro e fronte non possono essere la stessa foto';
Index: extensions/Back2Front/language/lv_LV/plugin.lang.php
===================================================================
--- extensions/Back2Front/language/lv_LV/plugin.lang.php	(revision 12358)
+++ extensions/Back2Front/language/lv_LV/plugin.lang.php	(revision 12361)
@@ -22,5 +22,5 @@
 $lang['Backside management'] = 'Aizmugures daļas pārvalde';
 $lang['Move backside to private album'] = 'Pārvietot attēla aizmugures daļu uz privātu albūmu';
-$lang['This picture has a backside : '] = 'Šim attēlam ir aizmugure : ';
+$lang['This picture has a backside :'] = 'Šim attēlam ir aizmugure :';
 
 $lang['Backside and frontside can\'t be the same picture'] = 'Aizmugure un priekšpuse nevar būt viens un tas pats attēls';
Index: extensions/Back2Front/main.inc.php
===================================================================
--- extensions/Back2Front/main.inc.php	(revision 12358)
+++ extensions/Back2Front/main.inc.php	(revision 12361)
@@ -24,16 +24,21 @@
 }
 
+if (script_basename() == 'index')
+{
+  add_event_handler('loc_end_index_thumbnails', 'Back2Front_thumbnails', 99, 2);
+}
+
 if (script_basename() == 'admin')
 {
   add_event_handler('loc_begin_admin_page', 'Back2Front_picture_modify');
   
-	add_event_handler('get_admin_plugin_menu_links', 'Back2Front_admin_menu');
-	function Back2Front_admin_menu($menu) 
-	{
-		array_push($menu, array(
-			'NAME' => 'Back2Front',
-			'URL' => get_root_url().'admin.php?page=plugin-' . B2F_DIR));
-		return $menu;
-	}
+  add_event_handler('get_admin_plugin_menu_links', 'Back2Front_admin_menu');
+  function Back2Front_admin_menu($menu) 
+  {
+    array_push($menu, array(
+      'NAME' => 'Back2Front',
+      'URL' => get_root_url().'admin.php?page=plugin-' . B2F_DIR));
+    return $menu;
+  }
 }
 
Index: extensions/Back2Front/maintain.inc.php
===================================================================
--- extensions/Back2Front/maintain.inc.php	(revision 12358)
+++ extensions/Back2Front/maintain.inc.php	(revision 12361)
@@ -4,9 +4,10 @@
 include_once(PHPWG_PLUGINS_PATH.'back2front/functions.inc.php');
 
-function plugin_install() {
-	global $prefixeTable;
+function plugin_install() 
+{
+  global $prefixeTable;
 
-  /* create table for recto/veros pairs | stores original verso categories */
-	pwg_query("CREATE TABLE IF NOT EXISTS `" . $prefixeTable . "image_verso` (
+  /* create table for recto/verso pairs | stores original verso categories */
+  pwg_query("CREATE TABLE IF NOT EXISTS `" . $prefixeTable . "image_verso` (
     `image_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
     `verso_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
@@ -14,5 +15,5 @@
     PRIMARY KEY (`image_id`),
     UNIQUE KEY (`verso_id`)
-	) DEFAULT CHARSET=utf8;");
+  ) DEFAULT CHARSET=utf8;");
   
   /* create a virtual category to store versos */
@@ -36,5 +37,5 @@
   /* config parameter */
   pwg_query("INSERT INTO `" . CONFIG_TABLE . "`
-    VALUES ('back2front', '".$versos_cat['id'].",click,none', 'Configuration for Back2Front plugin');");
+    VALUES ('back2front', '".$versos_cat['id'].",click,none,top,".serialize(array('default'=>null)).",1', 'Configuration for Back2Front plugin');");
 }
 
@@ -43,14 +44,24 @@
   global $conf;
 
-  if (!isset($conf['back2front'])) {
+  if (!isset($conf['back2front'])) 
+  {
     pwg_query("INSERT INTO `" . CONFIG_TABLE . "`
-      VALUES ('back2front', '".$versos_cat['id'].",click,none', 'Configuration for Back2Front plugin');");
-  } else {
+      VALUES ('back2front', '".$versos_cat['id'].",click,none,top,".serialize(array('default'=>null)).",1', 'Configuration for Back2Front plugin');");
+  } 
+  else 
+  {
     $conf['back2front'] = explode(',', $conf['back2front']);
-    if (!isset($conf['back2front'][3])) {
+    
+    if (!isset($conf['back2front'][3])) 
+    {
       $conf['back2front'][3] = 'top';
       $conf['back2front'][4] = serialize(array('default'=>null));
-      conf_update_param('back2front', implode (',', $conf['back2front'])); 
     }
+    if (!isset($conf['back2front'][5]))
+    {
+      $conf['back2front'][5] = true;
+    }
+    
+    conf_update_param('back2front', implode (',', $conf['back2front'])); 
   }
 }
@@ -58,5 +69,5 @@
 
 function plugin_uninstall() {
-	global $conf, $prefixeTable;
+  global $conf, $prefixeTable;
   
   $conf['back2front'] = explode(',',$conf['back2front']);
Index: extensions/Back2Front/template/admin.tpl
===================================================================
--- extensions/Back2Front/template/admin.tpl	(revision 12358)
+++ extensions/Back2Front/template/admin.tpl	(revision 12361)
@@ -23,11 +23,11 @@
 
 <div class="titrePage">
-	<h2>Back2Front</h2>
+  <h2>Back2Front</h2>
 </div>
 
 <form method="post" action="" class="properties" ENCTYPE="multipart/form-data"> 
-	<fieldset>
-		<legend>{'Display'|@translate}</legend>	  
-		<ul>			
+  <fieldset>
+    <legend>{'Display'|@translate}</legend>
+    <ul>
       <li>
         <span class="property">{'Link position'|@translate}</span>
@@ -36,14 +36,18 @@
         <label><input type="radio" name="position" value="toolbar" {if $POSITION == 'toolbar'}checked="checked"{/if}/> {'Toolbar'|@translate}</label>
       </li>
-			<li>
-				<span class="property">{'Switch mode'|@translate}</span>
-				<label><input type="radio" name="switch_mode" value="click" {if $SWITCH_MODE == 'click'}checked="checked"{/if}/> {'Click'|@translate}</label>
-				<label><input type="radio" name="switch_mode" value="hover" {if $SWITCH_MODE == 'hover'}checked="checked"{/if}/> {'Mouseover'|@translate}</label>
-			</li>
-			<li>
-				<span class="property">{'Transition'|@translate}</span>
-				<label><input type="radio" name="transition" value="none" {if $TRANSITION == 'none'}checked="checked"{/if}/> {'None'|@translate}</label>
-				<label><input type="radio" name="transition" value="fade" {if $TRANSITION == 'fade'}checked="checked"{/if}/> {'Fade'|@translate}</label>
-			</li>	
+      <li>
+        <span class="property">{'Switch mode'|@translate}</span>
+        <label><input type="radio" name="switch_mode" value="click" {if $SWITCH_MODE == 'click'}checked="checked"{/if}/> {'Click'|@translate}</label>
+        <label><input type="radio" name="switch_mode" value="hover" {if $SWITCH_MODE == 'hover'}checked="checked"{/if}/> {'Mouseover'|@translate}</label>
+      </li>
+      <li>
+        <span class="property">{'Transition'|@translate}</span>
+        <label><input type="radio" name="transition" value="none" {if $TRANSITION == 'none'}checked="checked"{/if}/> {'None'|@translate}</label>
+        <label><input type="radio" name="transition" value="fade" {if $TRANSITION == 'fade'}checked="checked"{/if}/> {'Fade'|@translate}</label>
+      </li>
+      <li>
+        <span class="property">{'Display a mark on thumbnails list'|@translate}</span>
+        <input type="checkbox" name="show_thumbnail" value="1" {if $SHOW_THUMBNAIL == '1'}checked="checked"{/if}/>
+      </li>
 
       <li>
@@ -60,7 +64,7 @@
         <a class="lang_help" title="{'Seperate the two labels with the | symbol. Leave blank to use default translation.'|@translate}">i</a>
       </li>      
-		</ul>
-	</fieldset>
-		
-	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
+    </ul>
+  </fieldset>
+  
+  <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
 </form>
Index: extensions/Back2Front/template/admin_button.tpl
===================================================================
--- extensions/Back2Front/template/admin_button.tpl	(revision 12358)
+++ extensions/Back2Front/template/admin_button.tpl	(revision 12361)
@@ -1,3 +1,3 @@
 {strip}<a href="{$VERSO_U_ADMIN}" title="{'Modify backside information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
-  <span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'edit'|@translate}</span>
+  <img src="{$B2F_PATH}template/rotate_edit.png"/><span class="pwg-button-text">{'edit'|@translate}</span>
 </a>{/strip}
Index: extensions/Back2Front/template/picture_content.tpl
===================================================================
--- extensions/Back2Front/template/picture_content.tpl	(revision 12358)
+++ extensions/Back2Front/template/picture_content.tpl	(revision 12361)
@@ -97,5 +97,5 @@
 
 {if $b2f_position != 'toolbar'}<div>{/if}
-<a class="reverse" rel="front" {if $b2f_position == 'toolbar'}style="border:none !important;"{/if} 
+<a class="reverse" rel="front" class="pwg-state-default pwg-button" title="{$b2f_see_back}" {if $b2f_position == 'toolbar'}style="border:none !important;"{/if} 
   {if $b2f_switch_mode == 'hover' and isset($VERSO_HD)}href="javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"{/if}>
   <img src="{$B2F_PATH}template/rotate_1.png"/> {$b2f_see_back}
Index: extensions/Back2Front/template/style.css
===================================================================
--- extensions/Back2Front/template/style.css	(revision 12358)
+++ extensions/Back2Front/template/style.css	(revision 12361)
@@ -2,5 +2,5 @@
   display:inline-block;
   border:1px solid #666 !important;
-  padding:3px 5px;
+  padding:5px 5px;
   margin-bottom:10px;
   font-size:15px;
