Index: /extensions/AdminTools/include/MultiView.class.php
===================================================================
--- /extensions/AdminTools/include/MultiView.class.php	(revision 25654)
+++ /extensions/AdminTools/include/MultiView.class.php	(revision 25655)
@@ -1,4 +1,4 @@
 <?php
-defined('ADMINTOOLS_ID') or die('Hacking attempt!');
+defined('ADMINTOOLS_PATH') or die('Hacking attempt!');
 
 /**
@@ -129,7 +129,7 @@
 
       // view_as
-      if (isset($_GET['view_as']))
-      {
-        $this->data['view_as'] = (int)$_GET['view_as'];
+      if (isset($_GET['ato_view_as']))
+      {
+        $this->data['view_as'] = (int)$_GET['ato_view_as'];
       }
       if ($this->data['view_as'] != $user['id'])
@@ -141,49 +141,49 @@
 
       // theme
-      if (isset($_GET['theme']))
-      {
-        $this->data['theme'] = $_GET['theme'];
+      if (isset($_GET['ato_theme']))
+      {
+        $this->data['theme'] = $_GET['ato_theme'];
       }
       $user['theme'] = $this->data['theme'];
 
       // lang
-      if (isset($_GET['lang']))
-      {
-        $this->data['lang'] = $_GET['lang'];
+      if (isset($_GET['ato_lang']))
+      {
+        $this->data['lang'] = $_GET['ato_lang'];
       }
       $user['language'] = $this->data['lang'];
 
       // show_queries
-      if (isset($_GET['show_queries']))
-      {
-        $this->data['show_queries'] = (bool)$_GET['show_queries'];
+      if (isset($_GET['ato_show_queries']))
+      {
+        $this->data['show_queries'] = (bool)$_GET['ato_show_queries'];
       }
       $conf['show_queries'] = $this->data['show_queries'];
 
       // debug_l10n
-      if (isset($_GET['debug_l10n']))
-      {
-        $this->data['debug_l10n'] = (bool)$_GET['debug_l10n'];
+      if (isset($_GET['ato_debug_l10n']))
+      {
+        $this->data['debug_l10n'] = (bool)$_GET['ato_debug_l10n'];
       }
       $conf['debug_l10n'] = $this->data['debug_l10n'];
 
       // debug_template
-      if (isset($_GET['debug_template']))
-      {
-        $this->data['debug_template'] = (bool)$_GET['debug_template'];
+      if (isset($_GET['ato_debug_template']))
+      {
+        $this->data['debug_template'] = (bool)$_GET['ato_debug_template'];
       }
       $conf['debug_template'] = $this->data['debug_template'];
 
       // template_combine_files
-      if (isset($_GET['template_combine_files']))
-      {
-        $this->data['template_combine_files'] = (bool)$_GET['template_combine_files'];
+      if (isset($_GET['ato_template_combine_files']))
+      {
+        $this->data['template_combine_files'] = (bool)$_GET['ato_template_combine_files'];
       }
       $conf['template_combine_files'] = $this->data['template_combine_files'];
 
       // no_history
-      if (isset($_GET['no_history']))
-      {
-        $this->data['no_history'] = (bool)$_GET['no_history'];
+      if (isset($_GET['ato_no_history']))
+      {
+        $this->data['no_history'] = (bool)$_GET['ato_no_history'];
       }
       if ($this->data['no_history'])
@@ -201,5 +201,5 @@
   public function init()
   {
-    if (isset($_GET['purge_template']))
+    if (isset($_GET['ato_purge_template']))
     {
       global $template;
Index: /extensions/AdminTools/include/events.inc.php
===================================================================
--- /extensions/AdminTools/include/events.inc.php	(revision 25654)
+++ /extensions/AdminTools/include/events.inc.php	(revision 25655)
@@ -2,4 +2,8 @@
 defined('ADMINTOOLS_PATH') or die('Hacking attempt!');
 
+/**
+ * Add main toolbar to current page
+ * @trigger loc_after_page_header
+ */
 function admintools_add_public_controller()
 {
@@ -24,4 +28,11 @@
     );
 
+  if (!is_admin())
+  {
+    load_language('admin.lang');
+  }
+
+  switch_lang_to(get_default_language());
+
   // TODO : param to allow owner modification
   if (script_basename() == 'picture')
@@ -86,5 +97,5 @@
 
     $tpl_vars['QUICK_EDIT'] = array(
-      'file' => $picture['current']['file'],
+      'img' => $picture['current']['derivatives']['square'],
       'name' => $picture['current']['name'],
       'comment' => $picture['current']['comment'],
@@ -118,4 +129,13 @@
         );
     }
+
+    $query = 'SELECT * FROM '.IMAGES_TABLE.' WHERE id = '. $page['category']['representative_picture_id'] .';';
+    $image_infos = pwg_db_fetch_assoc(pwg_query($query));
+
+    $tpl_vars['QUICK_EDIT'] = array(
+      'img' => DerivativeImage::get_one(IMG_SQUARE, $image_infos),
+      'name' => $page['category']['name'],
+      'comment' => $page['category']['comment'],
+      );
   }
 
@@ -134,7 +154,10 @@
   include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
   $themes = new themes();
-  foreach (array_keys($themes->fs_themes) as $theme)
-  {
-    $tpl_vars['THEMES'][$theme] = $theme;
+  foreach (array_keys($themes->db_themes_by_id) as $theme)
+  {
+    if (!empty($theme))
+    {
+      $tpl_vars['THEMES'][$theme] = $theme;
+    }
   }
 
@@ -153,6 +176,11 @@
   $template->set_filename('ato', realpath(ADMINTOOLS_PATH . 'template/public_controller.tpl'));
   $template->parse('ato');
-}
-
+
+  switch_lang_back();
+}
+
+/**
+ * Disable privacy level switchbox
+ */
 function admintools_remove_privacy($content)
 {
@@ -162,4 +190,8 @@
 }
 
+/**
+ * Save picture form
+ * @trigger loc_begin_picture
+ */
 function admintools_save_picture()
 {
@@ -225,2 +257,35 @@
   }
 }
+
+/**
+ * Save category form
+ * @trigger loc_begin_index
+ */
+function admintools_save_category()
+{
+  global $page, $conf;
+  
+  if (@$_POST['action'] == 'quick_edit')
+  {
+    $data = array(
+      'name' => $_POST['name'],
+      );
+
+    if ($conf['allow_html_descriptions'])
+    {
+      $data['comment'] = @$_POST['comment'];
+    }
+    else
+    {
+      $data['comment'] = strip_tags(@$_POST['comment']);
+    }
+
+    single_update(
+      CATEGORIES_TABLE,
+      $data,
+      array('id' => $page['category']['id'])
+      );
+      
+    redirect(duplicate_index_url());
+  }
+}
Index: /extensions/AdminTools/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/AdminTools/language/en_UK/plugin.lang.php	(revision 25654)
+++ /extensions/AdminTools/language/en_UK/plugin.lang.php	(revision 25655)
@@ -1,3 +1,16 @@
 <?php
 
+$lang['Admin panel'] = 'Admin panel';
+$lang['Combine JS&CSS'] = 'Combine JS&CSS';
+$lang['Debug languages'] = 'Debug languages';
+$lang['Debug template'] = 'Debug template';
+$lang['Viewing as <b>%s</b>.'] = 'Viewing as <b>%s</b>.';
+$lang['Properties page'] = 'Properties page';
+$lang['Quick edit'] = 'Quick edit';
+$lang['Revert'] = 'Revert';
+$lang['Save'] = 'Save';
+$lang['Save visit in history'] = 'Save visit in history';
+$lang['Show SQL queries'] = 'Show SQL queries';
+$lang['View as'] = 'View as';
+
 ?>
Index: /extensions/AdminTools/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/AdminTools/language/fr_FR/plugin.lang.php	(revision 25654)
+++ /extensions/AdminTools/language/fr_FR/plugin.lang.php	(revision 25655)
@@ -1,3 +1,16 @@
 <?php
 
+$lang['Admin panel'] = 'Panneau d\'administration';
+$lang['Combine JS&CSS'] = 'Combiner JS&CSS';
+$lang['Debug languages'] = 'Debuguer les langues';
+$lang['Debug template'] = 'Debuguer le template';
+$lang['Viewing as <b>%s</b>.'] = 'Vue simulée de <b>%s</b>.';
+$lang['Properties page'] = 'Page d\'administration';
+$lang['Quick edit'] = 'Édition rapide';
+$lang['Revert'] = 'Annuler';
+$lang['Save'] = 'Sauvegarder';
+$lang['Save visit in history'] = 'Sauvegarder la viste dans l\'historique';
+$lang['Show SQL queries'] = 'Afficher les requêtes SQL';
+$lang['View as'] = 'Voir en tant que';
+
 ?>
Index: /extensions/AdminTools/main.inc.php
===================================================================
--- /extensions/AdminTools/main.inc.php	(revision 25654)
+++ /extensions/AdminTools/main.inc.php	(revision 25655)
@@ -29,5 +29,5 @@
 $MultiView = new MultiView();
 
-// add_event_handler('init', 'admintools_init');
+add_event_handler('init', 'admintools_init');
 
 if (!defined('IN_ADMIN'))
@@ -35,4 +35,5 @@
   add_event_handler('loc_after_page_header', 'admintools_add_public_controller');
   add_event_handler('loc_begin_picture', 'admintools_save_picture');
+  add_event_handler('loc_begin_index', 'admintools_save_category');
 }
 
@@ -44,6 +45,6 @@
 // | Plugin initialization                                                 |
 // +-----------------------------------------------------------------------+
-// function admintools_init()
-// {
+function admintools_init()
+{
   // global $conf;
 
@@ -52,6 +53,6 @@
   // $maintain->autoUpdate(ADMINTOOLS_VERSION, 'install');
 
-  // load_language('plugin.lang', ADMINTOOLS_PATH);
+  load_language('plugin.lang', ADMINTOOLS_PATH);
 
   // $conf['AdminTools'] = unserialize($conf['AdminTools']);
-// }
+}
Index: /extensions/AdminTools/template/public_controller.tpl
===================================================================
--- /extensions/AdminTools/template/public_controller.tpl	(revision 25654)
+++ /extensions/AdminTools/template/public_controller.tpl	(revision 25655)
@@ -64,31 +64,31 @@
     <li class="parent right"><a class="icon-cog-alt" href="#">{'Tools'|translate}</a>
       <ul>
-        <li><label>View as</label>
+        <li><label>{'View as'|translate}</label>
           <select class="switcher" data-type="view_as">
             {html_options options=$ato.USERS selected=$ato.MULTIVIEW.view_as}
           </select>
         </li>
-        <li><label>Theme</label>
+        <li><label>{'Theme'|translate}</label>
           <select class="switcher" data-type="theme">
             {html_options options=$ato.THEMES selected=$ato.MULTIVIEW.theme}
           </select>
         </li>
-        <li><label>Language</label>
+        <li><label>{'Language'|translate}</label>
           <select class="switcher" data-type="lang">
             {html_options options=$ato.LANGS selected=$ato.MULTIVIEW.lang}
           </select>
         </li>
-        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.show_queries}-empty{/if}" href="{$ato.U_SELF}show_queries={(int)!$ato.MULTIVIEW.show_queries}">{'Show SQL queries'|translate}</a></li>
-        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.debug_l10n}-empty{/if}" href="{$ato.U_SELF}debug_l10n={(int)!$ato.MULTIVIEW.debug_l10n}">{'Debug languages'|translate}</a></li>
-        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.debug_template}-empty{/if}" href="{$ato.U_SELF}debug_template={(int)!$ato.MULTIVIEW.debug_template}">{'Debug template'|translate}</a></li>
-        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.template_combine_files}-empty{/if}" href="{$ato.U_SELF}template_combine_files={(int)!$ato.MULTIVIEW.template_combine_files}">{'Combine JS&amp;CSS'|translate}</a></li>
-        <li><a class="icon-ato-check{if $ato.MULTIVIEW.no_history}-empty{/if}" href="{$ato.U_SELF}no_history={(int)!$ato.MULTIVIEW.no_history}">{'Save visit in history'|translate}</a></li>
-        <li><a class="icon-ato-null" href="{$ato.U_SELF}purge_template=1">{'Purge compiled templates'|translate}</a></li>
+        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.show_queries}-empty{/if}" href="{$ato.U_SELF}ato_show_queries={(int)!$ato.MULTIVIEW.show_queries}">{'Show SQL queries'|translate}</a></li>
+        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.debug_l10n}-empty{/if}" href="{$ato.U_SELF}ato_debug_l10n={(int)!$ato.MULTIVIEW.debug_l10n}">{'Debug languages'|translate}</a></li>
+        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.debug_template}-empty{/if}" href="{$ato.U_SELF}ato_debug_template={(int)!$ato.MULTIVIEW.debug_template}">{'Debug template'|translate}</a></li>
+        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.template_combine_files}-empty{/if}" href="{$ato.U_SELF}ato_template_combine_files={(int)!$ato.MULTIVIEW.template_combine_files}">{'Combine JS&CSS'|translate}</a></li>
+        <li><a class="icon-ato-check{if $ato.MULTIVIEW.no_history}-empty{/if}" href="{$ato.U_SELF}ato_no_history={(int)!$ato.MULTIVIEW.no_history}">{'Save visit in history'|translate}</a></li>
+        <li><a class="icon-ato-null" href="{$ato.U_SELF}ato_purge_template=1">{'Purge compiled templates'|translate}</a></li>
       </ul>
     </li>
   {if $ato.USER.id != $ato.MULTIVIEW.view_as}
     <li class="right">
-      &nbsp;&nbsp;{'Logged as <b>%s</b>, viewing as <b>%s</b>.'|translate:$ato.USER.username:$ato.CURRENT_USERNAME}
-      <a href="{$ato.U_SELF}view_as={$ato.USER.id}">{'Revert'|translate}</a>
+      &nbsp;&nbsp;{'Viewing as <b>%s</b>.'|translate:$ato.CURRENT_USERNAME}
+      <a href="{$ato.U_SELF}ato_view_as={$ato.USER.id}">{'Revert'|translate}</a>
     </li>
   {/if}
@@ -101,7 +101,7 @@
     <form method="post" action="{$ato.U_SELF}">
       <fieldset class="left">
-        <img src="{$current.derivatives.square->get_url()}" width="100" height="100">
-        <br><input type="submit" value="{'Save'|translate}">
-        <br><a href="#" class="icon-ato-cancel close-edit">{'Cancel'|translate}</a>
+        <img src="{$ato.QUICK_EDIT.img->get_url()}" width="100" height="100">
+        <input type="submit" value="{'Save'|translate}">
+        <a href="#" class="icon-ato-cancel close-edit">{'Cancel'|translate}</a>
       </fieldset>
 
@@ -110,7 +110,7 @@
         <input type="text" name="name" id="quick_edit_name" value="{$ato.QUICK_EDIT.name|escape:html}">
 
+      {if isset($ato.IS_PICTURE)}
         <label for="quick_edit_author">{'Author'|translate}</label>
         <input type="text" name="author" id="quick_edit_author" value="{$ato.QUICK_EDIT.author|escape:html}">
-
 
         <label for="quick_edit_date_creation">{'Creation date'|translate}</label>
@@ -125,11 +125,12 @@
         </select>
 
-        <label for="quick_edit_comment">{'Description'|translate}</label>
-        <textarea name="comment" id="quick_edit_comment">{$ato.QUICK_EDIT.comment}</textarea>
-
         <label for="quick_edit_level">{'Who can see this photo?'|@translate}</label>
         <select name="level" size="1">
           {html_options options=$available_permission_levels selected=$ato.QUICK_EDIT.level}
         </select>
+      {/if}
+
+        <label for="quick_edit_comment">{'Description'|translate}</label>
+        <textarea name="comment" id="quick_edit_comment">{$ato.QUICK_EDIT.comment}</textarea>
       </fieldset>
 
@@ -142,4 +143,23 @@
 {footer_script require='jquery'}
 (function($){
+  function moveBody(dir, anim) {
+    var operator = dir=='show' ? '+=' : '-=';
+    
+    if (anim) {
+      $('body').animate({ldelim}'margin-top': operator+ato_height});
+      
+      if ($('#the_page').css('position')=='absolute') {
+        $('#the_page').animate({ldelim}'top': operator+ato_height});
+      }
+    }
+    else {
+      $('body').css({ldelim}'margin-top': operator+ato_height});
+      
+      if ($('#the_page').css('position')=='absolute') {
+        $('#the_page').css({ldelim}'top': operator+ato_height});
+      }
+    }
+  }
+  
   var $ato = $('#ato_header'),
       $ato_closed = $('#ato_header_closed'),
@@ -155,5 +175,5 @@
   if (window.localStorage.ato_panel_open == "true") {
     $ato.show();
-    $('body').css({ldelim}'margin-top': '+='+ato_height});
+    moveBody('show', false);
   }
   else {
@@ -184,5 +204,5 @@
   $ato.find('.switcher').on({
     'change': function() {
-      window.location.href = '{$ato.U_SELF}'+ $(this).data('type') +'='+ $(this).val();
+      window.location.href = '{$ato.U_SELF}ato_'+ $(this).data('type') +'='+ $(this).val();
     },
     'click': function(e) {
@@ -195,5 +215,5 @@
     $ato.slideUp();
     $ato_closed.slideDown();
-    $('body').animate({ldelim}'margin-top': '-='+ato_height});
+    moveBody('hide', true);
 
     window.localStorage.ato_panel_open = "false";
@@ -204,5 +224,5 @@
     $ato.slideDown();
     $ato_closed.slideUp();
-    $('body').animate({ldelim}'margin-top': '+='+ato_height});
+    moveBody('show', true);
 
     window.localStorage.ato_panel_open = "true";
@@ -269,5 +289,9 @@
   var $ato_edit = $('#ato_quick_edit');
 
-  $ato_edit.css('background-color', $("#the_page #content").css('background-color'));
+  var bg_color = $('#the_page #content').css('background-color');
+  if (!bg_color || bg_color=='transparent') {
+    bg_color = $('body').css('background-color');
+  }
+  $ato_edit.css('background-color', bg_color);
 
   $ato_edit.find('.close-edit').on('click', function(e) {
@@ -276,4 +300,5 @@
   });
 
+{if isset($ato.IS_PICTURE)}
   $ato_edit.find('.datepicker').datepicker({
     dateFormat: 'yy-mm-dd'
@@ -292,4 +317,5 @@
     }
   );
+{/if}
 
   $(".edit-quick").colorbox({
Index: /extensions/AdminTools/template/style.css
===================================================================
--- /extensions/AdminTools/template/style.css	(revision 25654)
+++ /extensions/AdminTools/template/style.css	(revision 25655)
@@ -95,7 +95,8 @@
     color:#777;
     display:inline-block;
-    width:60px;
-    padding:5px 10px;
+    width:80px;
+    padding:5px;
     text-align:right;
+    font-size:11px;
   }
   #ato_header_root ul select, #ato_header_root ul option {
@@ -144,6 +145,7 @@
     text-align:center;
   }
-    #ato_quick_edit input[type="submit"] {
-      margin:1.5em 0;
+    #ato_quick_edit fieldset.left img {
+      border-radius:2px;
+      border:1px solid #111;
     }
   #ato_quick_edit fieldset.main {
@@ -165,4 +167,14 @@
       height:110px;
     }
+    #ato_quick_edit input[type="submit"] {
+      margin:1.5em 0;
+      cursor:pointer;
+      background:#e60;
+      border:none;
+      color:#fff;
+    }
+      #ato_quick_edit input[type="submit"]:hover {
+        background:#EF962F;
+      }
     #ato_quick_edit ul.token-input-list {
       width:100%;
