true, 'local'=>true) ); $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; $template->assign('TAT_restart',true); } $tat_path=str_replace(basename($_SERVER['SCRIPT_NAME']),'', $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']); $template->assign('TAT_path', $tat_path); @include('tours/'.$tour_to_launch.'/config_preparse.inc.php'); $template->set_filename('TAT_tour_tpl', PHPWG_PLUGINS_PATH.'TakeATour/tours/'.$tour_to_launch.'/tour.tpl'); $template->parse('TAT_tour_tpl'); } /** Add link in Help pages **/ add_event_handler('loc_end_help','TAT_help'); function TAT_help() { global $template; load_language('plugin.lang', PHPWG_PLUGINS_PATH .'TakeATour/'); $template->set_prefilter('help', 'TAT_help_prefilter'); } function TAT_help_prefilter($content, &$smarty) { $search = '
'; $replacement = '
{\'Visit your Piwigo!\'|@translate}
'; return(str_replace($search, $replacement, $content)); } /** Add link in no_photo_yet **/ 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 = ''; $replacement = ' '; return(str_replace($search, $replacement, $content)); } /** After a Piwigo Update **/ add_event_handler('list_check_integrity', 'TAT_prompt'); function TAT_prompt($c13y) { global $page; $version_=str_replace('.','_',PHPWG_VERSION); if (file_exists('tours/'.$version_.'/config.inc.php')) { $page['infos'][] = ''.l10n('Discover what is new in the version %s of Piwigo', PHPWG_VERSION).''; } } /** Add admin menu link **/ add_event_handler('get_admin_plugin_menu_links', 'TAT_admin_menu' ); function TAT_admin_menu($menu) { array_push($menu, array( 'NAME' => 'Take a Tour', 'URL' => get_root_url().'admin.php?page=plugin-TakeATour' ) ); return $menu; } ?>