From 3f37ec3477f32059b094cab322cd37483d9092e8 Mon Sep 17 00:00:00 2001 From: flop25 Date: Sat, 26 Jul 2014 17:42:07 +0000 Subject: add new trigger loc_end_photo_add_direct First Contact tour reviewed and reworked to change dynamically with the new uploader git-svn-id: http://piwigo.org/svn/trunk@29078 68402e56-0260-453c-a942-63ccdbb3a9ee --- .../TakeATour/tours/first_contact/config.inc.php | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'plugins/TakeATour/tours/first_contact/config.inc.php') diff --git a/plugins/TakeATour/tours/first_contact/config.inc.php b/plugins/TakeATour/tours/first_contact/config.inc.php index 30f797c66..dc1dfe2db 100644 --- a/plugins/TakeATour/tours/first_contact/config.inc.php +++ b/plugins/TakeATour/tours/first_contact/config.inc.php @@ -9,13 +9,49 @@ $TOUR_PATH = PHPWG_PLUGINS_PATH.'TakeATour/tours/first_contact/tour.tpl'; if ( defined('IN_ADMIN') and IN_ADMIN ) { /* first contact */ +add_event_handler('loc_end_photo_add_direct', 'TAT_FC_6'); +add_event_handler('loc_end_photo_add_direct', 'TAT_FC_7'); add_event_handler('loc_end_element_set_global', 'TAT_FC_14'); add_event_handler('loc_end_picture_modify', 'TAT_FC_16'); add_event_handler('loc_end_picture_modify', 'TAT_FC_17'); add_event_handler('loc_end_cat_modify', 'TAT_FC_23'); add_event_handler('loc_end_themes_installed', 'TAT_FC_35'); } - + +function TAT_FC_7() +{ + global $template; + $template->set_prefilter('photos_add', 'TAT_FC_7_prefilter'); +} +function TAT_FC_7_prefilter ($content, &$smarty) +{ + $search = 'UploadComplete: function(up, files) {'; + $replacement = 'UploadComplete: function(up, files) { + if (tour.getCurrentStep()==5) + { + tour.goTo(6); + } +'; + return str_replace($search, $replacement, $content); +} +function TAT_FC_6() +{ + global $template; + $template->set_prefilter('photos_add', 'TAT_FC_6_prefilter'); +} +function TAT_FC_6_prefilter ($content, &$smarty) +{ + $search = 'BeforeUpload:'; + $replacement = 'FilesAdded: function() { + if (tour.getCurrentStep()==4) + { + tour.goTo(5); + } + + }, + BeforeUpload:'; + return str_replace($search, $replacement, $content); +} function TAT_FC_14() { global $template; -- cgit v1.2.3