Index: /extensions/Front2Back/Front2Back.css
===================================================================
--- /extensions/Front2Back/Front2Back.css	(revision 9781)
+++ /extensions/Front2Back/Front2Back.css	(revision 9782)
@@ -1,15 +1,11 @@
-/* Front2Back Style ----------------------------------------------------------------------*/
-/*CSS Popup Image Viewer:  Adapted to PWG */
-/*Credits: Dynamic Drive CSS Library */
-/*URL: http://www.dynamicdrive.com/style/ */
-
-.reverse { position: relative; z-index: 0; }
-.reverse:hover{ background-color: transparent; z-index: 50; }
-
-.reverse span { /* enlarged image*/
-  position: absolute; visibility: hidden; text-decoration: none; }
-
-.reverse:hover span { /* enlarged image on hover*/ visibility: visible; }
-
-.reverse span, .reverse span img{ /* enlarged image*/
-  border-width: 0; padding: 0px; background-color: transparent !important; }
+a.reverse {
+	display:inline-block;
+	border:1px solid #666 !important;
+	padding:3px 5px;
+	margin-bottom:10px;
+	font-size:15px;
+	font-style:italic;	
+}
+a.reverse img {
+	vertical-align:top;
+}
Index: /extensions/Front2Back/Front2Back.php
===================================================================
--- /extensions/Front2Back/Front2Back.php	(revision 9781)
+++ /extensions/Front2Back/Front2Back.php	(revision 9782)
@@ -1,73 +1,57 @@
 <?php 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-add_event_handler('render_element_content', 
-    array('Front2Back', 'Front2Back_content'), 99, 2 );
 
-class Front2Back
+function Front2Back_content($content, $image)
 {
-  function Front2Back_content($content, $image)
-  {
-    global $template, $lang, $user, $conf;
-    /* Default values */
-    if (!isset($lang['Front2Back'])) $lang['Front2Back'] = 'See back'; 
-    if (!isset($conf['Front2Back_dir'])) $conf['Front2Back_dir'] = 'verso/'; 
-    if (!isset($conf['Front2Back_vshift'])) $conf['Front2Back_vshift']= 16;
-    if (!isset($conf['Front2Back_hshift'])) $conf['Front2Back_hshift']= -28;
-    if (!isset($conf['Front2Back_parent'])) $conf['Front2Back_parent']= 'thumbnail/';
-    if (!isset($conf['Front2Back_path'])) $conf['Front2Back_inside']= true;
-      else $conf['Front2Back_inside']= false; 
-    
-    /* Build reversal parms and filename */ 
-    if ( $conf['Front2Back_inside'] ) {
-      $verso = substr( $image['path'],
-                0, strrpos( $image['path'], '/' )+1 )
-                . $conf['Front2Back_parent'] . $conf['Front2Back_dir'];
-    }
-    else {  /* example: 
-      $conf['Front2Back_path'] = PHPWG_ROOT_PATH;
-      $conf['Front2Back_parent'] = 'front2back/';
-      $conf['Front2Back_dir'] = '';
-      */
-      $verso = $conf['Front2Back_path']
-                . $conf['Front2Back_parent'] . $conf['Front2Back_dir'];
-    }
-    $verso.= $image['file'];
-    $height = @$image['scaled_height'];
-    $width = @$image['scaled_width'];
-    $shift_left = (int) ($width / 2) + $conf['Front2Back_hshift'];
-    $shift_up = $height  + $conf['Front2Back_vshift']; 
-    $rotat = substr($verso,0,-4).'-r'.substr($verso,-4); // extension .jpg 4car.
-    $template->set_filenames(
-      array('Front2Back' => dirname(__FILE__) . '/Front2Back.tpl') );
+	global $template, $conf;
+	
+	/* Default values */
+	if (!isset($conf['Front2Back_dir'])) $conf['Front2Back_dir'] = 'verso/'; 
+	if (!isset($conf['Front2Back_parent'])) $conf['Front2Back_parent'] = 'thumbnail/';
+	if (!isset($conf['Front2Back_hd_parent'])) $conf['Front2Back_hd_parent'] = 'pwg_high/';
+	if (!isset($conf['Front2Back_path']))
+		$conf['Front2Back_inside']= true;
+	else 
+		$conf['Front2Back_inside']= false; 
 
-    $template->assign(array('F2B_PATH' => F2B_PATH));
-    if (is_file($verso)) {
-      $template->assign(
-        'verso',
-         array(
-           'VERSO_URL' => $verso,
-           'WIDTH_IMG' => $width,
-           'HEIGHT_IMG' => $height,
-           'HSHIFT_IMG' => $shift_left,
-           'VSHIFT_IMG' => $shift_up,
-         )
-       );
-    }
-    elseif (is_file($rotat)) {           /* Is there a rotated file ? */ 
-      $shift_left = (int) ($height / 2) + $conf['Front2Back_hshift'];    
-      $template->assign(
-        'verso',
-         array(
-           'VERSO_URL' => $rotat,
-           'WIDTH_IMG' => $height, /* Swap width/height */
-           'HEIGHT_IMG' => $width, /*   ""        ""    */
-           'HSHIFT_IMG' => $shift_left,
-           'VSHIFT_IMG' => $shift_up,
-         )
-       ); 
-    }
-    else return $content;
-    return $content . $template->parse('Front2Back', true);    
-  }  
-}
+	/* dirs and files */
+	if ( $conf['Front2Back_inside'] ) {
+		$verso_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back_parent'] . $conf['Front2Back_dir'];
+		$hd_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back_hd_parent'] . $conf['Front2Back_dir'];
+	} else {
+		$verso_dir = $conf['Front2Back_path'] . $conf['Front2Back_parent'] . $conf['Front2Back_dir'];
+		$hd_dir = $conf['Front2Back_path'] . $conf['Front2Back_hd_parent'] . $conf['Front2Back_dir'];
+	}
+	$rotat_file = substr($image['file'],0,-4).'-r'.substr($image['file'],-4);
+
+	$template->set_filenames(array('Front2Back' => dirname(__FILE__) . '/Front2Back.tpl') );
+	$template->assign('F2B_PATH', F2B_PATH);
+
+	/* Is there a verso file ? */
+	if (is_file($verso_dir.$image['file'])) 
+	{
+		$template->assign('VERSO_URL', $verso_dir.$image['file']);
+
+		if (is_file($hd_dir.$image['file'])) {
+			$template->assign('VERSO_HD', $hd_dir.$image['file']);
+		}
+	}
+	/* useless section, just for retrocompatibility */
+	else if (is_file($verso_dir.$rotat_file)) 
+	{           
+		$template->assign('VERSO_URL', $verso_dir.$rotat_file); 
+		
+		if (is_file($hd_dir.$rotat_file)) {
+			$template->assign('VERSO_HD', $hd_dir.$rotat_file);
+		}
+	}
+	/* otherwise */
+	else 
+	{
+		return $content;
+	}
+	
+	return $content . $template->parse('Front2Back', true);    
+}  
+
 ?>
Index: /extensions/Front2Back/Front2Back.tpl
===================================================================
--- /extensions/Front2Back/Front2Back.tpl	(revision 9781)
+++ /extensions/Front2Back/Front2Back.tpl	(revision 9782)
@@ -1,18 +1,45 @@
-{html_head}
-<link rel="stylesheet" type="text/css" href="{$F2B_PATH|@cat:'Front2Back.css'}"> 
-{/html_head} 
-<br />
-<a class="reverse" href="#">
-  {'Front2Back'|@translate}
-  <span style="top: -{$verso.VSHIFT_IMG}px; left: -{$verso.HSHIFT_IMG}px;">
-    <img src="{$verso.VERSO_URL}"
-          style="width:{$verso.WIDTH_IMG}px;height:{$verso.HEIGHT_IMG}px;"
-          alt="Verso" />
-    <br />
-    <!--
-    Dynamic Drive
-    <img src="http://www.dynamicdrive.com/cssexamples/media/dynamicdrive.gif" />
-    -->
-  </span>
+{combine_script id="jquery"}
+{combine_css path=$F2B_PATH|@cat:"Front2Back.css"}
+
+{footer_script require="jquery"}
+	jQuery('.reverse').click(function() {ldelim}
+		if (jQuery(this).attr('name') == 'front') {ldelim}
+			/* picture attributes */
+			jQuery('#theImage img:first-child').attr({ldelim}
+				src: '{$VERSO_URL}',
+				style: 'width:;height:;',
+			});
+			
+			/* hd link atributes */
+			{if isset($VERSO_HD)}
+			jQuery('#theImage a:first-child').attr({ldelim}
+				href: "javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"
+			});
+			{/if}
+			
+			/* f2b link content */
+			jQuery(this).html('<img src="{$F2B_PATH}rotate_2.png"/> {'Front2Back_front'|@translate}');
+			jQuery(this).attr('name', 'back');
+			
+		} else if (jQuery(this).attr('name') == 'back') {ldelim}
+			jQuery('#theImage img:first-child').attr({ldelim}
+				src: '{$SRC_IMG}',
+				style: 'width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;',
+			});
+			
+			{if isset($VERSO_HD)}
+			jQuery('#theImage a:first-child').attr({ldelim}
+				href: "javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')')"
+			});
+			{/if}
+			
+			jQuery(this).html('<img src="{$F2B_PATH}rotate_1.png"/> {'Front2Back_back'|@translate}');
+			jQuery(this).attr('name', 'front');
+		}
+	});
+{/footer_script}
+
+<a class="reverse" name="front">
+	<img src="{$F2B_PATH}rotate_1.png"/>
+	{'Front2Back_back'|@translate}
 </a>
-<div style="clear: both;"></div>
Index: /extensions/Front2Back/index.php
===================================================================
--- /extensions/Front2Back/index.php	(revision 9782)
+++ /extensions/Front2Back/index.php	(revision 9782)
@@ -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/Front2Back/language/en_UK/description.txt
===================================================================
--- /extensions/Front2Back/language/en_UK/description.txt	(revision 9782)
+++ /extensions/Front2Back/language/en_UK/description.txt	(revision 9782)
@@ -0,0 +1,1 @@
+Add a link on picture's page to show a alternative version of the pic (for postcards for example)
Index: /extensions/Front2Back/language/en_UK/index.php
===================================================================
--- /extensions/Front2Back/language/en_UK/index.php	(revision 9782)
+++ /extensions/Front2Back/language/en_UK/index.php	(revision 9782)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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/Front2Back/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Front2Back/language/en_UK/plugin.lang.php	(revision 9782)
+++ /extensions/Front2Back/language/en_UK/plugin.lang.php	(revision 9782)
@@ -0,0 +1,6 @@
+<?php
+
+$lang['Front2Back_back'] = 'See back';
+$lang['Front2Back_front'] = 'See front';
+
+?>
Index: /extensions/Front2Back/language/fr_FR/description.txt
===================================================================
--- /extensions/Front2Back/language/fr_FR/description.txt	(revision 9782)
+++ /extensions/Front2Back/language/fr_FR/description.txt	(revision 9782)
@@ -0,0 +1,1 @@
+Ajoute un lien sous l'image pour afficher une version alternative (pour des cartes-postales par exemple)
Index: /extensions/Front2Back/language/fr_FR/index.php
===================================================================
--- /extensions/Front2Back/language/fr_FR/index.php	(revision 9782)
+++ /extensions/Front2Back/language/fr_FR/index.php	(revision 9782)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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/Front2Back/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Front2Back/language/fr_FR/plugin.lang.php	(revision 9782)
+++ /extensions/Front2Back/language/fr_FR/plugin.lang.php	(revision 9782)
@@ -0,0 +1,6 @@
+<?php
+
+$lang['Front2Back_back'] = 'Voir le dos';
+$lang['Front2Back_front'] = 'Voir le devant';
+
+?>
Index: /extensions/Front2Back/language/index.php
===================================================================
--- /extensions/Front2Back/language/index.php	(revision 9782)
+++ /extensions/Front2Back/language/index.php	(revision 9782)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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/Front2Back/main.inc.php
===================================================================
--- /extensions/Front2Back/main.inc.php	(revision 9781)
+++ /extensions/Front2Back/main.inc.php	(revision 9782)
@@ -1,45 +1,19 @@
-<?php /*
+<?php 
+/*
 Plugin Name: Front2Back
-Version: 2.0.a
-Description: Postcards back display if there is. / Verso d'une carte.
+Version: 2.2.0
+Description: Add a link on picture's page to show a alternative version of the pic (for postcards for example)
 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=183
-Author: VDigital (PhpWebGallery team)
-Author URI: http://www.phpwebgallery.net
-*/
-
-/* Synopsis
-1 - If same name file exists in ./thumbnail/verso/ or ...
-2 - A link is displayed
-3 - OnMouseOver Front2Back replace the original picture
-
-Localisation of Front2Back, just add:
-$lang['Front2Back'] = 'See back';
-in your ./language/xxxx/local.lang.php
-
-Requirements/recommendations:
-1 - Backsize = Frontsize
-2 - Profile displayed sizes are Null or > Backsided pictures sizes
-3 - Metadata are synchronized
-
-*/
-/*
-History
-  2008-10-30 2.0.a (stable)
-             Smarty version for Piwigo (Don't use it with PhpWebGallery 1.7.x)
-  2007-11-07 Add -r to back filenames if your picture are portrait in one side
-             and landscape in the other one.  
-  2007-10-10 Additional and optionnal parameters
-     $conf['Front2Back_path'] real path if you want them outside ./galleries/
-       Warning: if F2B_path is set then directory tree will not reminded !
-     $conf['Front2Back_parent'] can be set to 'thumbnail/' or 'pwg_high/'
-     
-  2007-10-08 Conflict with PY GVideo solved 
-     (render_element_content usage error: No residual impact)
-  2007-10-07 First release
+Author: VDigital & Mistic
 */
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-define('F2B_DIR' , basename(dirname(__FILE__)));
-define('F2B_PATH' , PHPWG_PLUGINS_PATH . F2B_DIR . '/');
-include_once( F2B_PATH . 'Front2Back.php');
+
+define('F2B_DIR', basename(dirname(__FILE__)));
+define('F2B_PATH', PHPWG_PLUGINS_PATH . F2B_DIR . '/');
+
+load_language('plugin.lang', F2B_PATH);
+include_once(F2B_PATH . 'Front2Back.php');
+add_event_handler('render_element_content', 'Front2Back_content', 99, 2);
+	
 ?>
