[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] Plugin Tour: update plugin doc and ensure that a multi-step tour functions correctly
"Merci Jacob \(@mercihabam\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68ade55fa0fa_2cd72bc351a@gitlab-sidekiq-low-urgency-cpu-bound-v2-6564b7ddc9-gzmsr.mail> |
Merci Jacob pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki Commits: c2f85017 by Merci Jacob at 2025-08-26T16:48:28+00:00 [FIX] Plugin Tour: update plugin doc and ensure that a multi-step tour functions correctly --- * number_of_steps should be optional * [FIX] Plugin Tour: update plugin doc and ensure that a multi-step tour functions correctly See merge request tikiwiki/tiki!8356 (cherry picked from commit 151109304c6272887e891fce4db646c1d7be2dc5) e5d8e61a [FIX] Plugin Tour: update plugin doc and ensure that a multi-step tour functions correctly 46d228b3 number_of_steps should be optional Co-authored-by: Merci Jacob <[email protected]> - - - - - 1 changed file: - lib/wiki-plugins/wikiplugin_tour.php Changes: ===================================== lib/wiki-plugins/wikiplugin_tour.php ===================================== @@ -21,8 +21,8 @@ function wikiplugin_tour_info() 'params' => [ 'element' => [ 'name' => tra('Element'), - 'required' => false, - 'description' => tra('Element to show the popup on; if empty, use the plugin location itself'), + 'required' => true, + 'description' => tra('Element to show the popup on. It should be a valid CSS selector.'), 'since' => '15.0', 'filter' => 'text', 'default' => '', @@ -63,7 +63,7 @@ function wikiplugin_tour_info() 'tour_id' => [ 'name' => tra('Tour ID'), 'required' => false, - 'description' => tra('Set a tour ID to be able to only show the tour once. (Set only in the first step.)'), + 'description' => tra('Set a tour ID to be able to show the tour only once or use many steps. (This value should be identical for all steps of the same tour.)'), 'since' => '15.0', 'filter' => 'text', 'default' => 'default', @@ -134,7 +134,7 @@ function wikiplugin_tour_info() 'number_of_steps' => [ 'name' => tra('Number of Steps'), 'required' => false, - 'description' => tra('Number of steps in the tour. (Set only in the first step.)'), + 'description' => tra('Number of steps in the tour. (Required only in the first step.)'), 'since' => '27.0', 'filter' => 'int', 'default' => '', @@ -230,18 +230,19 @@ function wikiplugin_tour($data, $params) $TOUR_STEPS = "tour_steps_{$params['tour_id']}"; $TOUR_NUMBER_OF_STEPS = "number_of_steps_{$params['tour_id']}"; - $step = array_filter($params); - $content = TikiLib::lib('parser')->parse_data($data); - $step['content'] = $content; - $_SESSION[$TOUR_STEPS] = array_merge($_SESSION[$TOUR_STEPS] ?? [], [$step]); - // first step if ($params['number_of_steps']) { $_SESSION[$TOUR_NUMBER_OF_STEPS] = $params['number_of_steps']; $unique = 'wptour_' . $_SESSION['id']; $_SESSION['startButtonId'] = $unique . '_restart'; + $_SESSION[$TOUR_STEPS] = []; } + $step = array_filter($params); + $content = TikiLib::lib('parser')->parse_data($data); + $step['content'] = $content; + $_SESSION[$TOUR_STEPS] = array_merge($_SESSION[$TOUR_STEPS] ?? [], [$step]); + $html = ''; if (isset($_SESSION[$TOUR_NUMBER_OF_STEPS]) && $_SESSION[$TOUR_NUMBER_OF_STEPS] === count($_SESSION[$TOUR_STEPS])) { View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c2f85017b0f6b2bf7ac14534136ea3d2bba027d6 -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c2f85017b0f6b2bf7ac14534136ea3d2bba027d6 You're receiving this email because of your account on gitlab.com. _______________________________________________ TikiWiki-cvs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs