Index: /extensions/akBookStyle/trunk/TODO
===================================================================
--- /extensions/akBookStyle/trunk/TODO	(revision 3791)
+++ /extensions/akBookStyle/trunk/TODO	(revision 3791)
@@ -0,0 +1,1 @@
+* thumbnail and medium picture can have a different extension. gif for thumbnail and jpg for medium.
Index: /extensions/akBookStyle/trunk/admin.php
===================================================================
--- /extensions/akBookStyle/trunk/admin.php	(revision 3790)
+++ /extensions/akBookStyle/trunk/admin.php	(revision 3791)
@@ -25,5 +25,24 @@
 }
 
+load_language('plugin.lang', AK_PLUGIN_LANG);
+
+$me = get_plugin_data($plugin_id);
+$save_config = false;
+
+if (!empty($_POST['submit'])) {
+  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']);
+    $save_config = true;
+  }
+
+  if ($save_config) {
+    $me->save_config();
+  }
+}
+
 $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_BY_LINE', $me->ak_by_line); 
 $GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
 ?>
Index: tensions/akBookStyle/trunk/ak_loader.php
===================================================================
--- /extensions/akBookStyle/trunk/ak_loader.php	(revision 3790)
+++ 	(revision )
@@ -1,82 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | akBookStyle  - a plugin for Piwigo                                    |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2009      Nicolas Roudaire        http://www.nikrou.net  |
-// | Copyright(C) 2009      vdigital                                       |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-if (!defined('AK_PLUGIN_ROOT')) {
-  die('Hacking attempt!');
-}
-// This part of code is intended to be included in the akBookStyle plugin
-// But the reload parameter might be coded in any jQuery load statement of any existing .tpl
-// So the associated .tpl to picture_reload will be parsed and reloaded in the reload div of the page.
-
-// By default the associated template is ak_reloaded_image.tpl
-
-// Logic:
-// basename should be picture.php
-// if $_GET['reload'] is NOT set return to normal picture.php process
-// else
-// parse the picture_reload template
-// end
-
-if ( !isset($_GET['reload']) or !isset($page['image_id']) ) {
-  return;
-}
-define('PHPWG_ROOT_PATH','../../');
-define('IN_ADMIN', false);
-include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
-load_language('plugin.lang', WHOIS_ONLINE_PATH);
-include(PHPWG_ROOT_PATH.'include/section_init.inc.php');
-include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
-
-$ak_ids = pwg_get_session_var('image_ids', array());
-/* Fill in correctly */
-  $query = '
-SELECT img.*
-  FROM '.IMAGES_TABLE.' AS img INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id=image_id
-  WHERE id='.$page['image_id']
-        . get_sql_condition_FandF(
-            array('forbidden_categories' => 'category_id'),
-            " AND"
-          ).'
-  LIMIT 1';
-$picture['current'] = mysql_fetch_array(pwg_query($query));
-if ($picture['current']['level']>$user['level'])
-{
-  access_denied();
-}
-
-/* On going */
-$AK_PIC_SRC = get_image_path( $picture['current'] );
-$AK_PIC_ALT = "Alt de l'image";
-$AK_PIC_TITLE = "Titre de l'image";
-$AK_PREVIOUS['U_PIC'] = "www.previous.com";
-$AK_PREVIOUS['TITLE'] = "Titre de Previous";
-$AK_PREVIOUS['load'] = 'load';
-
-$AK_NEXT['U_PIC'] = "www.next.com";
-$AK_NEXT['TITLE'] = "Titre de Next";
-$AK_NEXT['load'] = 'load';
-$template->set_filenames( array('picture_reload' => dirname(__FILE__) . '/ak_reloaded_image.tpl'));
-$template->assign( 'AK_PIC_SRC', $AK_PIC_SRC );
-$template->pparse('picture_reload');
-exit(255);
-
-?>
Index: /extensions/akBookStyle/trunk/css/ak_admin_style.css
===================================================================
--- /extensions/akBookStyle/trunk/css/ak_admin_style.css	(revision 3791)
+++ /extensions/akBookStyle/trunk/css/ak_admin_style.css	(revision 3791)
@@ -0,0 +1,8 @@
+#content { 
+  text-align: left;
+  padding-left: 20px;
+}
+
+fieldset p { 
+  text-align: left;
+}
Index: /extensions/akBookStyle/trunk/css/ak_style.css
===================================================================
--- /extensions/akBookStyle/trunk/css/ak_style.css	(revision 3790)
+++ /extensions/akBookStyle/trunk/css/ak_style.css	(revision 3791)
@@ -2,38 +2,42 @@
 }
 
+table.ak_display tr td { 
+  vertical-align: top;
+}
+
 td table.thumbnails {
-	margin-right:20%;
+  margin-right:20%;
 }
 
 tr.nline {
-	max-height:90px;
-	overflow:hidden;
+  max-height:90px;
+  overflow:hidden;
 }
 
 td.ncol {
-	max-height:90px;
-	max-width:90px;
-	overflow:hidden;
-	text-align:center;
-	padding:2px 8px;
+  max-height:90px;
+  max-width:90px;
+  overflow:hidden;
+  text-align:center;
+  padding:2px 8px;
 }
 
 td.ak_pic {
-	min-width:640px;
-	text-align:center;
+  min-width:640px;
+  text-align:center;
 }
 
 a.load {
-	height:90px;
-	width:90px;
+  height:90px;
+  width:90px;
 }
 
 a.load img {
-	height:90px;
-	overflow:hidden;
+  height:90px;
+  overflow:hidden;
 }
 
 td.left {
-	text-align:left;
+  text-align:left;
 }
 
Index: /extensions/akBookStyle/trunk/default_values.inc.php
===================================================================
--- /extensions/akBookStyle/trunk/default_values.inc.php	(revision 3791)
+++ /extensions/akBookStyle/trunk/default_values.inc.php	(revision 3791)
@@ -0,0 +1,28 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | akBookStyle  - a plugin for Piwigo                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2009      Nicolas Roudaire        http://www.nikrou.net  |
+// | Copyright(C) 2009      vdigital                                       |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH')) {
+  die('Hacking attempt!');
+}
+
+$default_values['ak_by_line'] = 2;
+?>
Index: /extensions/akBookStyle/trunk/include/akConfig.class.php
===================================================================
--- /extensions/akBookStyle/trunk/include/akConfig.class.php	(revision 3790)
+++ /extensions/akBookStyle/trunk/include/akConfig.class.php	(revision 3791)
@@ -46,4 +46,6 @@
       $this->config = $c;
     }
+
+    $this->setDefaults();
   }
 
@@ -77,4 +79,14 @@
     return $menu;
   }
+
+  private function setDefaults() {
+    include_once $this->plugin_dir.'/default_values.inc.php';
+
+    foreach ($default_values as $key => $value) {
+      if (empty($this->config[$key])) {
+	$this->config[$key] = $value;
+      }
+    }
+  }
 }
 ?>
Index: /extensions/akBookStyle/trunk/include/akContent.class.php
===================================================================
--- /extensions/akBookStyle/trunk/include/akContent.class.php	(revision 3790)
+++ /extensions/akBookStyle/trunk/include/akContent.class.php	(revision 3791)
@@ -45,9 +45,12 @@
 
     $template->set_filenames(array('index_thumbnails'=> AK_PLUGIN_TEMPLATE . '/ak_thumbnails.tpl'));
-    $template->assign('AK_PIC_SRC', get_image_url($images[$this->current_picture]));
-    $template->assign('AK_BY_LINE', 3);
-    $template->assign('AK_RELOADED_IMAGE_TPL', AK_PLUGIN_TEMPLATE. '/ak_reloaded_image.tpl');
     $template->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS);
     $template->assign('AK_PLUGIN_JS', AK_PLUGIN_JS);
+
+    $template->assign('AK_DIR_THUMBNAIL', $GLOBALS['conf']['dir_thumbnail']);
+    $template->assign('AK_PREFIX_THUMBNAIL', $GLOBALS['conf']['prefix_thumbnail']);
+    $template->assign('AK_PIC_SRC', get_image_url($images[$this->current_picture]));
+    $template->assign('AK_BY_LINE', $this->plugin_config->ak_by_line);
+    $template->assign('AK_RELOADED_IMAGE_TPL', AK_PLUGIN_TEMPLATE. '/ak_reloaded_image.tpl');
   }
 
Index: /extensions/akBookStyle/trunk/js/ak_jquery-load.js
===================================================================
--- /extensions/akBookStyle/trunk/js/ak_jquery-load.js	(revision 3790)
+++ /extensions/akBookStyle/trunk/js/ak_jquery-load.js	(revision 3791)
@@ -2,5 +2,5 @@
     $("a.load")
       .click(function() {
-  	  $('#akPicture').attr('src', $(this).children('img').attr('src').replace('thumbnail\/TN-', ''));
+  	  $('#akPicture').attr('src', $(this).children('img').attr('src').replace(dir_thumbnail+'\/'+prefix_thumbnail, ''));
 	  return false;
 	});
Index: /extensions/akBookStyle/trunk/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/akBookStyle/trunk/language/en_UK/plugin.lang.php	(revision 3790)
+++ /extensions/akBookStyle/trunk/language/en_UK/plugin.lang.php	(revision 3791)
@@ -1,5 +1,10 @@
 <?php
+/** admin **/
 $lang['ak_title'] = "ak Book Style";
 $lang['ak_intro'] = "That plugin give an alternate presentation for galleries. It gives you in a whole page access to medium image and thumbnails.";
 $lang['ak_info'] = "";
+
+$lang['ak_general_config'] = "Main configuration";
+$lang['ak_by_line'] = "Number of column";
+$lang['ak_by_line_changed'] = "Number of column has been updated";
 ?>
Index: /extensions/akBookStyle/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/akBookStyle/trunk/language/fr_FR/plugin.lang.php	(revision 3790)
+++ /extensions/akBookStyle/trunk/language/fr_FR/plugin.lang.php	(revision 3791)
@@ -1,5 +1,11 @@
 <?php
+/** admin **/
 $lang['ak_title'] = "ak Book Style";
 $lang['ak_intro'] = "Ce plugin permet de gérer une présentation alternative de votre galerie avec les miniatures sur la même page qu'une photo medium.";
 $lang['ak_info'] = "";
+
+$lang['ak_general_config'] = "Configuration générale";
+$lang['ak_by_line'] = "Nombre de colonnes";
+$lang['ak_by_line_changed'] = "Le nombre de colonne a été mis à jour";
+
 ?>
Index: /extensions/akBookStyle/trunk/template/admin.tpl
===================================================================
--- /extensions/akBookStyle/trunk/template/admin.tpl	(revision 3790)
+++ /extensions/akBookStyle/trunk/template/admin.tpl	(revision 3791)
@@ -11,2 +11,18 @@
 </p>
 
+<form method="post" action="" class="general">
+<fieldset>
+  <legend>{'ak_general_config'|@translate}</legend>
+  <p class="field">
+    <label>{'ak_by_line'|@translate}
+      <input type="text" name="ak_by_line" value="{$AK_BY_LINE}">
+    </label>
+  </p>
+</fieldset>
+
+<p><input class="submit" type="submit" name="submit" value="{'Submit'|@translate}"></p>
+</form>
+
+{html_head} 
+<link rel="stylesheet" type="text/css" href="{$AK_PLUGIN_CSS}/ak_admin_style.css">
+{/html_head}
Index: /extensions/akBookStyle/trunk/template/ak_reloaded_image.tpl
===================================================================
--- /extensions/akBookStyle/trunk/template/ak_reloaded_image.tpl	(revision 3790)
+++ /extensions/akBookStyle/trunk/template/ak_reloaded_image.tpl	(revision 3791)
@@ -1,3 +1,3 @@
-{if !empty($AK_PIC_SRC) or true}
+{if !empty($AK_PIC_SRC) }
 <div id="reload">
   <table class="picture">
@@ -37,20 +37,2 @@
 </div>
 {/if}
-
-
-{known_script id="jquery" src=$ROOT_URL|cat:"template-common/lib/jquery.packed.js"}
-{html_head} 
-<link rel="stylesheet" type="text/css" href="{$AK_PLUGIN_CSS}/ak_style.css">
-{literal} 
-<script type="text/javascript">// <![CDATA[ 
-$(document).ready(function() {
-  $("a.load") 
-  .click(function() { 
-  $("#reload").load("./plugins/ak_loader.php?"+this.href); 
-    return false; 
-  }); 
-}); 
- // ]]> 
-</script> 
-{/literal} 
-{/html_head}
Index: /extensions/akBookStyle/trunk/template/ak_thumbnails.tpl
===================================================================
--- /extensions/akBookStyle/trunk/template/ak_thumbnails.tpl	(revision 3790)
+++ /extensions/akBookStyle/trunk/template/ak_thumbnails.tpl	(revision 3791)
@@ -29,5 +29,4 @@
   <tr>
     <td>
-
       <table class="thumbnails">
         {foreach from=$thumbnails item=thumbnail name=tn}
@@ -36,5 +35,5 @@
           {/if}
           <td class="ncol">
-            <a href="{$thumbnail.URL}" class="load">
+            <a href="{$thumbnail.AK_URL}" class="load">
               <img class="thumbnail" src="{$thumbnail.TN_SRC}" 
              alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}">
@@ -72,5 +71,5 @@
     </td>
     
-    <td> <!-- Picture -->
+    <td> {* Picture *}
       {include file=$AK_RELOADED_IMAGE_TPL|@get_extent:'picture_reload'} 
     </td>
@@ -78,7 +77,11 @@
 </table>
 {/if}
+
 {known_script id="jquery" src=$ROOT_URL|cat:"template-common/lib/jquery.packed.js"}
 {html_head} 
 <link rel="stylesheet" type="text/css" href="{$AK_PLUGIN_CSS}/ak_style.css">
+<script type="text/javascript">
+var dir_thumbnail = '{$AK_DIR_THUMBNAIL}';prefix_thumbnail = '{$AK_PREFIX_THUMBNAIL}';
+</script>
 <script type="text/javascript" src="{$AK_PLUGIN_JS}/ak_jquery-load.js"></script>
 {/html_head}
