Index: extensions/TakeATour/admin.php
===================================================================
--- extensions/TakeATour/admin.php	(revision 27995)
+++ extensions/TakeATour/admin.php	(revision 27998)
@@ -11,9 +11,9 @@
     )
   );
-/*
+
 $template->func_combine_css(array(
-	'path' => 'plugins/TakeATour/template/admin.css',
+	'path' => 'plugins/TakeATour/css/admin.css',
 	)
-);*/
+);
 
 $template->set_filename('plugin_admin_content', dirname(__FILE__) .'/tpl/admin.tpl');
Index: extensions/TakeATour/css/admin.css
===================================================================
--- extensions/TakeATour/css/admin.css	(revision 27998)
+++ extensions/TakeATour/css/admin.css	(revision 27998)
@@ -0,0 +1,11 @@
+#TAT_Content .TAT_description {
+  text-align: justify;
+  text-indent: 1em;
+}
+#TAT_Content form {
+  text-align: center;
+}
+#TAT_Content form input {
+  width: 50%;
+  margin-top: 10px;
+}
Index: extensions/TakeATour/language/en_UK/description.txt
===================================================================
--- extensions/TakeATour/language/en_UK/description.txt	(revision 27995)
+++ extensions/TakeATour/language/en_UK/description.txt	(revision 27998)
@@ -1,1 +1,1 @@
-Apprenez à utiliser votre Piwigo, avec ce plugin qui vous prendra par la main à travers ses 'visites' à thèmes
+Visit your Piwigo to learn how to use it. This plugin has multiple thematic tours for beginners and advanced users.
Index: extensions/TakeATour/main.inc.php
===================================================================
--- extensions/TakeATour/main.inc.php	(revision 27995)
+++ extensions/TakeATour/main.inc.php	(revision 27998)
@@ -18,10 +18,12 @@
 {
   pwg_set_session_var('tour_to_launch', $_POST['submited_tour']);
-  global $TAT_restart;
-  $TAT_restart=true;
+  global $TAT;
+  $TAT['restart']=true;
 }
 elseif ( isset($_GET['tour_ended']) and in_array($_GET['tour_ended'], $avalaible_tour) and defined('IN_ADMIN') and IN_ADMIN )
 {
   pwg_unset_session_var('tour_to_launch');
+  pwg_unset_session_var('TAT_image_id');
+  pwg_unset_session_var('TAT_cat_id');
 }
 
@@ -32,17 +34,69 @@
 function TAT_add_js_css()
 {
-  global $template, $TAT_restart;
+  global $template, $TAT;
   $tour_to_launch=pwg_get_session_var('tour_to_launch');
   load_language('plugin.lang', PHPWG_PLUGINS_PATH .'TakeATour/');
   $template->set_filename('TAT_js_css', PHPWG_PLUGINS_PATH.'TakeATour/tpl/js_css.tpl');
   $template->parse('TAT_js_css');//http://piwigo.org/forum/viewtopic.php?id=23248
-  if (isset($TAT_restart) and $TAT_restart)
-  {
-    $TAT_restart=false;
+  if (isset($TAT['restart']) and $TAT['restart'])
+  {
+    $TAT['restart']=false;
     $template->assign('TAT_restart',true);
   }
   $tat_path=str_replace(basename($_SERVER['SCRIPT_NAME']),'', $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']);
-  //$tat_path=$_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
   $template->assign('TAT_path', $tat_path);
+  //picture id
+  if (isset($_GET['page']) and preg_match('/^photo-(\d+)(?:-(.*))?$/', $_GET['page'], $matches))
+  {
+    $_GET['image_id'] = $matches[1];
+  }
+  check_input_parameter('image_id', $_GET, false, PATTERN_ID);
+  if (isset($_GET['image_id']) and pwg_get_session_var('TAT_image_id')==null)
+  {
+    $template->assign('TAT_image_id', $_GET['image_id']);
+    pwg_set_session_var('TAT_image_id', $_GET['image_id']);
+  }
+  elseif (is_numeric(pwg_get_session_var('TAT_image_id')))
+  {
+    $template->assign('TAT_image_id', pwg_get_session_var('TAT_image_id'));
+  }
+  else
+  {
+    $query = '
+    SELECT id
+      FROM '.IMAGES_TABLE.'
+      ORDER BY RAND()
+      LIMIT 1  
+    ;';
+    $row = pwg_db_fetch_assoc(pwg_query($query));
+    $template->assign('TAT_image_id', $row['id']);
+  }
+  //album id
+  if (isset($_GET['page']) and preg_match('/^album-(\d+)(?:-(.*))?$/', $_GET['page'], $matches))
+  {
+    $_GET['cat_id'] = $matches[1];
+  }
+  check_input_parameter('cat_id', $_GET, false, PATTERN_ID);
+  if (isset($_GET['cat_id']) and pwg_get_session_var('TAT_cat_id')==null)
+  {
+    $template->assign('TAT_cat_id', $_GET['cat_id']);
+    pwg_set_session_var('TAT_cat_id', $_GET['cat_id']);
+  }
+  elseif (is_numeric(pwg_get_session_var('TAT_cat_id')))
+  {
+    $template->assign('TAT_cat_id', pwg_get_session_var('TAT_cat_id'));
+  }
+  else
+  {
+    $query = '
+    SELECT id
+      FROM '.CATEGORIES_TABLE.'
+      ORDER BY RAND()
+      LIMIT 1  
+    ;';
+    $row = pwg_db_fetch_assoc(pwg_query($query));
+    $template->assign('TAT_cat_id', $row['id']);
+  }
+
   $template->set_filename('TAT_tour_tpl', PHPWG_PLUGINS_PATH.'TakeATour/tpl/'.$tour_to_launch.'.tpl');
   $template->parse('TAT_tour_tpl');
@@ -60,45 +114,58 @@
 }
 
-function TAT_FC_14() {
+function TAT_FC_14()
+{
   global $template;
   $template->set_prefilter('batch_manager_global', 'TAT_FC_14_prefilter');
 }
-function TAT_FC_14_prefilter ($content, &$smarty) {
+function TAT_FC_14_prefilter ($content, &$smarty)
+{
   $search = '<span class="wrap2';
   $replacement = '{counter print=false assign=TAT_FC_14}<span {if $TAT_FC_14==1}id="TAT_FC_14"{/if} class="wrap2';
-  return str_replace($search, $replacement, $content);
-}
-function TAT_FC_16() {
+  $content = str_replace($search, $replacement, $content);
+  $search = 'target="_blank">{\'Edit\'';
+  $replacement = '>{\'Edit\'';
+  return str_replace($search, $replacement, $content);
+}
+function TAT_FC_16()
+{
   global $template;
   $template->set_prefilter('picture_modify', 'TAT_FC_16_prefilter');
 }
-function TAT_FC_16_prefilter ($content, &$smarty) {
+function TAT_FC_16_prefilter ($content, &$smarty)
+{
   $search = '<strong>{\'Linked albums\'|@translate}</strong>';
   $replacement = '<span id="TAT_FC_16"><strong>{\'Linked albums\'|@translate}</strong></span>';
   return str_replace($search, $replacement, $content);
 }
-function TAT_FC_17() {
+function TAT_FC_17()
+{
   global $template;
   $template->set_prefilter('picture_modify', 'TAT_FC_17_prefilter');
 }
-function TAT_FC_17_prefilter ($content, &$smarty) {
+function TAT_FC_17_prefilter ($content, &$smarty)
+{
   $search = '<strong>{\'Representation of albums\'|@translate}</strong>';
   $replacement = '<span id="TAT_FC_17"><strong>{\'Representation of albums\'|@translate}</strong></span>';
   return str_replace($search, $replacement, $content);
 }
-function TAT_FC_23() {
+function TAT_FC_23()
+{
   global $template;
   $template->set_prefilter('album_properties', 'TAT_FC_23_prefilter');
 }
-function TAT_FC_23_prefilter ($content, &$smarty) {
+function TAT_FC_23_prefilter ($content, &$smarty)
+{
   $search = '<strong>{\'Lock\'|@translate}</strong>';
   $replacement = '<span id="TAT_FC_23"><strong>{\'Lock\'|@translate}</strong></span>';
   return str_replace($search, $replacement, $content);
 }
-function TAT_FC_35() {
+function TAT_FC_35()
+{
   global $template;
   $template->set_prefilter('themes', 'TAT_FC_35_prefilter');
 }
-function TAT_FC_35_prefilter ($content, &$smarty) {
+function TAT_FC_35_prefilter ($content, &$smarty)
+{
   $search = '<a href="{$set_default_baseurl}{$theme.ID}" class="tiptip"';
   $replacement = '{counter print=false assign=TAT_FC_35}<a href="{$set_default_baseurl}{$theme.ID}" class="tiptip" {if $TAT_FC_35==1}id="TAT_FC_35"{/if}';
Index: extensions/TakeATour/tpl/admin.tpl
===================================================================
--- extensions/TakeATour/tpl/admin.tpl	(revision 27995)
+++ extensions/TakeATour/tpl/admin.tpl	(revision 27998)
@@ -1,11 +1,12 @@
 <div class="titrePage">
-  <h2>{'iconset_configpage'|@translate}</h2>
+  <h2>{'takeatour_configpage'|@translate}</h2>
 </div>
-<div id="themesContent">
+<div id="TAT_Content">
   <fieldset>
     <legend>{'First Contact'|@translate}</legend>
+    <div class="TAT_description">{'Recommended for beginners, this tour introduce you Piwigo, its basic features. It will start by adding pictures, then manage them. The tour continues with album management and permissions, and ends on the customization using the configuration, the themes and the plugins.'|@translate}</div>
     <form action="{$F_ACTION}" method="post">
       <input type="hidden" name="submited_tour" value="first_contact">
-      <input type="submit" name="button2" id="button2" value="{'Launch the Tour'|@translate}" style=" width:100%" />
+      <input type="submit" name="button2" id="button2" value="{'Launch the Tour'|@translate}">
     </form>
   </fieldset>
Index: extensions/TakeATour/tpl/first_contact.tpl
===================================================================
--- extensions/TakeATour/tpl/first_contact.tpl	(revision 27995)
+++ extensions/TakeATour/tpl/first_contact.tpl	(revision 27998)
@@ -12,5 +12,5 @@
     path: "{/literal}{$TAT_path}{literal}admin.php",
     title: "{/literal}{'Welcome in your Piwigo gallery'|@translate}{literal}",
-    content: "{/literal}{'Let\'s start by adding pictures'|@translate}{literal}"
+    content: "{/literal}{'Hello! I will be your guide to discover Piwigo. Please follow my instructions, and click Next (or use the arrows of your keyboard) to navigate. If you go in an other page of the administration, you will be redirected to the current page of the Tour.<br>Let\'s start by adding pictures!'|@translate}{literal}"
   },
   {
@@ -110,9 +110,9 @@
     reflex:true,
     content: "{/literal}{'We will see now the edition page of one picture. That page is reachable from here but also from the public picture page when logged as an administrator. Click on Edit or go next'|@translate}{literal}",
-    onNext:function (tour) {window.location = "admin.php?page=photo-1";}
+    onNext:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";}
   },
   {//15
     path: /admin\.php\?page=photo-/,
-    redirect:function (tour) {window.location = "admin.php?page=photo-1";},
+    redirect:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";},
     placement: "bottom",
     element: ".selected_tab",
@@ -122,5 +122,5 @@
   {
     path: /admin\.php\?page=photo-/,
-    redirect:function (tour) {window.location = "admin.php?page=photo-1";},
+    redirect:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";},
     placement: "top",
     element: "#TAT_FC_16",
@@ -129,5 +129,5 @@
   {
     path: /admin\.php\?page=photo-/,
-    redirect:function (tour) {window.location = "admin.php?page=photo-1";},
+    redirect:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";},
     placement: "top",
     element: "#TAT_FC_17",
@@ -136,5 +136,5 @@
   {
     path: /admin\.php\?page=photo-/,
-    redirect:function (tour) {window.location = "admin.php?page=photo-1";},
+    redirect:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";},
     placement: "top",
     title: "{/literal}{'Manage albums'|@translate}{literal}",
@@ -147,5 +147,5 @@
     title: "{/literal}{'Manage Albums'|@translate}{literal}",
     content: "{/literal}{'Here are listed all the \'top\' albums, the ones at the root of your gallery. If you see an album with a dashed backgroung, it\'s an real physical album from a FTP synchro, which can\'t be moved or deleted from here. The others albums are called virtual albums.'|@translate}{literal}",
-    onPrev: function (tour) {window.location = "admin.php?page=photo-1";},
+    onPrev: function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";},
 
   },
@@ -166,5 +166,5 @@
   {
     path: /admin\.php\?page=album-/,
-    redirect:function (tour) {window.location = "admin.php?page=album-1";},
+    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";},
     placement: "top",
     element: ".selected_tab",
@@ -174,5 +174,5 @@
   {
     path: /admin\.php\?page=album-/,
-    redirect:function (tour) {window.location = "admin.php?page=album-1";},
+    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";},
     placement: "top",
     element: "#TAT_FC_23",
@@ -181,5 +181,5 @@
   {
     path: /admin\.php\?page=album-/,
-    redirect:function (tour) {window.location = "admin.php?page=album-1";},
+    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";},
     placement: "bottom",
     element: ".tabsheet",
@@ -188,5 +188,5 @@
   {//25
     path: /admin\.php\?page=album-[0-9]+-permissions/,
-    redirect:function (tour) {window.location = "admin.php?page=album-1-permissions";},
+    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}-permissions";},
     placement: "left",
     element: "#content",
@@ -195,4 +195,6 @@
   },
   {
+    path: /admin\.php\?page=album-[0-9]+-permissions/,
+    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}-permissions";},
     placement: "top",
     element: "#selectStatus",
@@ -200,4 +202,6 @@
   },
   {
+    path: /admin\.php\?page=album-[0-9]+-permissions/,
+    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}-permissions";},
     placement: "top",
     element: "#selectStatus",
@@ -205,6 +209,7 @@
   },
   {
-    placement: "top",
-    element: "",
+    path: /admin\.php\?page=album-[0-9]+-permissions/,
+    redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}-permissions";},
+    placement: "top",
     title: "{/literal}{'Configuration'|@translate}{literal}",
     content: "{/literal}{'Now we will look at the options available to set Piwigo working your way. Click on Configuration->Options or just hit Next.'|@translate}{literal}"
