Changeset 28207


Ignore:
Timestamp:
Apr 16, 2014, 10:45:31 PM (10 years ago)
Author:
flop25
Message:

code commented
useless code removed
first step for tour after update

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/TakeATour/main.inc.php

    r28180 r28207  
    1313}
    1414
    15 $avalaible_tour = array('first_contact', 'privacy', 'picture_protection');
    16 
    17 if ( isset($_POST['submited_tour']) and in_array($_POST['submited_tour'], $avalaible_tour) and defined('IN_ADMIN') and IN_ADMIN )
     15/** Tour sended via $_POST or $_GET**/
     16if ( isset($_REQUEST['submited_tour']) and defined('IN_ADMIN') and IN_ADMIN )
    1817{
    1918  check_pwg_token();
     
    2221  $TAT_restart=true;
    2322}
    24 elseif ( isset($_GET['tour_ended']) and in_array($_GET['tour_ended'], $avalaible_tour) and defined('IN_ADMIN') and IN_ADMIN )
     23elseif ( isset($_GET['tour_ended']) and defined('IN_ADMIN') and IN_ADMIN )
    2524{
    2625  pwg_unset_session_var('tour_to_launch');
    2726}
    2827
     28/** Setup the tour **/
    2929if (pwg_get_session_var('tour_to_launch') and isset($_GET['page']) and $_GET['page']=="plugin-TakeATour" )
    3030{
     
    3333elseif ( pwg_get_session_var('tour_to_launch') )
    3434{
    35   add_event_handler('init', 'TAT_add_js_css');
     35  add_event_handler('init', 'TAT_tour_setup');
    3636  include('tours/'.pwg_get_session_var('tour_to_launch').'/config.inc.php');
    3737}
    3838
    39 function TAT_add_js_css()
     39function TAT_tour_setup()
    4040{
    4141  global $template, $TAT_restart;
     
    5757}
    5858
    59 
     59/** Add link in Help pages **/
    6060add_event_handler('loc_end_help','TAT_help');
    6161function TAT_help()
     
    7777
    7878}
     79
     80/** Add link in no_photo_yet **/
    7981add_event_handler('loc_end_no_photo_yet','TAT_no_photo_yet');
    8082function TAT_no_photo_yet()
     
    121123}
    122124
     125/** After a Piwigo Update **/
     126add_event_handler('list_check_integrity', 'TAT_prompt');
     127function TAT_prompt($c13y)
     128{
     129  global $page;
     130  $version_=str_replace('.','_',PHPWG_VERSION);
     131  if (file_exists('tours/'.$version_.'/config.inc.php'))
     132  {
     133    $page['infos'][] = '<a href="'.get_root_url().'admin.php?submited_tour='.$version_.'&pwg_token='.get_pwg_token().'">'.l10n('Discover what is new in the version %s of Piwigo', PHPWG_VERSION).'</a>';
     134  }
     135}
     136
     137/** Add admin menu link **/
    123138add_event_handler('get_admin_plugin_menu_links', 'TAT_admin_menu' );
    124139function TAT_admin_menu($menu)
  • trunk/upgrade.php

    r28169 r28207  
    447447    pwg_query($query);*/
    448448
     449    $query = '
     450REPLACE INTO '.PLUGINS_TABLE.'
     451  (id, state)
     452  VALUES (\'TakeATour\', \'active\')
     453;';
     454    pwg_query($query);
     455
    449456    // Delete cache data
    450457    invalidate_user_cache(true);
Note: See TracChangeset for help on using the changeset viewer.