Index: tensions/Back2Front/Back2Front.php
===================================================================
--- /extensions/Back2Front/Back2Front.php	(revision 23176)
+++ 	(revision )
@@ -1,353 +1,0 @@
-<?php 
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-include_once(B2F_PATH.'functions.inc.php');
-
-/*
- * Add verso link on picture page
- */
-function Back2Front_picture_content($content, $element_info)
-{
-  global $template, $user, $conf;
-
-  /* search for a verso picture */
-  $query = "
-    SELECT i.*
-    FROM ".IMAGES_TABLE." as i
-      INNER JOIN ".B2F_TABLE." as v
-      ON i.id = v.verso_id
-      AND v.image_id = ".$element_info['id']."
-  ;";
-  $result = pwg_query($query);
-
-  if (pwg_db_num_rows($result)) 
-  {
-    $verso = pwg_db_fetch_assoc($result);
-    $conf['back2front'] = explode(',',$conf['back2front']);
-    $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
-    
-    $verso['src_image'] = new SrcImage($verso);
-    $verso['derivatives'] = DerivativeImage::get_all($verso['src_image']);
-    $verso['element_path'] = get_element_path($verso);
-    $verso['selected_derivative'] = $verso['derivatives'][$deriv_type];
-    
-    /* websize picture */
-    $template->assign(array(
-      'B2F_PATH' => B2F_PATH,
-      'verso' => $verso,
-      ));
-    
-    /* admin link */
-    if (is_admin())
-    {
-      $template->assign('VERSO_U_ADMIN', get_root_url().'admin.php?page=photo-'.$verso['id']);
-      $template->set_filename('B2F_admin_button', dirname(__FILE__).'/template/admin_button.tpl');
-      $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('B2F_admin_button', true));
-    }
-    
-    /* link name */
-    $conf['back2front'][4] = unserialize($conf['back2front'][4]);
-    if (!empty($conf['back2front'][4][$user['language']]))
-    {
-      if (strpos($conf['back2front'][4][$user['language']], '|') !== false)
-      {
-        $conf['back2front'][4] = explode('|', $conf['back2front'][4][$user['language']]);
-      }
-      else
-      {
-        $conf['back2front'][4] = array($conf['back2front'][4][$user['language']], $conf['back2front'][4][$user['language']]);
-      }
-    }
-    else if (!empty($conf['back2front'][4]['default']))
-    {
-      if (strpos($conf['back2front'][4]['default'], '|') != false)
-      {
-        $conf['back2front'][4] = explode('|', $conf['back2front'][4]['default']);
-      }
-      else
-      {
-        $conf['back2front'][4] = array($conf['back2front'][4]['default'], $conf['back2front'][4]['default']);
-      }
-    }
-    else
-    {
-      $conf['back2front'][4] = array(l10n('See back'), l10n('See front'));
-    }
-    
-    if ($conf['back2front'][2] == 'fade' and $conf['back2front'][3] ==  'bottom')
-    {
-      $conf['back2front'][3] = 'top';
-    }
-    
-
-    /* template & output */
-    $template->set_filename('B2F_picture_content', dirname(__FILE__).'/template/picture_content.tpl');    
-    $template->assign(array(
-      'b2f_switch_mode' => $conf['back2front'][1],
-      'b2f_transition' => $conf['back2front'][2],
-      'b2f_position' => $conf['back2front'][3],
-      'b2f_see_back' => $conf['back2front'][4][0],
-      'b2f_see_front' => $conf['back2front'][4][1],
-    ));
-    
-    switch ($conf['back2front'][3])
-    {
-      case 'toolbar':
-        $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('B2F_picture_content', true));
-        break;
-      case 'top':
-        return $template->parse('B2F_picture_content', true)."\n".$content;
-        break;
-      case 'bottom':
-        return $content."\n".$template->parse('B2F_picture_content', true);
-        break;
-    }    
-  }
-  
-  return $content;
-}
-
-
-/*
- * Add field on picture modify page
- */
-function Back2Front_picture_modify()
-{
-  global $page, $template, $conf;
-  
-  if ($page['page'] != 'photo') return;
-  if (isset($_GET['tab']) && $_GET['tab']!='properties') return;
-  
-  
-  $conf['back2front'] = explode(',',$conf['back2front']);
-  
-/* SAVE VALUES */
-  if (isset($_POST['b2f_submit']))
-  {
-    /* catch all verso and recto ids and original categories */
-    $query = "SELECT image_id, verso_id, categories
-      FROM ".B2F_TABLE.";";
-    $rectos = array_from_query($query, 'image_id');
-    $versos = array_from_query($query, 'verso_id');
-    $cats = array_from_query($query, 'categories');
-    
-    if (count($rectos) != 0)
-    {
-      $all_recto_verso = array_combine($rectos, $versos);
-      $verso_cats = array_combine($versos, $cats);
-    }
-    else
-    {
-      $all_recto_verso = array(0=>0);
-      $verso_cats = array(0=>NULL);
-    }
-    unset($rectos, $versos, $cats);
-    
-    /* picture is verso */
-    if (isset($_POST['b2f_is_verso']))
-    {      
-      /* verso don't exists */
-      if (!picture_exists($_POST['b2f_front_id']))
-      {
-        array_push(
-          $page['errors'], 
-          sprintf(
-            l10n('Unknown id %d for frontside picture'), 
-            $_POST['b2f_front_id']
-            )
-          );
-      }
-      /* verso same as recto  */
-      else if ($_POST['b2f_front_id'] == $_GET['image_id'])
-      {
-        array_push($page['errors'], l10n('Backside and frontside can\'t be the same picture'));
-      }
-      /* recto has already a verso */
-      else if (in_array($_POST['b2f_front_id'], array_keys($all_recto_verso)) AND $all_recto_verso[$_POST['b2f_front_id']] != $_GET['image_id'])
-      {
-          $recto_current_verso['id'] = $all_recto_verso[$_POST['b2f_front_id']];
-          $recto_current_verso['link'] = get_root_url().'admin.php?page=photo-'.$recto_current_verso['id'];
-          array_push(
-            $page['errors'], 
-            sprintf(
-              l10n('The picture n°%d has already a backside : %s'), 
-              $_POST['b2f_front_id'], 
-              '<a href="'.$recto_current_verso['link'].'">'.$recto_current_verso['id'].'</a>'
-              )
-            );
-      }
-      /* recto is already a verso */
-      else if (in_array($_POST['b2f_front_id'], array_values($all_recto_verso)))
-      {
-          $recto_is_verso['id'] = $_POST['b2f_front_id'];
-          $recto_is_verso['link'] = get_root_url().'admin.php?page=picture_modify&amp;image_id='.$recto_is_verso['id'];
-          array_push(
-            $page['errors'], 
-            sprintf(
-              l10n('The picture n°%s is already a backside'), 
-              '<a href="'.$recto_is_verso['link'].'">'.$recto_is_verso['id'].'</a>'
-              )
-            );
-      }
-      /* everything is fine */
-      else
-      {
-        // move the verso - if first save
-        if (isset($_POST['b2f_move_verso']) AND (!array_key_exists($_GET['image_id'], $verso_cats) OR $verso_cats[$_GET['image_id']] == NULL))
-        {
-          // get current categories
-          $query = "SELECT category_id FROM ".IMAGE_CATEGORY_TABLE." WHERE image_id = ".$_GET['image_id'].";";
-          $verso_categories = array_from_query($query, 'category_id');
-          
-          pwg_query("DELETE FROM ".IMAGE_CATEGORY_TABLE."
-            WHERE image_id = ".$_GET['image_id'].";");
-          pwg_query("INSERT INTO ".IMAGE_CATEGORY_TABLE."(image_id, category_id)
-            VALUES(".$_GET['image_id'].", ".$conf['back2front'][0].");");
-            
-          // random representant for each categories
-          set_random_representant($verso_categories);
-          
-          $verso_categories = isset($verso_cats[$_GET['image_id']]) ? $verso_cats[$_GET['image_id']] : implode(',',$verso_categories);
-          $template->assign('B2F_MOVE_VERSO', 'checked="checked"');
-        }
-        // restore the verso - if precedently moved
-        else if (!isset($_POST['b2f_move_verso']) AND array_key_exists($_GET['image_id'], $verso_cats) AND $verso_cats[$_GET['image_id']] != NULL)
-        {
-          $item['verso_id'] = $_GET['image_id'];
-          $item['categories'] = $verso_cats[$_GET['image_id']];
-          back2front_restaure_categories($item);
-          
-          $verso_categories = 'NULL';
-          $template->assign('B2F_MOVE_VERSO', '');
-        }
-        // leave the verso
-        else
-        {
-          $verso_categories = isset($verso_cats[$_GET['image_id']]) ? $verso_cats[$_GET['image_id']] : 'NULL';
-          $template->assign('B2F_MOVE_VERSO', isset($verso_cats[$_GET['image_id']]) ? 'checked="checked"' : '');
-        }
-        
-        // insert or update verso associations
-        pwg_query("INSERT INTO ".B2F_TABLE."
-          VALUES(".$_POST['b2f_front_id'].", ".$_GET['image_id'].", '".$verso_categories."')
-          ON DUPLICATE KEY UPDATE image_id = ".$_POST['b2f_front_id'].", categories = '".$verso_categories."';");
-      
-        $template->assign(array(
-          'B2F_IS_VERSO' => 'checked="checked"',
-          'B2F_FRONT_ID' => $_POST['b2f_front_id'],
-        ));
-        
-        $verso['id'] = $_POST['b2f_front_id'];
-        $verso['link'] = get_root_url().'admin.php?page=photo-'.$verso['id'];
-        array_push($page['infos'], l10n_args(get_l10n_args('This picture is now the backside of the picture n°%s', '<a href="'.$verso['link'].'">'.$verso['id'].'</a>')));
-      }
-    }
-    /* picture isn't verso */
-    else
-    {
-      /* search if it was a verso */
-      $query = "SELECT categories
-        FROM ".B2F_TABLE."
-        WHERE verso_id = ".$_GET['image_id'].";";
-      $result = pwg_query($query);
-      
-      /* it must be restored to its original categories (see criteria on maintain.inc) */
-      if (pwg_db_num_rows($result))
-      {
-        $item['verso_id'] = $_GET['image_id'];
-        list($item['categories']) = pwg_db_fetch_row($result);
-        back2front_restaure_categories($item);
-        
-        pwg_query("DELETE FROM ".B2F_TABLE." 
-          WHERE verso_id = ".$_GET['image_id'].";");
-          
-        array_push($page['infos'], l10n('This picture is no longer a backside'));
-      }
-    }
-  }
-  
-/* GET SAVED VALUES */
-  if ($template->get_template_vars('B2F_IS_VERSO') == null)
-  {
-    $template->assign('B2F_MOVE_VERSO', 'checked="checked"');
-    
-    /* is the picture a verso ? */
-    $query = "
-      SELECT image_id, categories
-      FROM ".B2F_TABLE."
-      WHERE verso_id = ".$_GET['image_id']."
-    ;";
-    $result = pwg_query($query);
-    
-    if (pwg_db_num_rows($result))
-    {
-      list($recto_id, $cats) = pwg_db_fetch_row($result);
-      $template->assign(array(
-        'B2F_IS_VERSO' => 'checked="checked"',
-        'B2F_FRONT_ID' => $recto_id,
-        'B2F_MOVE_VERSO' => $cats != NULL ? 'checked="checked"' : '',
-      ));
-    }
-    /* is the picture a front ? */
-    else
-    {
-      $query = "SELECT verso_id
-        FROM ".B2F_TABLE."
-        WHERE image_id = ".$_GET['image_id'].";";
-      $result = pwg_query($query);
-      
-      if (pwg_db_num_rows($result))
-      {      
-        $item = pwg_db_fetch_assoc($result);
-
-        $template->assign(array(
-          'B2F_VERSO_ID' => $item['verso_id'],
-          'B2F_VERSO_URL' => get_root_url().'admin.php?page=photo-'.$item['verso_id'],
-        ));
-      }
-    }
-  }
-  
-  $template->set_prefilter('picture_modify', 'Back2front_picture_modify_prefilter');
-}
-
-
-function Back2front_picture_modify_prefilter($content, &$smarty)
-{
-  $search = '</form>';
-  $replacement = $search."\n\n".file_get_contents(B2F_PATH.'template/picture_modify.tpl');
-  return str_replace($search, $replacement, $content);
-}
-
-
-/*
- * Add mark on thumbnails list
- */
-function Back2Front_thumbnails($tpl_thumbnails_var)
-{
-  global $conf, $selection;
-  
-  $conf['back2front'] = explode(',',$conf['back2front']);
-  if (!$conf['back2front'][5]) return $tpl_thumbnails_var;
-  if (empty($tpl_thumbnails_var)) return $tpl_thumbnails_var;
-    
-  /* has the pictures a verso ? */
-  $query = "SELECT image_id
-    FROM ".B2F_TABLE."
-    WHERE image_id IN(".implode(',', $selection).");";
-  $ids = array_from_query($query, 'image_id');
-  
-  $root_path = get_absolute_root_url();
-  
-  foreach($tpl_thumbnails_var as &$tpl_var)
-  {
-    if (in_array($tpl_var['id'], $ids))
-    {
-      $tpl_var['NAME'].= ' <img class="has_verso" src="'.$root_path.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 23176)
+++ /extensions/Back2Front/admin.php	(revision 23177)
@@ -3,8 +3,6 @@
 
 global $conf, $template;
-load_language('plugin.lang', B2F_PATH);
-$conf['back2front'] = explode(',', $conf['back2front']);
 
-include_once(B2F_PATH.'functions.inc.php');
+include_once(B2F_PATH . 'include/functions.inc.php');
 
 // Enregistrement de la configuration
@@ -12,24 +10,23 @@
 {
   $conf['back2front'] = array(
-    $conf['back2front'][0], 
-    $_POST['switch_mode'], 
-    $_POST['transition'],
-    $_POST['position'],
-    serialize(stripslashes_deep(str_replace(array("'",'"',','), null, $_POST['link_name']))),
-    isset($_POST['show_thumbnail']),
-  );
+    'versos_cat' => $conf['back2front']['versos_cat'],
+    'switch_mode' => $_POST['switch_mode'],
+    'transition' => $_POST['transition'],
+    'position' => $_POST['position'],
+    'link_name' => stripslashes_deep($_POST['link_name']),
+    'show_thumbnail' => isset($_POST['show_thumbnail']),
+    );
   
-  conf_update_param('back2front', implode (',', $conf['back2front']));
+  conf_update_param('back2front', serialize($conf['back2front']));
   array_push($page['infos'], l10n('Information data registered in database'));
 }
 
 // Gestion des langues pour le bloc menu
-$conf['back2front'][4] = unserialize($conf['back2front'][4]);
 $template->append('link_name', array(
   'LANGUAGE_NAME' => l10n('Default'),
   'LANGUAGE_CODE' => 'default',
-  'VALUE' => @$conf['back2front'][4]['default'],
-  )
-);
+  'VALUE' => @$conf['back2front']['link_name']['default'],
+  ));
+  
 foreach (get_languages() as $language_code => $language_name)
 {
@@ -37,18 +34,17 @@
     'LANGUAGE_NAME' => $language_name,
     'LANGUAGE_CODE' => $language_code,
-    'VALUE' => isset($conf['back2front'][4][$language_code]) ? $conf['back2front'][4][$language_code] : '',
-    )
-  );
+    'VALUE' => @$conf['back2front']['link_name'][$language_code],
+    ));
 }
 
 $template->assign(array(
   'B2F_PATH' => B2F_PATH,
-  'SWITCH_MODE' => $conf['back2front'][1],
-  'TRANSITION' => $conf['back2front'][2],
-  'POSITION' => $conf['back2front'][3],
-  'SHOW_THUMBNAIL' => $conf['back2front'][5],
-));
+  'SWITCH_MODE' => $conf['back2front']['switch_mode'],
+  'TRANSITION' => $conf['back2front']['transition'],
+  'POSITION' => $conf['back2front']['position'],
+  'SHOW_THUMBNAIL' => $conf['back2front']['show_thumbnail'],
+  ));
   
-$template->set_filename('back2front_conf', dirname(__FILE__).'/template/admin.tpl');
+$template->set_filename('back2front_conf', realpath(B2F_PATH.'template/admin.tpl'));
 $template->assign_var_from_handle('ADMIN_CONTENT', 'back2front_conf');
 
Index: tensions/Back2Front/functions.inc.php
===================================================================
--- /extensions/Back2Front/functions.inc.php	(revision 23176)
+++ 	(revision )
@@ -1,61 +1,0 @@
-<?php
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-/* $item = array('verso_id', 'categories'); */
-function back2front_restaure_categories($item)
-{
-  global $conf;
-        
-  /* catch current verso categories */
-  $versos_infos = pwg_query("SELECT category_id FROM ".IMAGE_CATEGORY_TABLE." WHERE image_id = ".$item['verso_id'].";");
-  $item['current_verso_cats'] = array();
-  while (list($verso_cat) = pwg_db_fetch_row($versos_infos))
-  {
-    $item['current_verso_cats'][] = $verso_cat;
-  }
-
-  /* if verso  'versos' cat only */
-  if (count($item['current_verso_cats']) == 1 AND $item['current_verso_cats'][0] == $conf['back2front'][0])
-  {
-    foreach (explode(',',$item['categories']) as $cat)
-    {
-      $datas[] = array(
-        'image_id' => $item['verso_id'],
-        'category_id' => $cat,
-        );
-    }
-  }
-
-  if (isset($datas))
-  {
-    mass_inserts(
-      IMAGE_CATEGORY_TABLE,
-      array('image_id', 'category_id'),
-      $datas
-      );
-  }
-  
-  pwg_query("DELETE FROM ".IMAGE_CATEGORY_TABLE."
-    WHERE image_id = ".$item['verso_id']." AND category_id = ".$conf['back2front'][0].";");
-}
-
-function picture_exists($id)
-{
-  if (!preg_match('#([0-9]{1,})#', $id) OR $id == '0') return false;
-  
-  $query = "SELECT id FROM ".IMAGES_TABLE." WHERE id = ".$id.";";
-  $result = pwg_query($query);
-  
-  if (pwg_db_num_rows($result)) return true;
-  else return false;
-}
-
-if (!function_exists('stripslashes_deep'))
-{
-  function stripslashes_deep($value)
-  {
-    return is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
-  }
-}
-
-?>
Index: /extensions/Back2Front/include/Back2Front.php
===================================================================
--- /extensions/Back2Front/include/Back2Front.php	(revision 23177)
+++ /extensions/Back2Front/include/Back2Front.php	(revision 23177)
@@ -0,0 +1,361 @@
+<?php 
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+include_once(B2F_PATH.'include/functions.inc.php');
+
+/*
+ * Add verso link on picture page
+ */
+function back2front_picture_content($content, $element_info)
+{
+  global $template, $user, $conf;
+
+  /* search for a verso picture */
+  $query = '
+SELECT i.*
+  FROM '.IMAGES_TABLE.' as i
+    INNER JOIN '.B2F_TABLE.' as v
+    ON i.id = v.verso_id
+    AND v.image_id = '.$element_info['id'].'
+;';
+  $result = pwg_query($query);
+
+  if (pwg_db_num_rows($result)) 
+  {
+    $verso = pwg_db_fetch_assoc($result);
+    $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
+    
+    $verso['src_image'] = new SrcImage($verso);
+    $verso['derivatives'] = DerivativeImage::get_all($verso['src_image']);
+    $verso['element_path'] = get_element_path($verso);
+    $verso['selected_derivative'] = $verso['derivatives'][$deriv_type];
+    
+    /* websize picture */
+    $template->assign(array(
+      'B2F_PATH' => B2F_PATH,
+      'verso' => $verso,
+      ));
+    
+    /* admin link */
+    if (is_admin())
+    {
+      $template->assign('VERSO_U_ADMIN', get_root_url().'admin.php?page=photo-'.$verso['id']);
+      $template->set_filename('B2F_admin_button', realpath(B2F_PATH.'template/admin_button.tpl'));
+      $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('B2F_admin_button', true));
+    }
+    
+    /* link name */
+    if (!empty($conf['back2front']['link_name'][$user['language']]))
+    {
+      if (strpos($conf['back2front']['link_name'][$user['language']], '|') !== false)
+      {
+        $conf['back2front']['link_name'] = explode('|', $conf['back2front']['link_name'][$user['language']]);
+      }
+      else
+      {
+        $conf['back2front']['link_name'] = array_fill(0, 2, $conf['back2front']['link_name'][$user['language']]);
+      }
+    }
+    else if (!empty($conf['back2front']['link_name']['default']))
+    {
+      if (strpos($conf['back2front']['link_name']['default'], '|') != false)
+      {
+        $conf['back2front']['link_name'] = explode('|', $conf['back2front']['link_name']['default']);
+      }
+      else
+      {
+        $conf['back2front']['link_name'] = array_fill(0, 2, $conf['back2front']['link_name']['default']);
+      }
+    }
+    else
+    {
+      $conf['back2front']['link_name'] = array(l10n('See back'), l10n('See front'));
+    }
+    
+    if ($conf['back2front']['transition'] == 'fade' && $conf['back2front']['position'] == 'bottom')
+    {
+      $conf['back2front']['position'] = 'top';
+    }
+    
+
+    /* template & output */
+    $template->set_filename('B2F_picture_content', realpath(B2F_PATH.'template/picture_content.tpl'));    
+    $template->assign(array(
+      'b2f_switch_mode' => $conf['back2front']['switch_mode'],
+      'b2f_transition' => $conf['back2front']['transition'],
+      'b2f_position' => $conf['back2front']['position'],
+      'b2f_see_back' => $conf['back2front']['link_name'][0],
+      'b2f_see_front' => $conf['back2front']['link_name'][1],
+    ));
+    
+    switch ($conf['back2front']['position'])
+    {
+      case 'toolbar':
+        $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('B2F_picture_content', true));
+        break;
+      case 'top':
+        $content = $template->parse('B2F_picture_content', true)."\n".$content;
+        break;
+      case 'bottom':
+        $content = $content."\n".$template->parse('B2F_picture_content', true);
+        break;
+    }    
+  }
+  
+  return $content;
+}
+
+
+/*
+ * Add field on picture modify page
+ */
+function back2front_picture_modify()
+{
+  global $page, $template, $conf;
+  
+  if ($page['page'] != 'photo') return;
+  if (isset($_GET['tab']) && $_GET['tab']!='properties') return;
+  
+/* SAVE VALUES */
+  if (isset($_POST['b2f_submit']))
+  {
+    /* catch all verso and recto ids and original categories */
+    $query = 'SELECT * FROM '.B2F_TABLE.';';
+    $result = pwg_query($query);
+    
+    $rectos = $versos = $cats = array();
+    while ($row = pwg_db_fetch_assoc($result))
+    {
+      $rectos[] = $row['image_id'];
+      $versos[] = $row['verso_id'];
+      $cats[] = $row['categories'];
+    }
+    
+    if (count($rectos) != 0)
+    {
+      $all_recto_verso = array_combine($rectos, $versos);
+      $verso_cats = array_combine($versos, $cats);
+    }
+    else
+    {
+      $all_recto_verso = array(0=>0);
+      $verso_cats = array(0=>null);
+    }
+    unset($rectos, $versos, $cats);
+    
+    /* picture is verso */
+    if (isset($_POST['b2f_is_verso']))
+    {      
+      /* verso don't exists */
+      if (!picture_exists($_POST['b2f_front_id']))
+      {
+        array_push($page['errors'], sprintf(
+          l10n('Unknown id %d for frontside picture'), 
+          $_POST['b2f_front_id']
+          ));
+      }
+      /* verso same as recto  */
+      else if ($_POST['b2f_front_id'] == $_GET['image_id'])
+      {
+        array_push($page['errors'], l10n('Backside and frontside can\'t be the same picture'));
+      }
+      /* recto has already a verso */
+      else if (in_array($_POST['b2f_front_id'], array_keys($all_recto_verso)) && $all_recto_verso[$_POST['b2f_front_id']] != $_GET['image_id'])
+      {
+        $recto_current_verso['id'] = $all_recto_verso[$_POST['b2f_front_id']];
+        $recto_current_verso['link'] = get_root_url().'admin.php?page=photo-'.$recto_current_verso['id'];
+        
+        array_push($page['errors'], sprintf(
+          l10n('The picture n°%d has already a backside : %s'), 
+          $_POST['b2f_front_id'], 
+          '<a href="'.$recto_current_verso['link'].'">'.$recto_current_verso['id'].'</a>'
+          ));
+      }
+      /* recto is already a verso */
+      else if (in_array($_POST['b2f_front_id'], array_values($all_recto_verso)))
+      {
+        $recto_is_verso['id'] = $_POST['b2f_front_id'];
+        $recto_is_verso['link'] = get_root_url().'admin.php?page=picture_modify&amp;image_id='.$recto_is_verso['id'];
+        
+        array_push($page['errors'],  sprintf(
+          l10n('The picture n°%s is already a backside'), 
+          '<a href="'.$recto_is_verso['link'].'">'.$recto_is_verso['id'].'</a>'
+          ));
+      }
+      /* everything is fine */
+      else
+      {
+        // move the verso - if first save
+        if (isset($_POST['b2f_move_verso']) && (!array_key_exists($_GET['image_id'], $verso_cats) || $verso_cats[$_GET['image_id']] == null))
+        {
+          // get current categories
+          $query = 'SELECT category_id FROM '.IMAGE_CATEGORY_TABLE.' WHERE image_id = '.$_GET['image_id'].';';
+          $verso_categories = array_from_query($query, 'category_id');
+          
+          pwg_query('DELETE FROM '.IMAGE_CATEGORY_TABLE.' WHERE image_id = '.$_GET['image_id'].';');
+          pwg_query('INSERT INTO '.IMAGE_CATEGORY_TABLE.'(image_id, category_id) VALUES('.$_GET['image_id'].', '.$conf['back2front']['versos_cat'].');');
+            
+          // random representant for each categories
+          set_random_representant($verso_categories);
+          
+          $verso_categories = isset($verso_cats[$_GET['image_id']]) ? $verso_cats[$_GET['image_id']] : implode(',',$verso_categories);
+          $template->assign('B2F_MOVE_VERSO', 'checked="checked"');
+        }
+        // restore the verso - if precedently moved
+        else if (!isset($_POST['b2f_move_verso']) && array_key_exists($_GET['image_id'], $verso_cats) && $verso_cats[$_GET['image_id']] != null)
+        {
+          $item['verso_id'] = $_GET['image_id'];
+          $item['categories'] = $verso_cats[$_GET['image_id']];
+          back2front_restaure_categories($item);
+          
+          $verso_categories = 'NULL';
+          $template->assign('B2F_MOVE_VERSO', '');
+        }
+        // leave the verso
+        else
+        {
+          $verso_categories = isset($verso_cats[$_GET['image_id']]) ? $verso_cats[$_GET['image_id']] : 'NULL';
+          $template->assign('B2F_MOVE_VERSO', isset($verso_cats[$_GET['image_id']]) ? 'checked="checked"' : '');
+        }
+        
+        // insert or update verso associations
+        $query = '
+INSERT INTO '.B2F_TABLE.'
+  VALUES(
+    '.$_POST['b2f_front_id'].',
+    '.$_GET['image_id'].',
+    "'.$verso_categories.'"
+  )
+  ON DUPLICATE KEY UPDATE
+    image_id = '.$_POST['b2f_front_id'].',
+    categories = "'.$verso_categories.'"
+;';
+        pwg_query($query);
+        
+        $template->assign(array(
+          'B2F_IS_VERSO' => 'checked="checked"',
+          'B2F_FRONT_ID' => $_POST['b2f_front_id'],
+        ));
+        
+        $verso['id'] = $_POST['b2f_front_id'];
+        $verso['link'] = get_root_url().'admin.php?page=photo-'.$verso['id'];
+        
+        array_push($page['infos'], sprintf(
+          l10n('This picture is now the backside of the picture n°%s'),
+          '<a href="'.$verso['link'].'">'.$verso['id'].'</a>'
+          ));
+      }
+    }
+    /* picture isn't verso */
+    else
+    {
+      /* search if it was a verso */
+      $query = '
+SELECT categories
+  FROM '.B2F_TABLE.'
+  WHERE verso_id = '.$_GET['image_id'].'
+;';
+      $result = pwg_query($query);
+      
+      /* it must be restored to its original categories */
+      if (pwg_db_num_rows($result))
+      {
+        $item['verso_id'] = $_GET['image_id'];
+        list($item['categories']) = pwg_db_fetch_row($result);
+        
+        back2front_restaure_categories($item);
+        pwg_query('DELETE FROM '.B2F_TABLE.' WHERE verso_id = '.$_GET['image_id'].';');
+        array_push($page['infos'], l10n('This picture is no longer a backside'));
+      }
+    }
+  }
+  
+/* GET SAVED VALUES */
+  if ($template->get_template_vars('B2F_IS_VERSO') == null)
+  {
+    $template->assign('B2F_MOVE_VERSO', 'checked="checked"');
+    
+    /* is the picture a verso ? */
+    $query = '
+SELECT image_id, categories
+  FROM '.B2F_TABLE.'
+  WHERE verso_id = '.$_GET['image_id'].'
+;';
+    $result = pwg_query($query);
+    
+    if (pwg_db_num_rows($result))
+    {
+      list($recto_id, $cats) = pwg_db_fetch_row($result);
+      
+      $template->assign(array(
+        'B2F_IS_VERSO' => 'checked="checked"',
+        'B2F_FRONT_ID' => $recto_id,
+        'B2F_MOVE_VERSO' => $cats != NULL ? 'checked="checked"' : '',
+      ));
+    }
+    /* is the picture a front ? */
+    else
+    {
+      $query = '
+SELECT verso_id
+  FROM '.B2F_TABLE.'
+  WHERE image_id = '.$_GET['image_id'].'
+;';
+      $result = pwg_query($query);
+      
+      if (pwg_db_num_rows($result))
+      {      
+        $item = pwg_db_fetch_assoc($result);
+
+        $template->assign(array(
+          'B2F_VERSO_ID' => $item['verso_id'],
+          'B2F_VERSO_URL' => get_root_url().'admin.php?page=photo-'.$item['verso_id'],
+        ));
+      }
+    }
+  }
+  
+  $template->set_prefilter('picture_modify', 'back2front_picture_modify_prefilter');
+}
+
+
+function back2front_picture_modify_prefilter($content, &$smarty)
+{
+  $search = '</form>';
+  $replacement = $search."\n\n".file_get_contents(B2F_PATH.'template/picture_modify.tpl');
+  return str_replace($search, $replacement, $content);
+}
+
+
+/*
+ * Add mark on thumbnails list
+ */
+function back2front_thumbnails($tpl_thumbnails_var)
+{
+  global $conf, $selection;
+  
+  if (!$conf['back2front']['show_thumbnail']) return $tpl_thumbnails_var;
+  if (empty($tpl_thumbnails_var)) return $tpl_thumbnails_var;
+    
+  /* has the pictures a verso ? */
+  $query = '
+SELECT image_id
+  FROM '.B2F_TABLE.'
+  WHERE image_id IN('.implode(',', $selection).')
+;';
+  $ids = array_from_query($query, 'image_id');
+  
+  $root_path = get_absolute_root_url();
+  
+  foreach($tpl_thumbnails_var as &$tpl_var)
+  {
+    if (in_array($tpl_var['id'], $ids))
+    {
+      $tpl_var['NAME'].= ' <img class="has_verso" src="'.$root_path.B2F_PATH.'template/rotate_1.png" title="'.l10n('This picture has a backside :').'"/>';
+    }
+  }
+  
+  return $tpl_thumbnails_var;
+}
+
+?>
Index: /extensions/Back2Front/include/functions.inc.php
===================================================================
--- /extensions/Back2Front/include/functions.inc.php	(revision 23177)
+++ /extensions/Back2Front/include/functions.inc.php	(revision 23177)
@@ -0,0 +1,109 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+/*
+ * restore verso to its original categories
+ * criterias :
+ *  - verso  'versos' cat only => restore verso to original categories
+ *  - otherwise nothing is changed
+ *  
+ * $item = array('verso_id', 'categories');
+*/
+function back2front_restaure_categories($item)
+{
+  global $conf;
+  
+  /* catch current verso categories */
+  $query = 'SELECT DISTINCT category_id FROM '.IMAGE_CATEGORY_TABLE.' WHERE image_id = '.$item['verso_id'].';';
+  $item['current_verso_cats'] = array_from_query($query, 'category_id');
+
+  /* if verso  'versos' cat only */
+  if (count($item['current_verso_cats']) == 1 && $item['current_verso_cats'][0] == $conf['back2front']['versos_cat'])
+  {
+    foreach (explode(',',$item['categories']) as $cat)
+    {
+      $datas[] = array(
+        'image_id' => $item['verso_id'],
+        'category_id' => $cat,
+        );
+    }
+  }
+
+  if (isset($datas))
+  {
+    mass_inserts(
+      IMAGE_CATEGORY_TABLE,
+      array('image_id', 'category_id'),
+      $datas
+      );
+  }
+  
+  $query = '
+DELETE FROM '.IMAGE_CATEGORY_TABLE.'
+  WHERE image_id = '.$item['verso_id'].' 
+    AND category_id = '.$conf['back2front']['versos_cat'].'
+;';
+  pwg_query($query);
+}
+
+function back2front_check_storage()
+{
+  global $conf;
+  
+  if ($conf['back2front']['versos_cat'] != 0)
+  {
+    $query = '
+SELECT COUNT(*) FROM '.CATEGORIES_TABLE.'
+  WHERE id = '.$conf['back2front']['versos_cat'].'
+    AND name = "Back2Front private album"
+;';
+    $result = pwg_query($query);
+    
+    if (pwg_db_num_rows($result))
+    {
+      return;
+    }
+  }
+  
+  $versos_cat = create_virtual_category('Back2Front private album');
+  $versos_cat = array(
+    'id' => $versos_cat['id'],
+    'comment' => 'Used by Back2Front to store backsides.',
+    'status'  => 'private',
+    'visible' => 'false',
+    'commentable' => 'false',
+    );
+  
+  mass_updates(
+    CATEGORIES_TABLE,
+    array(
+      'primary' => array('id'),
+      'update' => array_diff(array_keys($versos_cat), array('id'))
+      ),
+    array($versos_cat)
+    );
+    
+  $conf['back2front']['versos_cat'] = $versos_cat['id'];
+  conf_update_param('back2front', serialize($conf['back2front']));
+}
+
+function picture_exists($id)
+{
+  if (!preg_match('#([0-9]{1,})#', $id) || $id == '0') return false;
+  
+  $query = "SELECT id FROM ".IMAGES_TABLE." WHERE id = ".$id.";";
+  $result = pwg_query($query);
+  
+  if (pwg_db_num_rows($result)) return true;
+  else return false;
+}
+
+if (!function_exists('stripslashes_deep'))
+{
+  function stripslashes_deep($value)
+  {
+    return is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
+  }
+}
+
+?>
Index: /extensions/Back2Front/include/index.php
===================================================================
--- /extensions/Back2Front/include/index.php	(revision 23177)
+++ /extensions/Back2Front/include/index.php	(revision 23177)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2011 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Back2Front/include/install.inc.php
===================================================================
--- /extensions/Back2Front/include/install.inc.php	(revision 23177)
+++ /extensions/Back2Front/include/install.inc.php	(revision 23177)
@@ -0,0 +1,89 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+include_once(PHPWG_PLUGINS_PATH . B2F_ID . '/include/functions.inc.php');
+
+function back2front_install() 
+{
+  global $conf, $prefixeTable;
+  
+  // configuration
+  if (empty($conf['back2front']))
+  {
+    // create virtual private cat for storage
+    $versos_cat = create_virtual_category('Back2Front private album');
+    $versos_cat = array(
+      'id' => $versos_cat['id'],
+      'comment' => 'Used by Back2Front to store backsides.',
+      'status'  => 'private',
+      'visible' => 'false',
+      'commentable' => 'false',
+      );
+    
+    mass_updates(
+      CATEGORIES_TABLE,
+      array(
+        'primary' => array('id'),
+        'update' => array_diff(array_keys($versos_cat), array('id'))
+        ),
+      array($versos_cat)
+      );
+    
+    $Back2Front_default_config = array(
+      'versos_cat' => $versos_cat['id'],
+      'switch_mode' => 'click',
+      'transition' => 'none',
+      'position' => 'top',
+      'link_name' => array('default'=>null),
+      'show_thumbnail' => true,
+      );
+      
+    $conf['back2front'] = serialize($Back2Front_default_config);
+    
+    conf_update_param('back2front', $conf['back2front']);
+  }
+  else
+  {
+    if (is_string($conf['back2front']))
+    {
+      if (($old_conf = @unserialize($conf['back2front'])) === false)
+      {
+        $old_conf = explode(',', $conf['back2front']);
+      }
+    }
+    else
+    {
+      $old_conf = $conf['back2front'];
+    }
+    
+    // convert old comma separated conf
+    if (isset($old_conf[0]))
+    {
+      $new_conf = array(
+        'versos_cat' => $old_conf[0],
+        'switch_mode' => $old_conf[1],
+        'transition' => $old_conf[2],
+        'position' => $old_conf[3],
+        'link_name' => unserialize($old_conf[4]),
+        'show_thumbnail' => @$old_conf[5],
+        );
+    
+      $conf['back2front'] = serialize($new_conf);
+      conf_update_param('back2front', $conf['back2front']);
+    }
+  }
+  
+  // create tables
+  $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,
+  `categories` varchar(128) NULL,
+  PRIMARY KEY (`image_id`),
+  UNIQUE KEY (`verso_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+';
+  pwg_query($query);
+}
+
+?>
Index: /extensions/Back2Front/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Back2Front/language/en_UK/plugin.lang.php	(revision 23176)
+++ /extensions/Back2Front/language/en_UK/plugin.lang.php	(revision 23177)
@@ -22,5 +22,5 @@
 $lang['...of the picture n°'] = '...of the picture n°';
 $lang['Backside management'] = 'Backside management';
-$lang['Move backside to private album'] = 'Move backside to private album';
+$lang['Hide backside from albums'] = 'Hide backside from albums';
 $lang['This picture has a backside :'] = 'This picture has a backside: ';
 
Index: /extensions/Back2Front/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Back2Front/language/fr_FR/plugin.lang.php	(revision 23176)
+++ /extensions/Back2Front/language/fr_FR/plugin.lang.php	(revision 23177)
@@ -22,5 +22,5 @@
 $lang['...of the picture n°'] = '...de l\'image n°';
 $lang['Backside management'] = 'Gestion des recto-verso';
-$lang['Move backside to private album'] = 'Déplacer le verso vers un album privé';
+$lang['Hide backside from albums'] = 'Masquer le verso dans les albums';
 $lang['This picture has a backside :'] = 'Cette image a un verso : ';
 
Index: /extensions/Back2Front/main.inc.php
===================================================================
--- /extensions/Back2Front/main.inc.php	(revision 23176)
+++ /extensions/Back2Front/main.inc.php	(revision 23177)
@@ -12,14 +12,45 @@
 global $prefixeTable;
 
-define('B2F_DIR', basename(dirname(__FILE__)));
-define('B2F_PATH', PHPWG_PLUGINS_PATH . B2F_DIR . '/');
+defined('B2F_ID') or define('B2F_ID', basename(dirname(__FILE__)));
+define('B2F_PATH', PHPWG_PLUGINS_PATH . B2F_ID . '/');
 define('B2F_TABLE', $prefixeTable . 'image_verso');
+define('B2F_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . B2F_ID);
+define('B2F_VERSION', 'auto');
 
-include_once(B2F_PATH . 'Back2Front.php');
+include_once(B2F_PATH . 'include/Back2Front.php');
 
-add_event_handler('init', 'Back2Front_init');
+add_event_handler('init', 'back2front_init');
 
-function Back2Front_init()
+function back2front_init()
 {
+  global $conf, $pwg_loaded_plugins;
+  
+  if (
+    B2F_VERSION == 'auto' or
+    $pwg_loaded_plugins[B2F_ID]['version'] == 'auto' or
+    version_compare($pwg_loaded_plugins[B2F_ID]['version'], B2F_VERSION, '<')
+  )
+  {
+    include_once(B2F_PATH . 'include/install.inc.php');
+    back2front_install();
+    
+    if ( $pwg_loaded_plugins[B2F_ID]['version'] != 'auto' and B2F_VERSION != 'auto' )
+    {
+      $query = '
+UPDATE '. PLUGINS_TABLE .'
+SET version = "'. B2F_VERSION .'"
+WHERE id = "'. B2F_ID .'"';
+      pwg_query($query);
+      
+      $pwg_loaded_plugins[B2F_ID]['version'] = B2F_VERSION;
+      
+      if (defined('IN_ADMIN'))
+      {
+        $_SESSION['page_infos'][] = 'Back2Front updated to version '. B2F_VERSION;
+      }
+    }
+  }
+  
+  $conf['back2front'] = unserialize($conf['back2front']);
   load_language('plugin.lang', B2F_PATH);
 }
@@ -27,22 +58,23 @@
 if (script_basename() == 'picture')
 {
-  add_event_handler('render_element_content', 'Back2Front_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL+20, 2);
+  add_event_handler('render_element_content', 'back2front_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL+20, 2);
 }
 
 if (script_basename() == 'index')
 {
-  add_event_handler('loc_end_index_thumbnails', 'Back2Front_thumbnails');
+  add_event_handler('loc_end_index_thumbnails', 'back2front_thumbnails');
 }
 
 if (script_basename() == 'admin')
 {
-  add_event_handler('loc_begin_admin_page', 'Back2Front_picture_modify');
+  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) 
+  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));
+      'URL' => B2F_ADMIN,
+    ));
     return $menu;
   }
Index: /extensions/Back2Front/maintain.inc.php
===================================================================
--- /extensions/Back2Front/maintain.inc.php	(revision 23176)
+++ /extensions/Back2Front/maintain.inc.php	(revision 23177)
@@ -2,74 +2,30 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-include_once(PHPWG_PLUGINS_PATH.'Back2Front/functions.inc.php');
+defined('B2F_ID') or define('B2F_ID', basename(dirname(__FILE__)));
+include_once(PHPWG_PLUGINS_PATH . B2F_ID . '/include/install.inc.php');
+include_once(PHPWG_PLUGINS_PATH . B2F_ID . '/include/functions.inc.php');
 
 function plugin_install() 
 {
-  global $prefixeTable;
-
-  /* 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',
-    `categories` varchar(128) NULL,
-    PRIMARY KEY (`image_id`),
-    UNIQUE KEY (`verso_id`)
-  ) DEFAULT CHARSET=utf8;");
+  back2front_install();
   
-  /* create a virtual category to store versos */
-  $versos_cat = create_virtual_category('Back2Front private album');
-  $versos_cat = array(
-    'id' => $versos_cat['id'],
-    'comment' => 'Used by Back2Front to store backsides.',
-    'status'  => 'private',
-    'visible' => 'false',
-    'commentable' => 'false',
-    );
-  mass_updates(
-    CATEGORIES_TABLE,
-    array(
-      'primary' => array('id'),
-      'update' => array_diff(array_keys($versos_cat), array('id'))
-      ),
-    array($versos_cat)
-    );
-    
-  /* config parameter */
-  pwg_query("INSERT INTO `" . CONFIG_TABLE . "`
-    VALUES ('back2front', '".$versos_cat['id'].",click,none,top,".serialize(array('default'=>null)).",1', 'Configuration for Back2Front plugin');");
+  define('back2front_installed', true);
 }
 
 function plugin_activate()
 {
-  global $conf;
-
-
-  $conf['back2front'] = explode(',', $conf['back2front']);
-  
-  if (!isset($conf['back2front'][3])) 
+  if (!defined('back2front_installed'))
   {
-    $conf['back2front'][3] = 'top';
-    $conf['back2front'][4] = serialize(array('default'=>null));
+    back2front_install();
   }
-  if (!isset($conf['back2front'][5]))
-  {
-    $conf['back2front'][5] = true;
-  }
-  
-  conf_update_param('back2front', implode (',', $conf['back2front'])); 
 }
 
 
-function plugin_uninstall() {
+function plugin_uninstall()
+{
   global $conf, $prefixeTable;
   
-  $conf['back2front'] = explode(',',$conf['back2front']);
+  $conf['back2front'] = unserialize($conf['back2front']);
   
-  /* versos must be restored to their original categories
-   criterias :
-    - verso  'versos' cat only => restore verso to original categories
-    - otherwise nothing is changed
-  */
-
   $query = "SELECT * FROM `" . $prefixeTable . "image_verso`;";
   $images_versos = pwg_query($query);
@@ -82,7 +38,7 @@
   pwg_query("DROP TABLE `" . $prefixeTable . "image_verso`;");
   pwg_query("DELETE FROM `" . CONFIG_TABLE . "` WHERE param = 'back2front';");
-  pwg_query("DELETE FROM `" . CATEGORIES_TABLE ."`WHERE id = ".$conf['back2front'][0].";");
+  pwg_query("DELETE FROM `" . CATEGORIES_TABLE ."`WHERE id = ".$conf['back2front']['versos_cat'].";");
   
-  /* rebuild categories cache */
+  // rebuild categories cache
   include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
   invalidate_user_cache(true);
Index: /extensions/Back2Front/template/picture_modify.tpl
===================================================================
--- /extensions/Back2Front/template/picture_modify.tpl	(revision 23176)
+++ /extensions/Back2Front/template/picture_modify.tpl	(revision 23177)
@@ -33,5 +33,5 @@
       
       <tr class="frontside_param" {if !isset($B2F_IS_VERSO)}style="display:none;"{/if}>
-        <td><b>{'Move backside to private album'|@translate}</b></td>
+        <td><b>{'Hide backside from albums'|@translate}</b></td>
         <td><input type="checkbox" name="b2f_move_verso" {$B2F_MOVE_VERSO}></td>
       </tr>
