Index: extensions/akBookStyle/trunk/admin.php
===================================================================
--- extensions/akBookStyle/trunk/admin.php	(revision 3843)
+++ extensions/akBookStyle/trunk/admin.php	(revision 5432)
@@ -3,5 +3,5 @@
 // | akBookStyle  - a plugin for Piwigo                                    |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2009      Nicolas Roudaire        http://www.nikrou.net  |
+// | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
 // | Copyright(C) 2009      vdigital                                       |
 // +-----------------------------------------------------------------------+
@@ -25,9 +25,10 @@
 }
 
-$ThumbnailsLocations = array('top','left','bottom','right');
-$MouseEvents = array('click' => 'ak_event_click',
-		     'mouseover' => 'ak_event_mouseover');
-
-load_language('plugin.lang', AK_PLUGIN_LANG);
+$ThumbnailsLocations = array('top' => 'Top',
+                             'left' => 'Left',
+                             'bottom' => 'Bottom',
+                             'right' => 'Right');
+$MouseEvents = array('click' => 'Click',
+		     'mouseover' => 'Mouseover');
 
 $me = get_plugin_data($plugin_id);
@@ -37,6 +38,8 @@
   if (!empty($_POST['ak_categories']) && $_POST['ak_categories']!=$me->ak_categories) {
     $me->ak_categories = $_POST['ak_categories'];
-    if ( $_POST['ak_categories'] == '') $me->ak_categories = '<!--Book-->';
-    array_push($GLOBALS['page']['infos'], $lang['ak_categories_changed']);
+    array_push($GLOBALS['page']['infos'],
+               l10n_dec('Applicable category has been updated',
+                        'Applicable categories have been updated',
+                        count($_POST['ak_categories'])));
     $save_config = true;
   }
@@ -44,5 +47,5 @@
   if (!empty($_POST['ak_by_page']) && intval($_POST['ak_by_page'])!=$me->ak_by_page) {
     $me->ak_by_page = intval($_POST['ak_by_page']);
-    array_push($GLOBALS['page']['infos'], $lang['ak_by_page_changed']);
+    array_push($GLOBALS['page']['infos'], l10n('Thumbnails per page has been updated'));
     $save_config = true;
   }
@@ -50,5 +53,5 @@
   if (!empty($_POST['ak_by_line']) && intval($_POST['ak_by_line'])!=$me->ak_by_line) {
     $me->ak_by_line = intval($_POST['ak_by_line']);
-    array_push($GLOBALS['page']['infos'], $lang['ak_by_line_changed']);
+    array_push($GLOBALS['page']['infos'], l10n('Number of column has been updated'));
     $save_config = true;
   }
@@ -56,17 +59,24 @@
   if (!empty($_POST['ak_thumbnail_size']) && $_POST['ak_thumbnail_size']!=$me->ak_thumbnail_size) {
     $me->ak_thumbnail_size = (int) $_POST['ak_thumbnail_size'];
-    array_push($GLOBALS['page']['infos'], $lang['ak_thumbnail_size_changed']);
+    array_push($GLOBALS['page']['infos'], l10n('Thumbnail size has been updated'));
     $save_config = true;
   }
 
   if (!empty($_POST['ak_mouse_event']) && $_POST['ak_mouse_event']!=$me->ak_mouse_event) {
-    $me->ak_mouse_event = isset($MouseEvents[$_POST['ak_mouse_event']])?$_POST['ak_mouse_event']:'click';
-    array_push($GLOBALS['page']['infos'], $lang['ak_mouse_event_changed']);
+    if (isset($MouseEvents[$_POST['ak_mouse_event']])) {
+      $me->ak_mouse_event = $_POST['ak_mouse_event'];
+    } else {
+      $me->ak_mouse_event = 'click';
+    }
+    array_push($GLOBALS['page']['infos'], l10n('Event to show medium picture has been updated.'));
     $save_config = true;
   }
 
   if (!empty($_POST['ak_thumbnails_loc']) && $_POST['ak_thumbnails_loc']!=$me->ak_thumbnails_loc) {
-    $me->ak_thumbnails_loc = in_array($_POST['ak_thumbnails_loc'],$ThumbnailsLocations)?$_POST['ak_thumbnails_loc']:'left';
-    array_push($GLOBALS['page']['infos'], $lang['ak_thumbnails_loc_changed']);
+    if (isset($ThumbnailsLocations[$_POST['ak_thumbnails_loc']])) {
+      $me->ak_thumbnails_loc = $_POST['ak_thumbnails_loc'];
+    } else {
+      $me->ak_thumbnails_loc = 'left';    }
+    array_push($GLOBALS['page']['infos'], l10n('Thumbnails location has been changed'));
     $save_config = true;
   }
@@ -76,6 +86,14 @@
   }
 }
+
+$query = '
+SELECT id,name
+  FROM '.CATEGORIES_TABLE;
+
+$all_categories = simple_hash_from_query($query, 'id', 'name');
+
 $GLOBALS['template']->set_filenames(array('plugin_admin_content' => AK_PLUGIN_TEMPLATE . '/admin.tpl'));
-$GLOBALS['template']->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS); 
+$GLOBALS['template']->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS);
+$GLOBALS['template']->assign('ALL_CATEGORIES', $all_categories); 
 $GLOBALS['template']->assign('AK_CATEGORIES', $me->ak_categories); 
 $GLOBALS['template']->assign('AK_BY_PAGE', $me->ak_by_page); 
@@ -86,5 +104,6 @@
 $GLOBALS['template']->assign('AK_EVENTS_LABELS', array_values($MouseEvents)); 
 $GLOBALS['template']->assign('AK_THUMBNAILS_LOC', $me->ak_thumbnails_loc); 
-$GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS', $ThumbnailsLocations); 
+$GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS_KEYS', array_keys($ThumbnailsLocations)); 
+$GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS_VALUES', array_values($ThumbnailsLocations)); 
 $GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
 ?>
