From 5ebeec822fc3ee0d50591f2b25a1190760977327 Mon Sep 17 00:00:00 2001 From: flop25 Date: Sun, 13 Apr 2014 18:22:25 +0000 Subject: TakeATour replace c13y_upgrade ; c13y_upgrade not activated after upgrade adding TakeATour files less margin-top in no_photo_yet.tpl git-svn-id: http://piwigo.org/svn/trunk@28169 68402e56-0260-453c-a942-63ccdbb3a9ee --- .../TakeATour/tours/first_contact/config.inc.php | 71 +++++ .../tours/first_contact/config_preparse.inc.php | 59 ++++ plugins/TakeATour/tours/first_contact/tour.tpl | 349 +++++++++++++++++++++ 3 files changed, 479 insertions(+) create mode 100644 plugins/TakeATour/tours/first_contact/config.inc.php create mode 100644 plugins/TakeATour/tours/first_contact/config_preparse.inc.php create mode 100644 plugins/TakeATour/tours/first_contact/tour.tpl (limited to 'plugins/TakeATour/tours/first_contact') diff --git a/plugins/TakeATour/tours/first_contact/config.inc.php b/plugins/TakeATour/tours/first_contact/config.inc.php new file mode 100644 index 000000000..74bad9eda --- /dev/null +++ b/plugins/TakeATour/tours/first_contact/config.inc.php @@ -0,0 +1,71 @@ +set_prefilter('batch_manager_global', 'TAT_FC_14_prefilter'); +} +function TAT_FC_14_prefilter ($content, &$smarty) +{ + $search = '{\'Edit\''; + $replacement = '>{\'Edit\''; + return str_replace($search, $replacement, $content); +} +function TAT_FC_16() +{ + global $template; + $template->set_prefilter('picture_modify', 'TAT_FC_16_prefilter'); +} +function TAT_FC_16_prefilter ($content, &$smarty) +{ + $search = '{\'Linked albums\'|@translate}'; + $replacement = '{\'Linked albums\'|@translate}'; + return str_replace($search, $replacement, $content); +} +function TAT_FC_17() +{ + global $template; + $template->set_prefilter('picture_modify', 'TAT_FC_17_prefilter'); +} +function TAT_FC_17_prefilter ($content, &$smarty) +{ + $search = '{\'Representation of albums\'|@translate}'; + $replacement = '{\'Representation of albums\'|@translate}'; + return str_replace($search, $replacement, $content); +} +function TAT_FC_23() +{ + global $template; + $template->set_prefilter('album_properties', 'TAT_FC_23_prefilter'); +} +function TAT_FC_23_prefilter ($content, &$smarty) +{ + $search = '{\'Lock\'|@translate}'; + $replacement = '{\'Lock\'|@translate}'; + return str_replace($search, $replacement, $content); +} +function TAT_FC_35() +{ + global $template; + $template->set_prefilter('themes', 'TAT_FC_35_prefilter'); +} +function TAT_FC_35_prefilter ($content, &$smarty) +{ + $search = ' \ No newline at end of file diff --git a/plugins/TakeATour/tours/first_contact/config_preparse.inc.php b/plugins/TakeATour/tours/first_contact/config_preparse.inc.php new file mode 100644 index 000000000..711dfe349 --- /dev/null +++ b/plugins/TakeATour/tours/first_contact/config_preparse.inc.php @@ -0,0 +1,59 @@ +assign('TAT_image_id', $_GET['image_id']); + pwg_set_session_var('TAT_image_id', $_GET['image_id']); + } + elseif (is_numeric(pwg_get_session_var('TAT_image_id'))) + { + $template->assign('TAT_image_id', pwg_get_session_var('TAT_image_id')); + } + else + { + $query = ' + SELECT id + FROM '.IMAGES_TABLE.' + ORDER BY RAND() + LIMIT 1 + ;'; + $row = pwg_db_fetch_assoc(pwg_query($query)); + $template->assign('TAT_image_id', $row['id']); + } + //album id + if (isset($_GET['page']) and preg_match('/^album-(\d+)(?:-(.*))?$/', $_GET['page'], $matches)) + { + $_GET['cat_id'] = $matches[1]; + } + check_input_parameter('cat_id', $_GET, false, PATTERN_ID); + if (isset($_GET['cat_id']) and pwg_get_session_var('TAT_cat_id')==null) + { + $template->assign('TAT_cat_id', $_GET['cat_id']); + pwg_set_session_var('TAT_cat_id', $_GET['cat_id']); + } + elseif (is_numeric(pwg_get_session_var('TAT_cat_id'))) + { + $template->assign('TAT_cat_id', pwg_get_session_var('TAT_cat_id')); + } + else + { + $query = ' + SELECT id + FROM '.CATEGORIES_TABLE.' + ORDER BY RAND() + LIMIT 1 + ;'; + $row = pwg_db_fetch_assoc(pwg_query($query)); + $template->assign('TAT_cat_id', $row['id']); + } + global $conf; + if ( isset($conf['enable_synchronization']) ) + { + $template->assign('TAT_FTP', $conf['enable_synchronization']); + } +?> \ No newline at end of file diff --git a/plugins/TakeATour/tours/first_contact/tour.tpl b/plugins/TakeATour/tours/first_contact/tour.tpl new file mode 100644 index 000000000..885dfe212 --- /dev/null +++ b/plugins/TakeATour/tours/first_contact/tour.tpl @@ -0,0 +1,349 @@ +{footer_script require='jquery.bootstrap-tour'}{literal} + +var tour = new Tour({ + name: "first_contact", + orphan: true, + onEnd: function (tour) {window.location = "admin.php?page=plugin-TakeATour&tour_ended=first_contact";}, +}); +{/literal}{if $TAT_restart}tour.restart();{/if}{literal} + +tour.addSteps([ + { + path: "{/literal}{$TAT_path}{literal}admin.php", + title: "{/literal}{'first_contact_title1'|@translate}{literal}", + content: "{/literal}{'first_contact_stp1'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php", + placement: "right", + element: ".icon-plus-circled", + reflex:true, + title: "{/literal}{'first_contact_title2'|@translate}{literal}", + content: "{/literal}{'first_contact_stp2'|@translate}{literal}", + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=photos_add", + placement: "bottom", + element: ".selected_tab", + title: "{/literal}{'first_contact_title3'|@translate}{literal}", + content: "{/literal}{'first_contact_stp3'|@translate}{literal}", + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=photos_add", + placement: "left", + element: "#albumSelection", + title: "{/literal}{'first_contact_title4'|@translate}{literal}", + content: "{/literal}{'first_contact_stp4'|@translate}{literal}" + }, + {//5 + path: "{/literal}{$TAT_path}{literal}admin.php?page=photos_add", + placement: "top", + element: "#uploadify", + title: "{/literal}{'first_contact_title5'|@translate}{literal}", + content: "{/literal}{'first_contact_stp5'|@translate}{literal}" + }, + { + path: /admin\.php\?page=photos_add/, + redirect:function (tour) {window.location = "admin.php?page=photos_add";}, + placement: "left", + element: "#fileQueue", + title: "{/literal}{'first_contact_title6'|@translate}{literal}", + content: "{/literal}{'first_contact_stp6'|@translate}{literal}" + }, + { + path: /admin\.php\?page=photos_add/, + redirect:function (tour) {window.location = "admin.php?page=photos_add";}, + placement: "top", + element: "#photosAddContent legend", + title: "{/literal}{'first_contact_title7'|@translate}{literal}", + content: "{/literal}{'first_contact_stp7'|@translate}{literal}", + prev:4 + }, + { + path: /admin\.php\?page=photos_add/, + redirect:function (tour) {window.location = "admin.php?page=photos_add";}, + placement: "bottom", + element: "#batchLink", + reflex:true, + title: "{/literal}{'first_contact_title8'|@translate}{literal}", + content: "{/literal}{'first_contact_stp8'|@translate}{literal}", + prev:4 + }, + { + path: /admin\.php\?page=(photos_add|batch_manager&filter=prefilter-last_import|prefilter-caddie)/, + redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";}, + placement: "top", + element: "", + title: "{/literal}{'first_contact_title9'|@translate}{literal}", + content: "{/literal}{'first_contact_stp9'|@translate}{literal}" + }, + {//10 + path: /admin\.php\?page=batch_manager&filter=(prefilter-caddie|prefilter-last_import)/, + redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";}, + placement: "right", + element: ".icon-flag", + title: "{/literal}{'first_contact_title10'|@translate}{literal}", + content: "{/literal}{'first_contact_stp10'|@translate}{literal}" + }, + { + path: /admin\.php\?page=batch_manager&filter=(prefilter-caddie|prefilter-last_import)/, + redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";}, + placement: "left", + element: "#checkActions", + title: "{/literal}{'first_contact_title11'|@translate}{literal}", + content: "{/literal}{'first_contact_stp11'|@translate}{literal}" + }, + { + path: /admin\.php\?page=batch_manager&filter=(prefilter-caddie|prefilter-last_import)/, + redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";}, + placement: "top", + element: "#action", + title: "{/literal}{'first_contact_title12'|@translate}{literal}", + content: "{/literal}{'first_contact_stp12'|@translate}{literal}" + }, + { + path: /admin\.php\?page=batch_manager&filter=(prefilter-caddie|prefilter-last_import)/, + redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";}, + placement: "bottom", + element: "#tabsheet .normal_tab", + title: "{/literal}{'first_contact_title13'|@translate}{literal}", + content: "{/literal}{'first_contact_stp13'|@translate}{literal}" + }, + { + path: /admin\.php\?page=batch_manager&filter=(prefilter-caddie|prefilter-last_import)/, + redirect:function (tour) {window.location = "admin.php?page=batch_manager&filter=prefilter-last_import";}, + placement: "top", + element: "#TAT_FC_14", + reflex:true, + title: "{/literal}{'first_contact_title14'|@translate}{literal}", + content: "{/literal}{'first_contact_stp14'|@translate}{literal}", + onNext:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";} + }, + {//15 + path: /admin\.php\?page=photo-/, + redirect:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";}, + placement: "bottom", + element: ".selected_tab", + title: "{/literal}{'first_contact_title15'|@translate}{literal}", + content: "{/literal}{'first_contact_stp15'|@translate}{literal}" + }, + { + path: /admin\.php\?page=photo-/, + redirect:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";}, + placement: "top", + element: "#TAT_FC_16", + title: "{/literal}{'first_contact_title16'|@translate}{literal}", + content: "{/literal}{'first_contact_stp16'|@translate}{literal}" + }, + { + path: /admin\.php\?page=photo-/, + redirect:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";}, + placement: "top", + element: "#TAT_FC_17", + title: "{/literal}{'first_contact_title17'|@translate}{literal}", + content: "{/literal}{'first_contact_stp17'|@translate}{literal}" + }, + { + path: /admin\.php\?page=photo-/, + redirect:function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";}, + placement: "top", + title: "{/literal}{'first_contact_title18'|@translate}{literal}", + content: "{/literal}{'first_contact_stp18'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=cat_list", + placement: "left", + element: "#content", + title: "{/literal}{'first_contact_title19'|@translate}{literal}", + content: "{/literal}{if $TAT_FTP}{'first_contact_stp19'|@translate}{else}{'first_contact_stp19_b'|@translate}{/if}{literal}", + onPrev: function (tour) {window.location = "admin.php?page=photo-{/literal}{$TAT_image_id}{literal}";}, + + }, + {//20 + path: "{/literal}{$TAT_path}{literal}admin.php?page=cat_list", + placement: "top", + element: "#categoryOrdering", + title: "{/literal}{'first_contact_title20'|@translate}{literal}", + content: "{/literal}{'first_contact_stp20'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=cat_list", + placement: "left", + element: "#tabsheet:first-child", + title: "{/literal}{'first_contact_title21'|@translate}{literal}", + content: "{/literal}{'first_contact_stp21'|@translate}{literal}" + }, + { + path: /admin\.php\?page=album-/, + redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";}, + placement: "top", + element: ".selected_tab", + title: "{/literal}{'first_contact_title22'|@translate}{literal}", + content: "{/literal}{'first_contact_stp22'|@translate}{literal}" + }, + { + path: /admin\.php\?page=album-/, + redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";}, + placement: "top", + element: "#TAT_FC_23", + title: "{/literal}{'first_contact_title23'|@translate}{literal}", + content: "{/literal}{'first_contact_stp23'|@translate}{literal}" + }, + { + path: /admin\.php\?page=album-/, + redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}";}, + placement: "bottom", + element: ".tabsheet", + title: "{/literal}{'first_contact_title24'|@translate}{literal}", + content: "{/literal}{'first_contact_stp24'|@translate}{literal}" + }, + {//25 + path: /admin\.php\?page=album-[0-9]+-permissions/, + redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}-permissions";}, + placement: "left", + element: "#content", + title: "{/literal}{'first_contact_title25'|@translate}{literal}", + content: "{/literal}{'first_contact_stp25'|@translate}{literal}" + }, + { + path: /admin\.php\?page=album-[0-9]+-permissions/, + redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}-permissions";}, + placement: "top", + element: "#selectStatus", + title: "{/literal}{'first_contact_title26'|@translate}{literal}", + content: "{/literal}{'first_contact_stp26'|@translate}{literal}" + }, + { + path: /admin\.php\?page=album-[0-9]+-permissions/, + redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}-permissions";}, + placement: "top", + element: "#selectStatus", + title: "{/literal}{'first_contact_title27'|@translate}{literal}", + content: "{/literal}{'first_contact_stp27'|@translate}{literal}" + }, + { + path: /admin\.php\?page=album-[0-9]+-permissions/, + redirect:function (tour) {window.location = "admin.php?page=album-{/literal}{$TAT_cat_id}{literal}-permissions";}, + placement: "top", + title: "{/literal}{'first_contact_title28'|@translate}{literal}", + content: "{/literal}{'first_contact_stp28'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=configuration", + placement: "top", + element: "", + title: "{/literal}{'first_contact_title29'|@translate}{literal}", + content: "{/literal}{'first_contact_stp29'|@translate}{literal}" + }, + {//30 + path: "{/literal}{$TAT_path}{literal}admin.php?page=configuration", + placement: "right", + element: "#gallery_title", + title: "{/literal}{'first_contact_title30'|@translate}{literal}", + content: "{/literal}{'first_contact_stp30'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=configuration", + placement: "right", + element: "#page_banner", + title: "{/literal}{'first_contact_title31'|@translate}{literal}", + content: "{/literal}{'first_contact_stp31'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=configuration", + reflex: true, + placement: "top", + element: ".formButtons input", + title: "{/literal}{'first_contact_title32'|@translate}{literal}", + content: "{/literal}{'first_contact_stp32'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=configuration", + placement: "top", + title: "{/literal}{'first_contact_stp33'|@translate}{literal}", + content: "{/literal}{'first_contact_stp33'|@translate}{literal}", + prev:30 + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=themes", + placement: "top", + element: "", + title: "{/literal}{'first_contact_title34'|@translate}{literal}", + content: "{/literal}{'first_contact_stp34'|@translate}{literal}" + }, + {//35 + path: "{/literal}{$TAT_path}{literal}admin.php?page=themes", + placement: "top", + element: "#TAT_FC_35", + title: "{/literal}{'first_contact_title35'|@translate}{literal}", + content: "{/literal}{'first_contact_stp35'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=themes", + placement: "top", + element: "", + title: "{/literal}{'first_contact_title36'|@translate}{literal}", + content: "{/literal}{'first_contact_stp36'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=themes", + placement: "right", + element: ".tabsheet", + title: "{/literal}{'first_contact_title37'|@translate}{literal}", + content: "{/literal}{'first_contact_stp37'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=plugins", + placement: "left", + element: "", + title: "{/literal}{'first_contact_title38'|@translate}{literal}", + content: "{/literal}{'first_contact_stp38'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=plugins", + placement: "left", + element: "#content", + title: "{/literal}{'first_contact_title39'|@translate}{literal}", + content: "{/literal}{'first_contact_stp39'|@translate}{literal}" + }, + {//40 + path: "{/literal}{$TAT_path}{literal}admin.php?page=plugins", + placement: "bottom", + element: "#TakeATour", + title: "{/literal}{'first_contact_title40'|@translate}{literal}", + content: "{/literal}{'first_contact_stp40'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=plugins", + placement: "right", + element: ".tabsheet", + title: "{/literal}{'first_contact_title41'|@translate}{literal}", + content: "{/literal}{'first_contact_stp41'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=languages", + title: "{/literal}{'first_contact_title42'|@translate}{literal}", + content: "{/literal}{'first_contact_stp42'|@translate}{literal}" + }, + { + path: "{/literal}{$TAT_path}{literal}admin.php?page=plugin-TakeATour", + placement: "top", + element: "", + title: "{/literal}{'first_contact_title43'|@translate}{literal}", + content: "{/literal}{'first_contact_stp43'|@translate}{literal}" + } +]); + +// Initialize the tour +tour.init(); + +// Start the tour +tour.start(); + +jQuery( "input[class='submit']" ).click(function() { + if (tour.getCurrentStep()==5) + { + tour.goTo(6); + } +}); +{/literal}{/footer_script} \ No newline at end of file -- cgit v1.2.3