Changeset 28207
- Timestamp:
- Apr 16, 2014, 10:45:31 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/TakeATour/main.inc.php
r28180 r28207 13 13 } 14 14 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**/ 16 if ( isset($_REQUEST['submited_tour']) and defined('IN_ADMIN') and IN_ADMIN ) 18 17 { 19 18 check_pwg_token(); … … 22 21 $TAT_restart=true; 23 22 } 24 elseif ( isset($_GET['tour_ended']) and in_array($_GET['tour_ended'], $avalaible_tour) anddefined('IN_ADMIN') and IN_ADMIN )23 elseif ( isset($_GET['tour_ended']) and defined('IN_ADMIN') and IN_ADMIN ) 25 24 { 26 25 pwg_unset_session_var('tour_to_launch'); 27 26 } 28 27 28 /** Setup the tour **/ 29 29 if (pwg_get_session_var('tour_to_launch') and isset($_GET['page']) and $_GET['page']=="plugin-TakeATour" ) 30 30 { … … 33 33 elseif ( pwg_get_session_var('tour_to_launch') ) 34 34 { 35 add_event_handler('init', 'TAT_ add_js_css');35 add_event_handler('init', 'TAT_tour_setup'); 36 36 include('tours/'.pwg_get_session_var('tour_to_launch').'/config.inc.php'); 37 37 } 38 38 39 function TAT_ add_js_css()39 function TAT_tour_setup() 40 40 { 41 41 global $template, $TAT_restart; … … 57 57 } 58 58 59 59 /** Add link in Help pages **/ 60 60 add_event_handler('loc_end_help','TAT_help'); 61 61 function TAT_help() … … 77 77 78 78 } 79 80 /** Add link in no_photo_yet **/ 79 81 add_event_handler('loc_end_no_photo_yet','TAT_no_photo_yet'); 80 82 function TAT_no_photo_yet() … … 121 123 } 122 124 125 /** After a Piwigo Update **/ 126 add_event_handler('list_check_integrity', 'TAT_prompt'); 127 function 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 **/ 123 138 add_event_handler('get_admin_plugin_menu_links', 'TAT_admin_menu' ); 124 139 function TAT_admin_menu($menu) -
trunk/upgrade.php
r28169 r28207 447 447 pwg_query($query);*/ 448 448 449 $query = ' 450 REPLACE INTO '.PLUGINS_TABLE.' 451 (id, state) 452 VALUES (\'TakeATour\', \'active\') 453 ;'; 454 pwg_query($query); 455 449 456 // Delete cache data 450 457 invalidate_user_cache(true);
Note: See TracChangeset
for help on using the changeset viewer.