Index: extensions/AMenuManager/admin/amm_admin.tpl
===================================================================
--- extensions/AMenuManager/admin/amm_admin.tpl	(revision 5277)
+++ extensions/AMenuManager/admin/amm_admin.tpl	(revision 5421)
@@ -1,11 +1,9 @@
-<div class="titrePage">
-  <h2 style="position:absolute;right:0px;top:32px;height:auto;font-size:12px;font-weight:normal;">:: {$plugin.AMM_VERSION} ::</h2>
-  <h2>{'g002_title_page'|@translate} <span style="font-size:-1;font-weight:normal;">{$TABSHEET_TITLE}</span></h2>
+<h2 style="float:right;top:-24px;position:relative;height:auto;font-size:12px;font-weight:normal;">{$plugin.AMM_VERSION}</h2>
 
+<div style="position:relative;top:-24px;clear:right;">
+  {if isset($page_nfo)}
+  <p>{$page_nfo}</p>
+  {/if}
 </div>
-
-{if isset($page_nfo)}
-<p>{$page_nfo}</p>
-{/if}
 
 {$AMM_BODY_PAGE}
Index: extensions/AMenuManager/admin/amm_personalisedlist_edit.tpl
===================================================================
--- extensions/AMenuManager/admin/amm_personalisedlist_edit.tpl	(revision 5277)
+++ extensions/AMenuManager/admin/amm_personalisedlist_edit.tpl	(revision 5421)
@@ -1,4 +1,2 @@
-{* $Id $ *}
-
 {include file='include/autosize.inc.tpl'}
 
@@ -81,5 +79,5 @@
         <td>{'g002_setting_personalised_nfo'|@translate}</td>
         <td>
-          <input type="text" name="famm_personalised_nfo" id="iamm_personalised_nfo" value="{$datas.nfo}" maxlength="25"/>
+          <input type="text" name="famm_personalised_nfo" id="iamm_personalised_nfo" value="{$datas.nfo}" maxlength="255"/>
         </td>
       </tr>
@@ -119,5 +117,5 @@
         <td>{'g002_setting_block_title'|@translate}</td>
         <td>
-          <input type="text" id="iamm_personalised_title" value="" maxlength="50" onkeyup="apply_changes('iamm_personalised_title');" onblur="apply_changes('iamm_personalised_title');"/>
+          <input type="text" id="iamm_personalised_title" value="" maxlength="255" onkeyup="apply_changes('iamm_personalised_title');" onblur="apply_changes('iamm_personalised_title');"/>
         </td>
       </tr>
Index: extensions/AMenuManager/admin/amm_randompicconfig.tpl
===================================================================
--- extensions/AMenuManager/admin/amm_randompicconfig.tpl	(revision 5277)
+++ extensions/AMenuManager/admin/amm_randompicconfig.tpl	(revision 5421)
@@ -1,4 +1,4 @@
-{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
-{known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.slider.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
+{known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.slider.packed.js"}
 
 {literal}
@@ -8,5 +8,6 @@
     height:10px;
     border:1px solid;
-    margin-left:10px;
+    margin-right:5px;
+    padding-right:14px;
   }
  .ui-slider-handle {
@@ -16,5 +17,5 @@
     top:-2px;
     border:1px solid;
-    background:#cccccc;
+    display:block;
   }
 </style>
Index: extensions/AMenuManager/admin/amm_sections.tpl
===================================================================
--- extensions/AMenuManager/admin/amm_sections.tpl	(revision 5277)
+++ extensions/AMenuManager/admin/amm_sections.tpl	(revision 5421)
@@ -1,4 +1,4 @@
-{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
-{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.sortable.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
+{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js"}
 
 <div id="containerMenu">
Index: extensions/AMenuManager/amm_aip.class.inc.php
===================================================================
--- extensions/AMenuManager/amm_aip.class.inc.php	(revision 5277)
+++ extensions/AMenuManager/amm_aip.class.inc.php	(revision 5421)
@@ -28,5 +28,5 @@
   protected $tabsheet;
   protected $ajax;
-  protected $sectionsId=array('menu' => 'title_menu', 'special' => 'special_categories');
+  protected $sectionsId=array('menu' => 'Menu', 'special' => 'Specials');
 
   protected $urls_modes=array(0 => 'new_window', 1 => 'current_window');
@@ -524,4 +524,6 @@
     }
 
+    $this->sortSectionsItems();
+
     $users=new users("");
     $groups=new groups("");
Index: extensions/AMenuManager/amm_install.class.inc.php
===================================================================
--- extensions/AMenuManager/amm_install.class.inc.php	(revision 5277)
+++ extensions/AMenuManager/amm_install.class.inc.php	(revision 5421)
@@ -4,5 +4,5 @@
   Author     : Grum
     email    : grum@grum.dnsalias.com
-    website  : http://photos.grum.dnsalias.com
+    website  : http://photos.grum.fr
     PWG user : http://forum.phpwebgallery.net/profile.php?id=3706
 
@@ -14,5 +14,6 @@
 
   --------------------------------------------------------------------------- */
-  @include_once('amm_root.class.inc.php');
+  include_once('amm_version.inc.php');
+  include_once('amm_root.class.inc.php');
   include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
 
@@ -36,4 +37,8 @@
     public function install()
     {
+      $this->init_config();
+      $this->load_config();
+      $this->my_config['installed']=AMM_VERSION2;
+      $this->save_config();
 
       $tables_def=array(
@@ -53,8 +58,8 @@
   `id` int(11) NOT NULL default '0',
   `lang` varchar(5) NOT NULL default '',
-  `title` varchar(50) NOT NULL default '',
+  `title` varchar(255) NOT NULL default '',
   `content` text NOT NULL,
   `visible` char(1) NOT NULL default 'y',
-  `nfo` varchar(25) NOT NULL default '',
+  `nfo` varchar(255) NOT NULL default '',
   PRIMARY KEY  (`id`,`lang`)
 )"
@@ -83,4 +88,22 @@
       $this->init_config();
       $this->load_config();
+
+      $this->udpateTablesDef();
+
+      $this->my_config['installed']=AMM_VERSION2; //update the installed release number
+      $this->save_config();
+    }
+
+    public function deactivate()
+    {
+    }
+
+
+    /**
+     * update tables & config between releases
+     *
+     */
+    protected function udpateTablesDef()
+    {
       /* AMM release earlier than the 2.1.3 uses two parameters to manage the display
        * of the menu items ("amm_sections_modspecials" and "amm_sections_modmenu")
@@ -108,9 +131,31 @@
       }
 
-      $this->save_config();
-    }
+      if(!array_key_exists('installed', $this->my_config))
+      {
+        /*
+         * if key does not exist, probably try to update a plugin older than the
+         * 2.2.0 release
+         */
+        $this->my_config['installed']="02.01.06";
+      }
 
-    public function deactivate()
-    {
+      if($this->my_config['installed']<="02.01.06")
+      {
+        /*
+         * 2.2.0 updates
+         *
+         * - update fields length for table 'personalised'
+         * - update config for menu translation
+         */
+        $sql="ALTER TABLE `".$this->tables['personalised']."`
+              MODIFY COLUMN `title` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+              MODIFY COLUMN `nfo` VARCHAR(255)  CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;";
+        pwg_query($sql);
+
+        foreach($this->my_config['amm_sections_items'] as $key => $val)
+        {
+          $this->my_config['amm_sections_items'][$key]['translation'] = $this->defaultMenus[$key]['translation'];
+        }
+      }
     }
 
Index: extensions/AMenuManager/amm_pip.class.inc.php
===================================================================
--- extensions/AMenuManager/amm_pip.class.inc.php	(revision 5277)
+++ extensions/AMenuManager/amm_pip.class.inc.php	(revision 5421)
@@ -305,4 +305,16 @@
     global $user, $template, $page;
 
+    if(!array_key_exists('body_id', $page))
+    {
+      /*
+       * it seems the error message reported on mantis:1476 is displayed because
+       * the 'body_id' doesn't exist in the $page
+       *
+       * not abble to reproduce the error, but initializing the key to an empty
+       * value if it doesn't exist may be a sufficient solution
+       */
+      $page['body_id']="";
+    }
+
     if($this->displayRandomImageBlock && $page['body_id'] == 'theCategoryPage')
     {
Index: extensions/AMenuManager/amm_root.class.inc.php
===================================================================
--- extensions/AMenuManager/amm_root.class.inc.php	(revision 5277)
+++ extensions/AMenuManager/amm_root.class.inc.php	(revision 5421)
@@ -26,15 +26,15 @@
   protected $css;   //the css object
   protected $defaultMenus = array(
-    'favorites' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 0, 'translation' => 'favorite_cat'),
-    'most_visited' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 1, 'translation' => 'most_visited_cat'),
-    'best_rated' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 2, 'translation' => 'best_rated_cat'),
-    'random' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 3, 'translation' => 'random_cat'),
-    'recent_pics' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 4, 'translation' => 'recent_pics_cat'),
-    'recent_cats' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 5, 'translation' => 'recent_cats_cat'),
-    'calendar' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 6, 'translation' => 'calendar'),
-    'qsearch' => array('container' => 'menu', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 0, 'translation' => 'qsearch'),
+    'favorites' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 0, 'translation' => 'My favorites'),
+    'most_visited' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 1, 'translation' => 'Most visited'),
+    'best_rated' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 2, 'translation' => 'Best rated'),
+    'random' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 3, 'translation' => 'Random pictures'),
+    'recent_pics' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 4, 'translation' => 'Recent pictures'),
+    'recent_cats' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 5, 'translation' => 'Recent categories'),
+    'calendar' => array('container' => 'special', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 6, 'translation' => 'Calendar'),
+    'qsearch' => array('container' => 'menu', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 0, 'translation' => 'Quick search'),
     'tags' => array('container' => 'menu', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 1, 'translation' => 'Tags'),
     'search' => array('container' => 'menu', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 2, 'translation' => 'Search'),
-    'comments' => array('container' => 'menu', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 3, 'translation' => 'comments'),
+    'comments' => array('container' => 'menu', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 3, 'translation' => 'Comments'),
     'about' => array('container' => 'menu', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 4, 'translation' => 'About'),
     'rss' => array('container' => 'menu', 'visibility' => 'guest,generic,normal,webmaster,admin/', 'order' => 5, 'translation' => 'Notification')
Index: extensions/AMenuManager/amm_version.inc.php
===================================================================
--- extensions/AMenuManager/amm_version.inc.php	(revision 5421)
+++ extensions/AMenuManager/amm_version.inc.php	(revision 5421)
@@ -0,0 +1,19 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : Advanced Menu Manager
+  Author     : Grum
+    email    : grum@grum.fr
+    website  : http://photos.grum.fr
+    PWG user : http://forum.piwigo.org/profile.php?id=3706
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  --------------------------------------------------------------------------- */
+
+  if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+  define('AMM_VERSION',  '2.2.0');
+  define('AMM_VERSION2', '02.02.00');
+?>
Index: extensions/AMenuManager/main.inc.php
===================================================================
--- extensions/AMenuManager/main.inc.php	(revision 5277)
+++ extensions/AMenuManager/main.inc.php	(revision 5421)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Advanced Menu Manager
-Version: 2.1.6
+Version: 2.2.0
 Description: Gestion avancée du menu / Advanced management of menu
 Plugin URI: http://piwigo.org
@@ -75,4 +75,16 @@
 |         |            |   Error message about an undefined var 'tabsheet' on
 |         |            |   the admin panel
+| 2.2.0   | 2010/03/28 | * updated for Piwigo 2.1 compatibility
+|         |            | * mantis: feature 1384
+|         |            |   Problem of length of title field in the custom menu
+|         |            |   module
+|         |            | * mantis: bug 1476
+|         |            |   Error message on login screen
+|         |            | * mantis: bug 1541
+|         |            |   Items order is not respected in admin pages
+|         |            |
+|         |            |
+|         |            |
+|         |            |
 |         |            |
 |         |            |
@@ -105,5 +117,5 @@
 define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/');
 
-define('AMM_VERSION' , '2.1.6'); //=> ne pas oublier la version dans l'entête !!
+include_once('amm_version.inc.php'); // => Don't forget to update this file !!
 
 global $prefixeTable, $page;
