Index: /extensions/TakeATour/admin.php
===================================================================
--- /extensions/TakeATour/admin.php	(revision 28099)
+++ /extensions/TakeATour/admin.php	(revision 28100)
@@ -9,4 +9,5 @@
   array(
     'F_ACTION' => get_root_url().'admin.php',
+    'pwg_token' => get_pwg_token()
     )
   );
Index: /extensions/TakeATour/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/TakeATour/language/en_UK/plugin.lang.php	(revision 28099)
+++ /extensions/TakeATour/language/en_UK/plugin.lang.php	(revision 28100)
@@ -2,12 +2,23 @@
 $lang['First Contact'] = 'First Contact';
 $lang['Start the Tour'] = 'Start the Tour';
+$lang['Visit your Piwigo!'] = 'Visit your Piwigo!';
+$lang['Take a tour and discover the features of your Piwigo gallery » Go to the available tours'] = 'Take a tour and discover the features of your Piwigo gallery » Go to the available tours';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
 
 $lang['first_contact_descrp'] = '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.';
 $lang['first_contact_title1'] = 'Welcome in your Piwigo gallery';
-$lang['first_contact_stp1'] = '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!';
+$lang['first_contact_stp1'] = '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. If you are stuck and can\'t end the tour, going to <em>Plugins » Take A Tour</em> will end the tour.<br>Let\'s start by adding pictures!';
 $lang['first_contact_title2'] = '';
 $lang['first_contact_stp2'] = 'The link is here. Click Next to continue';
 $lang['first_contact_title3'] = 'Add Photo Page';
-$lang['first_contact_stp3'] = 'First tab to add photos from your browser, other tabs to add from a software, mobile or FTP';
+$lang['first_contact_stp3'] = 'This first tab is where you add photos directly from your browser. The other tabs are about the other ways to upload photos';
 $lang['first_contact_title4'] = 'Lets add photo!';
 $lang['first_contact_stp4'] = 'First choose an album; create one if there is no album yet.';
@@ -99,5 +110,3 @@
 $lang[''] = '';
 $lang[''] = '';
-$lang[''] = '';
-$lang[''] = '';
 ?>
Index: /extensions/TakeATour/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/TakeATour/language/fr_FR/plugin.lang.php	(revision 28099)
+++ /extensions/TakeATour/language/fr_FR/plugin.lang.php	(revision 28100)
@@ -2,10 +2,103 @@
 $lang['First Contact'] = 'Premier contact';
 $lang['Start the Tour'] = 'Commencez la visite';
-$lang[''] = '';
-$lang['Welcome in your Piwigo gallery'] = 'Bienvenue dans votre galerie Piwigo';
-$lang['Step_1 Let\'s start by adding pictures'] = 'Bonjour, à travers ce guide, vous allez comprendre comment utiliser votre galerie et avoir un aperçu des fonctionnalités offertes';
+$lang['Visit your Piwigo!'] = 'Visiter votre Piwigo !';
+$lang['Take a tour and discover the features of your Piwigo gallery » Go to the available tours'] = 'Découvrez les fonctionnalités de votre galerie Piwigo » Voir les visites interactives disponibles';
 $lang[''] = '';
 $lang[''] = '';
 $lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+$lang[''] = '';
+
+$lang['first_contact_descrp'] = '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.';
+$lang['first_contact_title1'] = 'Welcome in your Piwigo gallery';
+$lang['first_contact_stp1'] = '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. If you are stuck and can\'t end the tour, going to <em>Plugins » Take A Tour</em> will end the tour.<br>Let\'s start by adding pictures!';
+$lang['first_contact_title2'] = '';
+$lang['first_contact_stp2'] = 'The link is here. Click Next to continue';
+$lang['first_contact_title3'] = 'Add Photo Page';
+$lang['first_contact_stp3'] = 'This first tab is where you add photos directly from your browser. The other tabs are about the other ways to upload photos';
+$lang['first_contact_title4'] = 'Lets add photo!';
+$lang['first_contact_stp4'] = 'First choose an album; create one if there is no album yet.';
+$lang['first_contact_title5'] = '';
+$lang['first_contact_stp5'] = 'Then click the button to select photos to send from your computer';
+$lang['first_contact_title6'] = '';
+$lang['first_contact_stp6'] = 'You see that photos are being listed. Add at least 2 pictures and when you\'re ready click the button Start Upload';
+$lang['first_contact_title7'] = '';
+$lang['first_contact_stp7'] = 'Here a summary of your uploaded pictures. See that Piwigo has generated itself the thumbnails. You can know add more photos with the link at the bottom, edit the properties of a picture by cliking on it, or click to manage all the uploaded pictures in the Batch Manager...';
+$lang['first_contact_title8'] = '';
+$lang['first_contact_stp8'] = 'Let\'s edit them! Click on the link. If you don\'t see it click Prev to add at least 2 photos.';
+$lang['first_contact_title9'] = 'The Batch Manager';
+$lang['first_contact_stp9'] = 'You are know in the Batch Manager, where you can batch edit multiple pictures. Here the Caddy is set as a filter because we comes from the upload result page.';
+$lang['first_contact_title10'] = '';
+$lang['first_contact_stp10'] = 'Here is the link to directly access to your caddy: that/s a tool for administrators to easily add pictures to a set in order to edit them in the Batch Manager. You can add photos to the caddy from the public picture page when logged as an admin, or using the action \"Add to caddy\" on the Batch Manager';
+$lang['first_contact_title11'] = 'How to edit a photos';
+$lang['first_contact_stp11'] = 'So you can select from here one or more photos';
+$lang['first_contact_title12'] = '';
+$lang['first_contact_stp12'] = 'then edit them using and action. But for instance, you can\'t -for now- batch edit descriptions since they are mostly unique';
+$lang['first_contact_title13'] = '';
+$lang['first_contact_stp13'] = 'You can edit descriptions and more from the batch manager in unit mode. But for now, let\'s stay in the global mode';
+$lang['first_contact_title14'] = '';
+$lang['first_contact_stp14'] = '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';
+$lang['first_contact_title15'] = 'The edition page of a picture';
+$lang['first_contact_stp15'] = 'On that page you can edit all the properties of a photo, for instance...';
+$lang['first_contact_title16'] = '';
+$lang['first_contact_stp16'] = 'here to add or remove the photo from albums. The link is virtual, no photos will be physcally moved ever.';
+$lang['first_contact_title17'] = '';
+$lang['first_contact_stp17'] = 'and here to set the photo as a picture representative of an album. So you can set as a representative of a public album, a photo in a private album, which is ideal to set custom thumbnails for albums but the user won\'t see those pictures inside those albums. Like setting a portrait of someone as representative, for an album which contains photos of nature; it would be weird to see that photo of the man/woman among trees or animals.';
+$lang['first_contact_title18'] = 'Manage albums';
+$lang['first_contact_stp18'] = 'That previous example was just a small overview of tricks and how powerfull Piwigo is. So I\'ve told about private albums, but how can we manage albums? Click On album->Manage or hit Next';
+$lang['first_contact_title19'] = 'Manage Albums';
+$lang['first_contact_stp19'] = '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.';
+$lang['first_contact_title20'] = 'Manage Albums';
+$lang['first_contact_stp20'] = 'When your mouse is hover a album, links and information appear. When you drag and drop an album -a rounded block-, you will change its position and then you can save or cancel your manual order.';
+$lang['first_contact_title21'] = 'Other Tabs';
+$lang['first_contact_stp21'] = 'The next tab is a page where you can move any virtual album.<br>The permalink tab is to set a particular url for an album, for tecnhical reasons like to set a specific template or for just sending cool customized links.<br>But let\'s edit an album: click on Edit of a album';
+$lang['first_contact_title22'] = 'Album Edition Page';
+$lang['first_contact_stp22'] = 'Like for a picture, here you can edit the properties of an album';
+$lang['first_contact_title23'] = '';
+$lang['first_contact_stp23'] = 'Locking a album means only administrators will be able to see that album: it\'s usually used when an admin is managing the properties of an album or don\'t want to publish the album immediatly';
+$lang['first_contact_title24'] = '';
+$lang['first_contact_stp24'] = 'Certainly, one of the most important page is the permission page of a private album. Click on the permission tab or click next';
+$lang['first_contact_title25'] = 'Album Permission';
+$lang['first_contact_stp25'] = 'As you can read in the Help of your Piwigo -link at the top right-, album permissions are set by groups and users. You can directly set private/public multiple albums using the Administration » Albums » Properties page.';
+$lang['first_contact_title26'] = '';
+$lang['first_contact_stp26'] = 'Here you can set the current album as private, then grant access to users and groups. By default, permissions are not recursive for sub albums, but upper-albums will be granted with the same permission in order to let the granted users browse to the album.';
+$lang['first_contact_title27'] = '';
+$lang['first_contact_stp27'] = 'Important fact: the webmasters and administrators are not omniscient when browsing the public part, but they can access to every album and photos on the admin part.';
+$lang['first_contact_title28'] = 'Configuration';
+$lang['first_contact_stp28'] = 'Now we will look at the options available to set Piwigo working your way. Click on Configuration->Options or just hit Next.';
+$lang['first_contact_title29'] = 'Configuration->Options->General';
+$lang['first_contact_stp29'] = 'Here, on that first page, you will set the essential and basic configuration of your gallery.';
+$lang['first_contact_title30'] = '';
+$lang['first_contact_stp30'] = 'Let\'s start by changing the tittle';
+$lang['first_contact_title31'] = '';
+$lang['first_contact_stp31'] = 'Then the banner, which will be displayed on top of every pages. As you can see, HTML tags are allowed here. You can also use the %gallery_title% tag to display the tittle you just typed above.';
+$lang['first_contact_title32'] = '';
+$lang['first_contact_stp32'] = 'Now save you changes';
+$lang['first_contact_title33'] = 'Guest settings';
+$lang['first_contact_stp33'] = 'Just a final word about the options, the \'Guest settings\' page is to set the preferences of unregistered visitors. Each time Piwigo refers to \'guest\' that means unregistered visitors.<br>Let\'s continue about Configuration: click on Configuration->Themes or just hit Next.';
+$lang['first_contact_title34'] = 'Themes';
+$lang['first_contact_stp34'] = 'Themes are one of the three way to customize your Piwigo, with Plugins and Templates. Themes installed are listed here.<br>More than one theme can be enabled: users can change their theme by choosing one among the one enabled here, if the option \'Allow user customization\' is checked on the Option page.';
+$lang['first_contact_title35'] = 'Themes';
+$lang['first_contact_stp35'] = 'Themes can also be set as Default, which means that\'s the theme for unregistred visitors (guests, you remember?) and any new registred user will be have this theme. But for any previously registred users, the theme won\'t change until you do it from the User Management page or you disable their theme: be carefull, you might disturb your users by changing their whole display.';
+$lang['first_contact_title36'] = 'Themes';
+$lang['first_contact_stp36'] = 'Themes have a system of dependency: that\'s why some theme can\'t be deleted (a parent theme can\'t be deleted if a child theme is enabled) or others can\'t be enabled (a child theme need its parent theme). For instance, when you put you\'re mouse over a Delete link, if the theme can\'t be deleted, a information bubble will explain you why.';
+$lang['first_contact_title37'] = 'Themes';
+$lang['first_contact_stp37'] = 'To install new themes, you can directly download them from the tab \'Add a theme\'. Only the themes marked as compatible with your version of Piwigo are showed.<br>Let\'s discover the plugins now! Click on Plugin->Manage';
+$lang['first_contact_title38'] = 'Plugins';
+$lang['first_contact_stp38'] = 'Plugins are very easy ways to customize your Piwigo. They can do almost anything you can imagine from small text addition to complete features, like the Community plugin which allows non admistrators users to upload without entering to the administration part.';
+$lang['first_contact_title39'] = 'Plugins';
+$lang['first_contact_stp39'] = 'On that first page, are listed the installed plugins. At the top, are listed the plugins activated, which are currently running. At the bottom, the plugins which are installed in the /plugins folder, but disabled. Deleting a plugin means that any trace of the plugin will be removed (files, options etc). For most of the plugins, disabling will keep the data registered by the plugins.';
+$lang['first_contact_title40'] = '';
+$lang['first_contact_stp40'] = 'Here it\'s me! Don\'t disable me now, but you can see you can Disable or Restore an activated plugin.';
+$lang['first_contact_title41'] = '';
+$lang['first_contact_stp41'] = 'You can see on the last tab all the plugins available for your version of Piwigo. Hundred of plugins are there!';
+$lang['first_contact_title42'] = 'Languages';
+$lang['first_contact_stp42'] = 'Piwigo is multilingual. By default, the language displayed by Piwigo change according to the language of the browser of the visitor. If the language of the visitor is not availble, the language set by default is used.';
+$lang['first_contact_title43'] = 'It\'s been a great time';
+$lang['first_contact_stp43'] = 'This tour was quite long, but we only have seen a small part of how powerfull Piwigo is. Everything has a end, this overview is finished.<br>You can discover much deeper the features of Piwigo by taking an other tour or reading our documentation, on the piwigo.org website.';
 $lang[''] = '';
 $lang[''] = '';
Index: /extensions/TakeATour/main.inc.php
===================================================================
--- /extensions/TakeATour/main.inc.php	(revision 28099)
+++ /extensions/TakeATour/main.inc.php	(revision 28100)
@@ -17,4 +17,5 @@
 if ( isset($_POST['submited_tour']) and in_array($_POST['submited_tour'], $avalaible_tour) and defined('IN_ADMIN') and IN_ADMIN )
 {
+  check_pwg_token();
   pwg_set_session_var('tour_to_launch', $_POST['submited_tour']);
   global $TAT_restart;
@@ -62,21 +63,49 @@
 
 
-/*
-add_event_handler('init', 'TAT_add_js_css');
-function TAT_add_js_css()
+add_event_handler('loc_end_help','TAT_help');
+function TAT_help()
 {
-  $avalaible_tour = array('first_contact', 'privacy', 'picture_protection');
-
-  if ( isset($_POST['submited_tour']) and in_array($_POST['submited_tour'], $avalaible_tour) and defined('IN_ADMIN') and IN_ADMIN )
-  {
-    $tour_to_launch = $_POST['submited_tour'];
-  }
   global $template;
   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
-  $template->set_filename('TAT_tour_tpl', PHPWG_PLUGINS_PATH.'TakeATour/tpl/'.$tour_to_launch.'.tpl');
-  $template->parse('TAT_tour_tpl');
-}*/
+  $template->set_prefilter('help', 'TAT_help_prefilter');
+}
+function TAT_help_prefilter($content, &$smarty)
+{
+  
+  $search = '<div id="helpContent">';
+  $replacement = '<div id="helpContent">
+<fieldset>
+<legend>{\'Visit your Piwigo!\'|@translate}</legend>
+<p class="nextStepLink"><a href="admin.php?page=plugin-TakeATour">{\'Take a tour and discover the features of your Piwigo gallery » Go to the available tours\'|@translate}</a></p>
+</fieldset>';
+  return(str_replace($search, $replacement, $content));
+
+}
+add_event_handler('loc_end_no_photo_yet','TAT_no_photo_yet');
+function TAT_no_photo_yet()
+{
+  global $template;
+  load_language('plugin.lang', PHPWG_PLUGINS_PATH .'TakeATour/');
+  $template->set_prefilter('no_photo_yet', 'TAT_no_photo_yet_prefilter');
+  $template->assign(
+  array(
+    'F_ACTION' => get_root_url().'admin.php',
+    'pwg_token' => get_pwg_token()
+    )
+  );
+}
+function TAT_no_photo_yet_prefilter($content, &$smarty)
+{
+  
+  $search = '<div class="bigButton"><a href="{$next_step_url}">{\'I want to add photos\'|@translate}</a></div>';
+  $replacement = '<form class="bigButton" action="{$F_ACTION}" method="post">
+  <input type="hidden" name="submited_tour" value="first_contact">
+  <input type="hidden" name="pwg_token" value="{$pwg_token}">
+  <input type="submit" name="button2" id="button2" value="{\'I want to discover my gallery and add photos\'|@translate}">
+</form>
+<div class="bigButton"><a href="{$next_step_url}">{\'I want to add photos\'|@translate}</a></div>';
+  return(str_replace($search, $replacement, $content));
+}
+
 add_event_handler('get_admin_plugin_menu_links', 'TAT_admin_menu' );
 function TAT_admin_menu($menu)
Index: /extensions/TakeATour/tpl/admin.tpl
===================================================================
--- /extensions/TakeATour/tpl/admin.tpl	(revision 28099)
+++ /extensions/TakeATour/tpl/admin.tpl	(revision 28100)
@@ -9,4 +9,5 @@
     <form action="{$F_ACTION}" method="post">
       <input type="hidden" name="submited_tour" value="first_contact">
+      <input type="hidden" name="pwg_token" value="{$pwg_token}">
       <input type="submit" name="button2" id="button2" value="{'Start the Tour'|@translate}">
     </form>
