Index: /extensions/photoWidget/CHANGELOG
===================================================================
--- /extensions/photoWidget/CHANGELOG	(revision 5646)
+++ /extensions/photoWidget/CHANGELOG	(revision 5647)
@@ -1,2 +1,7 @@
+photoWidget 0.2.0 - 2010-04-04
+================================
+* Improve categories selections in admin
+* Fix some mispelling language keys
+
 photoWidget 0.1.1 - 2010-04-03
 ================================
Index: /extensions/photoWidget/admin.php
===================================================================
--- /extensions/photoWidget/admin.php	(revision 5646)
+++ /extensions/photoWidget/admin.php	(revision 5647)
@@ -30,21 +30,36 @@
 
 if (!empty($_POST['submit'])) {
-  if (isset($_POST['pw_all_categories']) && $_POST['pw_all_categories']!=$me->pw_all_categories) {
-    $me->pw_all_categories = $_POST['pw_all_categories'];
-    array_push($GLOBALS['page']['infos'],
-               l10n('You choose that mode for').' '.l10n('all categories'));
-    $save_config = true;
-  } else {
-    if (!empty($_POST['pw_categories']) && $_POST['pw_categories']!=$me->pw_categories) {
-      $me->pw_categories = $_POST['pw_categories'];
+  if (isset($_POST['pw_all_categories'])) {
+    if ($_POST['pw_all_categories']==1) {
       array_push($GLOBALS['page']['infos'],
-                 l10n('You choose that mode for').' '.
-                 l10n_dec('one category',
-                          'severals categories',
-                          count($_POST['pw_categories'])));
+                 l10n('You choose that mode for').' '.l10n('all categories'));
+      $me->pw_all_categories = 1;
+      $me->pw_categories = array();
       $save_config = true;
+    } else {
+      if (isset($_POST['pw_categories'])) {
+        if (count($_POST['pw_categories'])==1 && ($_POST['pw_categories'][0]=='__none__')) {
+          array_push($GLOBALS['page']['errors'],
+                     l10n('You must choose at least one category'));
+          $me->pw_categories = array();
+          $save_config = true;      
+        } else {
+          array_push($GLOBALS['page']['infos'],
+                     l10n('You choose that mode for').' '.
+                     l10n_dec('one category',
+                              'severals categories',
+                              count($_POST['pw_categories'])));
+          $me->pw_all_categories = 0;
+          $me->pw_categories = $_POST['pw_categories'];        
+          $save_config = true;      
+        }
+      } else {
+        array_push($GLOBALS['page']['errors'],
+                   l10n('You must choose at least one category'));
+      }
     }
   }
-    if (!empty($_POST['pw_width']) && intval($_POST['pw_width'])!=$me->pw_width) {
+
+  if (!empty($_POST['pw_width']) && intval($_POST['pw_width'])!=$me->pw_width) {
     $me->pw_width = intval($_POST['pw_width']);
     array_push($GLOBALS['page']['infos'], l10n('Width has been updated'));
Index: /extensions/photoWidget/css/admin.css
===================================================================
--- /extensions/photoWidget/css/admin.css	(revision 5646)
+++ /extensions/photoWidget/css/admin.css	(revision 5647)
@@ -35,8 +35,4 @@
 
 p.hide { 
-  filter: alpha(opacity=70);
-  opacity: 0.7;
-  -moz-opacity: 0.7;
-  -khtml-opacity: 0.7;
-
+  display: none;
 }
Index: /extensions/photoWidget/default_values.inc.php
===================================================================
--- /extensions/photoWidget/default_values.inc.php	(revision 5646)
+++ /extensions/photoWidget/default_values.inc.php	(revision 5647)
@@ -21,4 +21,5 @@
 
 $default_values['pw_all_categories'] = 0;
+$default_values['pw_categories'] = array();
 $default_values['pw_bgcolor'] = '000000'; 
 $default_values['pw_width'] = 600;
Index: /extensions/photoWidget/include/photoWidgetContent.class.php
===================================================================
--- /extensions/photoWidget/include/photoWidgetContent.class.php	(revision 5646)
+++ /extensions/photoWidget/include/photoWidgetContent.class.php	(revision 5647)
@@ -22,5 +22,5 @@
 class photoWidgetContent
 {
-  private $query_string = null;
+  private $query_string = null, $applicable = false;
   
   public function __construct($config) {
Index: /extensions/photoWidget/language/en_UK/index.php
===================================================================
--- /extensions/photoWidget/language/en_UK/index.php	(revision 5646)
+++ /extensions/photoWidget/language/en_UK/index.php	(revision 5647)
@@ -1,12 +1,7 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | PhpWebGallery - a PHP based picture gallery                           |
-// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | pwgPhotoWidget  - a plugin for Piwigo                                 |
 // +-----------------------------------------------------------------------+
-// | file          : $Id$
-// | last update   : $Date$
-// | last modifier : $Author$
-// | revision      : $Revision$
+// | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
Index: /extensions/photoWidget/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/photoWidget/language/en_UK/plugin.lang.php	(revision 5646)
+++ /extensions/photoWidget/language/en_UK/plugin.lang.php	(revision 5647)
@@ -22,5 +22,7 @@
 $lang['That plugin display pictures using a flash movie that rotates them in 3D. It works like regulars categories but in a more amazing and exciting way.'] = 'That plugin display pictures using a flash movie that rotates them in 3D. It works like regulars categories but in a more amazing and exciting way.';
 $lang['You can choose that mode for displaying one, severals or all categories'] = 'You can choose that mode for displaying one, severals or all categories';
+$lang['Main configuration'] = 'Main configuration';
 $lang['All categories'] = 'All categories';
+$lang['Applicable categorie(s)'] = 'Applicable categorie(s)';
 $lang['Animation size'] = 'Animation size';
 $lang['Animation background color'] = 'Animation background color';
Index: /extensions/photoWidget/language/es_ES/index.php
===================================================================
--- /extensions/photoWidget/language/es_ES/index.php	(revision 5646)
+++ /extensions/photoWidget/language/es_ES/index.php	(revision 5647)
@@ -1,12 +1,7 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | PhpWebGallery - a PHP based picture gallery                           |
-// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | pwgPhotoWidget  - a plugin for Piwigo                                 |
 // +-----------------------------------------------------------------------+
-// | file          : $Id$
-// | last update   : $Date$
-// | last modifier : $Author$
-// | revision      : $Revision$
+// | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
Index: /extensions/photoWidget/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/photoWidget/language/es_ES/plugin.lang.php	(revision 5646)
+++ /extensions/photoWidget/language/es_ES/plugin.lang.php	(revision 5647)
@@ -3,5 +3,6 @@
 // | photoWidget  - a plugin for Piwigo                                    |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2010 ddtddt  |
+// | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  |
+// | Copyright(C) 2010 ddtddt                                              |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
@@ -21,5 +22,5 @@
 
 $lang['That plugin display pictures using a flash movie that rotates them in 3D. It works like regulars categories but in a more amazing and exciting way.'] = 'Este plugin fija las imagettas bajo la forma de una animación flash 3D.';
-$lang['Vous can choose that mode for displaying one, severals or all categories'] = 'Usted puede elegir este modo de fijación como la una, varios o todas las categorías';
+$lang['You can choose that mode for displaying one, severals or all categories'] = 'Usted puede elegir este modo de fijación como la una, varios o todas las categorías';
 $lang['All categories'] = 'Todas las categorías';
 $lang['Animation size'] = 'Talla de la animación';
Index: /extensions/photoWidget/language/fr_FR/index.php
===================================================================
--- /extensions/photoWidget/language/fr_FR/index.php	(revision 5646)
+++ /extensions/photoWidget/language/fr_FR/index.php	(revision 5647)
@@ -1,12 +1,7 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | PhpWebGallery - a PHP based picture gallery                           |
-// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | pwgPhotoWidget  - a plugin for Piwigo                                 |
 // +-----------------------------------------------------------------------+
-// | file          : $Id$
-// | last update   : $Date$
-// | last modifier : $Author$
-// | revision      : $Revision$
+// | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
Index: /extensions/photoWidget/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/photoWidget/language/fr_FR/plugin.lang.php	(revision 5646)
+++ /extensions/photoWidget/language/fr_FR/plugin.lang.php	(revision 5647)
@@ -21,6 +21,8 @@
 
 $lang['That plugin display pictures using a flash movie that rotates them in 3D. It works like regulars categories but in a more amazing and exciting way.'] = 'Ce plugin affiche les imagettes sous la forme d\'une animation flash en 3D.';
-$lang['Vous can choose that mode for displaying one, severals or all categories'] = 'Vous pouvez choisir ce mode d\'affichage pour une, plusieurs ou toutes les catégories';
+$lang['You can choose that mode for displaying one, severals or all categories'] = 'Vous pouvez choisir ce mode d\'affichage pour une, plusieurs ou toutes les catégories';
+$lang['Main configuration'] = 'Configuration générale';
 $lang['All categories'] = 'Toutes les catégories';
+$lang['Applicable categorie(s)'] = 'Choix de catégorie(s)';
 $lang['Animation size'] = 'Taille de l\'animation';
 $lang['Animation background color'] = 'Couleur de fond de l\'animation';
Index: /extensions/photoWidget/language/templates/plugin.lang.php
===================================================================
--- /extensions/photoWidget/language/templates/plugin.lang.php	(revision 5646)
+++ /extensions/photoWidget/language/templates/plugin.lang.php	(revision 5647)
@@ -21,6 +21,8 @@
 
 $lang['That plugin display pictures using a flash movie that rotates them in 3D. It works like regulars categories but in a more amazing and exciting way.'] = '';
-$lang['Vous can choose that mode for displaying one, severals or all categories'] = '';
+$lang['You can choose that mode for displaying one, severals or all categories'] = '';
+$lang['Main configuration'] = '';
 $lang['All categories'] = '';
+$lang['Applicable categorie(s)'] = '';
 $lang['Animation size'] = '';
 $lang['Animation background color'] = '';
Index: /extensions/photoWidget/main.inc.php
===================================================================
--- /extensions/photoWidget/main.inc.php	(revision 5646)
+++ /extensions/photoWidget/main.inc.php	(revision 5647)
@@ -22,5 +22,5 @@
 /*
 Plugin Name: photoWidget
-Version: 0.1.1
+Version: 0.2.0
 Description: add an amazing 3D animation for pictures
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=370
Index: /extensions/photoWidget/template/admin.tpl
===================================================================
--- /extensions/photoWidget/template/admin.tpl	(revision 5646)
+++ /extensions/photoWidget/template/admin.tpl	(revision 5647)
@@ -7,4 +7,12 @@
 <script type="text/javascript">
 $(function() {
+$('input[name=pw_all_categories]').change(function() {
+if ($(this).attr('value')==0) {
+$('#pw-select-categories').removeClass('hide');
+} else {
+$('#pw-select-categories').addClass('hide');
+}
+});
+
 $('input.pwg-picker')
   .each(function() {
@@ -47,11 +55,11 @@
   <legend>{'Main configuration'|translate}</legend>
   <p class="field radio"><span>{'All categories'|translate} ?</span>
-    {html_radios name='pw_all_categories options=$PW_CAT_CHOICES selected=$PW_ALL_CATEGORIES}
+    {html_radios name="pw_all_categories" options=$PW_CAT_CHOICES selected=$PW_ALL_CATEGORIES}
   </p>
 
-  <p class="field pw-categories">
+  <p class="field pw-categories{if $PW_ALL_CATEGORIES==1} hide{/if}" id="pw-select-categories">
     <label>{'Applicable categorie(s)'|translate}</label>
     <select name="pw_categories[]" multiple="multiple" size="{$pw_categories|@count|@max:3}">
-      <option value=""></option>
+      <option value="__none__"></option>
       {html_options options=$ALL_CATEGORIES selected=$PW_CATEGORIES}
     </select>
