Index: /trunk/admin/infos_images.php
===================================================================
--- /trunk/admin/infos_images.php	(revision 39)
+++ /trunk/admin/infos_images.php	(revision 40)
@@ -173,24 +173,50 @@
     }
   }
-  if ( $_POST['use_common_keywords'] == 1 )
-  {
-    $keywords = get_keywords( $_POST['keywords_cat'] );
-    $query = 'UPDATE '.PREFIX_TABLE.'images';
-    if ( count( $keywords ) == 0 )
-    {
-      $query.= ' SET keywords = NULL';
-    }
-    else
-    {
-      $query.= ' SET keywords = "';
-      foreach ( $keywords as $i => $keyword ) {
-        if ( $i > 0 ) $query.= ',';
-        $query.= $keyword;
-      }
-      $query.= '"';
-    }
+  if ( isset( $_POST['common_keywords'] ) and $_POST['keywords_cat'] != '' )
+  {
+    $query = 'SELECT id,keywords';
+    $query.= ' FROM '.PREFIX_TABLE.'images';
     $query.= ' WHERE cat_id = '.$page['cat'];
     $query.= ';';
-    mysql_query( $query );
+    $result = mysql_query( $query );
+    while ( $row = mysql_fetch_array( $result ) )
+    {
+      $specific_keywords = explode( ',', $row['keywords'] );
+      $common_keywords   = get_keywords( $_POST['keywords_cat'] );
+      // first possiblity : adding the given keywords to all the pictures
+      if ( $_POST['common_keywords'] == 'add' )
+      {
+        $keywords = array_merge( $specific_keywords, $common_keywords );
+        $keywords = array_unique( $keywords );
+      }
+      // second possiblity : removing the given keywords from all pictures
+      // (without deleting the other specific keywords
+      if ( $_POST['common_keywords'] == 'remove' )
+      {
+        $keywords = array_diff( $specific_keywords, $common_keywords );
+      }
+      // cleaning the keywords array, sometimes, an empty value still remain
+      $keywords = array_remove( $keywords, '' );
+      // updating the picture with new keywords array
+      $query = 'UPDATE '.PREFIX_TABLE.'images';
+      $query.= ' SET keywords = ';
+      if ( count( $keywords ) == 0 )
+      {
+        $query.= 'NULL';
+      }
+      else
+      {
+        $query.= '"';
+        $i = 0;
+        foreach ( $keywords as $keyword ) {
+          if ( $i++ > 0 ) $query.= ',';
+          $query.= $keyword;
+        }
+        $query.= '"';
+      }
+      $query.= ' WHERE id = '.$row['id'];
+      $query.= ';';
+      mysql_query( $query );
+    }
   }
 //--------------------------------------------------------- form initialization
@@ -225,5 +251,7 @@
                 'infoimage_creation_date','infoimage_detailed','thumbnail',
                 'infoimage_title','infoimage_comment',
-                'infoimage_creation_date','infoimage_keywords' );
+                'infoimage_creation_date','infoimage_keywords',
+                'infoimage_addtoall','infoimage_removefromall',
+                'infoimage_keyword_separation' );
   templatize_array( $tpl, 'lang', $sub );
 //------------------------------------------------------------------------ form
Index: /trunk/language/francais.php
===================================================================
--- /trunk/language/francais.php	(revision 39)
+++ /trunk/language/francais.php	(revision 40)
@@ -497,4 +497,7 @@
   // $lang['infoimage_err_date'] = 'date erronée';
   $lang['infoimage_keywords'] = 'mots-clefs';
+  $lang['infoimage_keyword_separation'] = '(séparer avec des ",")';
+  $lang['infoimage_addtoall'] = 'ajouter à tous';
+  $lang['infoimage_removefromall'] = 'retirer à tous';
 // end version 1.3
   $lang['infoimage_general'] = 'Options générale pour la catégorie';
Index: /trunk/template/default/admin/infos_image.vtp
===================================================================
--- /trunk/template/default/admin/infos_image.vtp	(revision 39)
+++ /trunk/template/default/admin/infos_image.vtp	(revision 40)
@@ -28,12 +28,14 @@
     <tr>
       <td>
-        <div style="margin-left:50px;">{#infoimage_keywords}</div>
+        <div style="margin-left:50px;">{#infoimage_keywords} {#infoimage_keyword_separation}</div>
       </td>
       <td style="text-align:center;">
-        <input type="text" name="keywords_cat" value="" size="12" maxlength="255" />
+        <input type="text" name="keywords_cat" value="" maxlength="255" />
       </td>
       <td style="text-align:left;">
-        <input type="checkbox" name="use_common_keywords" value="1" />
-        {#infoimage_useforall}
+        <input type="radio" name="common_keywords" value="add" />
+        {#infoimage_addtoall}
+        <input type="radio" name="common_keywords" value="remove" />
+        {#infoimage_removefromall}
       </td>
     </tr>
