aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/TakeATour/tours/first_contact/config.inc.php
diff options
context:
space:
mode:
authorflop25 <flop25@piwigo.org>2014-07-26 17:42:07 +0000
committerflop25 <flop25@piwigo.org>2014-07-26 17:42:07 +0000
commit3f37ec3477f32059b094cab322cd37483d9092e8 (patch)
tree5a888a1900cc30c90485b91b055e36a69a21f3b7 /plugins/TakeATour/tours/first_contact/config.inc.php
parentc97e8ed352b4e82a454b8664dc598181cd2f3494 (diff)
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
Diffstat (limited to 'plugins/TakeATour/tours/first_contact/config.inc.php')
-rw-r--r--plugins/TakeATour/tours/first_contact/config.inc.php38
1 files changed, 37 insertions, 1 deletions
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;