Index: extensions/Juza/images/index.php
===================================================================
--- extensions/Juza/images/index.php	(revision 4516)
+++ extensions/Juza/images/index.php	(revision 4516)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/Juza/include/functions.inc.php
===================================================================
--- extensions/Juza/include/functions.inc.php	(revision 4516)
+++ extensions/Juza/include/functions.inc.php	(revision 4516)
@@ -0,0 +1,108 @@
+<?php
+function Juza_hook() {
+  global $template;
+  Juza_update();
+  $template->set_filenames(array('juza' => 'theme/Juza/script.tpl'));
+  $template->parse('juza');
+}
+
+function Juza_file($src) {
+  global $conf;
+  $remove = (isset($conf['thumbnail_dir'])) ? $conf['thumbnail_dir']:'thumbnail';
+  $remove .= '/' .  $conf['prefix_thumbnail'];
+  $remove = '#' . addslashes( $remove ) . '#';
+  $file = preg_replace( $remove, '', $src, 1 );
+	$pos = strrpos( $file  , '.');
+  $ext = substr($file,$pos);
+	$file_wo_ext = substr($file,0,$pos);
+  if (is_file($file)) return $file; /* 80% have the same file extension */
+  if ($ext <> 'jpg') {
+    if (is_file($file_wo_ext . 'jpg')) return $file;/* 90% */
+  }
+  if ($ext <> 'JPG') {
+    if (is_file($file_wo_ext . 'JPG')) return $file;/* 8% */
+  }
+  if ($ext <> 'png') {
+    if (is_file($file_wo_ext . 'png')) return $file;/* 1.8% */
+  }
+  if ($ext <> 'PNG') {
+    if (is_file($file_wo_ext . 'PNG')) return $file;/* 0.1% */
+  }
+  if ($ext <> 'jpeg') {
+    if (is_file($file_wo_ext . 'jpeg')) return $file;/* or 50% */
+  }
+  if ($ext <> 'JPEG') {
+    if (is_file($file_wo_ext . 'JPEG')) return $file;/* or 40% */
+  }
+  if ($ext <> 'gif') {
+    if (is_file($file_wo_ext . 'gif')) return $file;/* 0.0001% */
+  }
+  if ($ext <> 'GIF') {
+    if (is_file($file_wo_ext . 'GIF')) return $file;/* 0.0001% */
+  }
+	return $src;
+}
+function Juza_update() {
+  global $template, $conf;
+  $conf_Juza = Juza_default();
+  if (isset($conf['Juza Config'])) $conf_Juza = array_merge($conf_Juza, unserialize($conf['Juza Config']));
+  if (isset($_POST['Juza_submit'])) {
+    $conf_Juza['Juza_handlers'] = isset($_POST['Juza_handlers']) ? true:false;
+    $conf_Juza['Juza_width'] = isset($_POST['Juza_width']) ? (integer)$_POST['Juza_width'] : 885;
+    $conf_Juza['Juza_width'] = ($conf_Juza['Juza_width'] > 885) ? 885 : $conf_Juza['Juza_width'];
+    $conf_Juza['Juza_width'] = ($conf_Juza['Juza_width'] < 300) ? 300 : $conf_Juza['Juza_width'];
+    $conf_Juza['Juza_height'] = isset($_POST['Juza_height']) ? (integer)$_POST['Juza_height'] : 400;
+    $conf_Juza['Juza_height'] = ($conf_Juza['Juza_height'] > 400) ? 400 : $conf_Juza['Juza_height'];
+    $conf_Juza['Juza_height'] = ($conf_Juza['Juza_height'] < 110) ? 110 : $conf_Juza['Juza_height'];
+    $conf_Juza['Juza_shift'] = isset($_POST['Juza_shift']) ? (integer)$_POST['Juza_shift'] : -160;
+    $conf_Juza['Juza_shift'] = ($conf_Juza['Juza_shift'] > 0) ? 0 : $conf_Juza['Juza_shift'];
+    $conf_Juza['Juza_shift'] = ($conf_Juza['Juza_shift'] < -320) ? 320 : $conf_Juza['Juza_shift'];
+    $conf_Juza['Juza_Auto_CS'] = isset($_POST['Juza_Auto_CS']) ? true:false;
+    $conf['Juza Config'] = serialize($conf_Juza);
+    $query = 'REPLACE INTO '.CONFIG_TABLE.'
+      SET param = \'Juza Config\',
+      value = \'' . $conf['Juza Config'] . '\',
+      comment = \'Juza Theme Configuration Parameters\';';
+    pwg_query($query);
+  }
+  if (isset($_POST['Juza_reset'])) {
+    $conf_Juza = Juza_default();
+    $conf['Juza Config'] = serialize($conf_Juza);
+    $query = 'REPLACE INTO '.CONFIG_TABLE.'
+      SET param = \'Juza Config\',
+      value = \'' . $conf['Juza Config'] . '\',
+      comment = \'Juza Theme Configuration Parameters\';';
+    pwg_query($query);
+  }
+  $conf['Juza_active'] = (!isset($conf_Juza['Juza_handlers'])) ? true:$conf_Juza['Juza_handlers'];
+
+  if ( is_admin() ) {
+    $template->append('footer_elements', '<form method="post" name="JuzaTC"  action="' . make_index_url() . '">
+<input name="Juza_config" type="submit" value="'. l10n('Juza Theme Configuration') .'" class="conf" />
+<input type="hidden" value="true" name="Juza_conf" />
+</form>');
+  }
+  if ( isset($_POST['Juza_conf']) ) $template->assign('Juza_config', true);
+  if ($conf['Juza_active']) $template->assign('Juza_active', true);
+  if ($conf_Juza['Juza_handlers']) $template->assign('Juza_handlers', 'checked="checked"');
+  $template->assign('Juza_width', $conf_Juza['Juza_width']);
+  $template->assign('Juza_height', $conf_Juza['Juza_height']);
+  $template->assign('Juza_height2', 55+$conf_Juza['Juza_height']);
+  $template->assign('Juza_height3', 325+$conf_Juza['Juza_height']);
+  $template->assign('Juza_shift', $conf_Juza['Juza_shift']);
+  $template->assign('Juza_shift2', 150-$conf_Juza['Juza_height']);
+  $template->assign('Juza_shift3', -(12+$conf_Juza['Juza_height']));
+  if ($conf_Juza['Juza_Auto_CS']) $template->assign('Juza_Auto_CS', 'checked="checked"');
+  if (isset($_POST['Juza_close'])) {
+    redirect(make_index_url());
+  }
+}
+function Juza_default() {
+  return array(
+    'Juza_handlers' => true,
+    'Juza_width'    => 885,
+    'Juza_height'   => 240,
+    'Juza_shift'    => -160,
+    'Juza_Auto_CS'  => true,);
+}
+?>
Index: extensions/Juza/include/index.php
===================================================================
--- extensions/Juza/include/index.php	(revision 4516)
+++ extensions/Juza/include/index.php	(revision 4516)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/Juza/js/index.php
===================================================================
--- extensions/Juza/js/index.php	(revision 4516)
+++ extensions/Juza/js/index.php	(revision 4516)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/Juza/language/description.txt
===================================================================
--- extensions/Juza/language/description.txt	(revision 4516)
+++ extensions/Juza/language/description.txt	(revision 4516)
@@ -0,0 +1,1 @@
+Juza Theme Configuration: Juza is a jQuery theme which crops and shifts medium pictures to use them as thumbnail replacement.
Index: extensions/Juza/language/en_UK/index.php
===================================================================
--- extensions/Juza/language/en_UK/index.php	(revision 4516)
+++ extensions/Juza/language/en_UK/index.php	(revision 4516)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/Juza/language/en_UK/lang.php
===================================================================
--- extensions/Juza/language/en_UK/lang.php	(revision 4516)
+++ extensions/Juza/language/en_UK/lang.php	(revision 4516)
@@ -0,0 +1,16 @@
+<?php
+$lang['Juza Theme Configuration'] = 'Juza Theme Configuration ';
+
+$lang['Activate Juza handlers'] = 'Activate Juza handlers ';
+$lang['Index picture max-width'] = 'Index picture max-width ';
+$lang['[300:885]'] = '[300:885] ';
+$lang['Index picture cropping-height'] = 'Index picture cropping-height';
+$lang['[110:400]'] = '[110:400] ';
+$lang['Index picture top-shift'] = 'Index picture top-shift ';
+$lang['[-320:0]'] = '[-320:0] ';
+$lang['Auto cropping and shifting'] = 'Auto cropping and shifting ';
+$lang['Recommended medium width &lt; 900px'] = 'Recommended medium width &lt; 900px ';
+$lang['Juza_Submit'] = 'Submit';
+$lang['Juza_Reset'] = 'Reset';
+$lang['Juza_Close'] = 'Close';
+?>
Index: extensions/Juza/language/fr_FR/index.php
===================================================================
--- extensions/Juza/language/fr_FR/index.php	(revision 4516)
+++ extensions/Juza/language/fr_FR/index.php	(revision 4516)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/Juza/language/fr_FR/lang.php
===================================================================
--- extensions/Juza/language/fr_FR/lang.php	(revision 4516)
+++ extensions/Juza/language/fr_FR/lang.php	(revision 4516)
@@ -0,0 +1,16 @@
+<?php
+$lang['Juza Theme Configuration'] = 'Configuration du thème Juza ';
+
+$lang['Activate Juza handlers'] = 'Activer les interceptions de Juza ';
+$lang['Index picture max-width'] = 'Largeur maximale des images de l\'index ';
+$lang['[300:885]'] = '[300:885] ';
+$lang['Index picture cropping-height'] = 'Hauteur de découpe des images de l\'index ';
+$lang['[110:400]'] = '[110:400] ';
+$lang['Index picture top-shift'] = 'Décalage vers le haut des images de l\'index ';
+$lang['[-320:0]'] = '[-320:0] ';
+$lang['Auto cropping and shifting'] = 'Décalage et découpe automatiques ';
+$lang['Recommended medium width &lt; 900px'] = 'La largeur des images doit rester &lt; 900px ';
+$lang['Juza_Submit'] = 'Enregister';
+$lang['Juza_Reset'] = 'Annuler';
+$lang['Juza_Close'] = 'Fermer';
+?>
Index: extensions/Juza/language/index.php
===================================================================
--- extensions/Juza/language/index.php	(revision 4516)
+++ extensions/Juza/language/index.php	(revision 4516)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 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/Juza/script.tpl
===================================================================
--- extensions/Juza/script.tpl	(revision 4514)
+++ extensions/Juza/script.tpl	(revision 4516)
@@ -126,5 +126,5 @@
         <span class="property">{'Auto cropping and shifting'|@translate}</span>
         <input type="checkbox" name="Juza_Auto_CS" {$Juza_Auto_CS} />
-        <span class="range">{'Recommended medium width less 885px'|@translate}</span>
+        <span class="range">{'Recommended medium width &lt; 900px'|@translate}</span>
       </label>
     </li>
@@ -133,7 +133,7 @@
   
     <input type="hidden" value="true" name="Juza_conf" />
-    <input class="submit" type="submit" name="Juza_submit" value="{'Submit'|@translate}" />
-    <input class="submit" type="submit" name="Juza_reset" value="{'Reset'|@translate}" />
-    <input class="submit" type="submit" name="Juza_close" value="{'Close'|@translate}" />
+    <input class="submit" type="submit" name="Juza_submit" value="{'Juza_Submit'|@translate}" />
+    <input class="submit" type="submit" name="Juza_reset" value="{'Juza_Reset'|@translate}" />
+    <input class="submit" type="submit" name="Juza_close" value="{'Juza_Close'|@translate}" />
   
 </form>
Index: extensions/Juza/themeconf.inc.php
===================================================================
--- extensions/Juza/themeconf.inc.php	(revision 4514)
+++ extensions/Juza/themeconf.inc.php	(revision 4516)
@@ -19,7 +19,7 @@
   'local_head' => '',
 );
-global $user, $conf;
+global $user, $conf, $lang;
 $user["expand"] = true; /* Forced to assign subcategory links inside each category on index page */
-
+load_language('lang', JUZA_PATH);
 /* No handlers at all or Open ? */
 if ($conf['enable_plugins']) { 
