Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] [Guided tours] Add a What's New tour when updating to Joomla 5.2 #43966

Merged
merged 39 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
61d47b3
Create images folder
obuisard Aug 22, 2024
956317d
Delete build/media_source/com_guidedtours/images
obuisard Aug 22, 2024
0a84a5b
Create test.txt
obuisard Aug 22, 2024
d5c97c5
Delete build/media_source/com_guidedtours/images/test.txt
obuisard Aug 23, 2024
4d9acdf
Create test.txt
obuisard Aug 23, 2024
30e625f
Images for what's new tour for Joomla 5.2
obuisard Aug 23, 2024
d2536e2
Delete build/media_source/com_guidedtours/images/5_2/test.txt
obuisard Aug 23, 2024
3134424
Create 5.2.0-2024-08-22.sql for the what's new tour
obuisard Aug 23, 2024
7f3480a
Create 5.2.0-2024-08-22.sql for the what's new tour
obuisard Aug 23, 2024
5e93cff
Create guidedtours.joomla_whatsnew_5_2.ini
obuisard Aug 23, 2024
d207411
Create guidedtours.joomla_whatsnew_5_2_steps.ini
obuisard Aug 23, 2024
838ec17
Added 'Learn more' key
obuisard Aug 23, 2024
16c5b07
Added fixImagePaths function to take care of image paths
obuisard Aug 23, 2024
6762114
Wrong keys for steps
obuisard Aug 23, 2024
078552b
Wrong keys for steps
obuisard Aug 23, 2024
2176f17
Update administrator/components/com_admin/sql/updates/postgresql/5.2.…
obuisard Aug 24, 2024
d9360e7
Update administrator/components/com_admin/sql/updates/mysql/5.2.0-202…
obuisard Aug 24, 2024
fc97dee
Removed class text-underline
obuisard Aug 24, 2024
7ee3e50
Add files via upload
obuisard Aug 24, 2024
8036a08
Changed image sizes and removed col-xl classes
obuisard Aug 24, 2024
622fe12
Merge branch '5.2-dev' into guided-tours-whatsnewtour
richard67 Aug 28, 2024
9a988fd
Merge branch '5.2-dev' into guided-tours-whatsnewtour
obuisard Aug 30, 2024
15da735
Added 'Learn more' as start button label
obuisard Aug 30, 2024
4f9c0e0
Order of keys change
obuisard Aug 30, 2024
dbff30d
Changed Learn More key
obuisard Aug 30, 2024
ab1ca50
Changed Learn More key
obuisard Aug 30, 2024
5f3d61e
Merge branch '5.2-dev' into guided-tours-whatsnewtour
obuisard Sep 2, 2024
207f117
Removed escaping of = in regexp
obuisard Sep 2, 2024
1ac9d19
More Regexp changes
obuisard Sep 2, 2024
97b4ef3
Modified SQL with INSERT INTO SELECT FROM
obuisard Sep 3, 2024
10b0fc5
Changed SQL to use INSERT INTO SELECT FROM
obuisard Sep 3, 2024
afb5b0c
Merge branch '5.2-dev' into guided-tours-whatsnewtour
obuisard Sep 3, 2024
b21dae8
Add files via upload
obuisard Sep 4, 2024
a0bc83d
Added Articles module as new feature
obuisard Sep 4, 2024
32c5f0a
Removed Learn More
obuisard Sep 6, 2024
a160831
Changed 'Learn More' to 'Next'
obuisard Sep 6, 2024
0fa74ba
Merge branch '5.2-dev' into guided-tours-whatsnewtour
pe7er Sep 11, 2024
d4b2c49
Merge branch '5.2-dev' into guided-tours-whatsnewtour
pe7er Sep 11, 2024
228a440
Merge branch '5.2-dev' into guided-tours-whatsnewtour
Quy Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO `#__guidedtour_steps` (`title`, `description`, `position`, `target`, `type`, `interactive_type`, `url`, `published`, `language`, `note`, `params`, `tour_id`, `created`, `created_by`, `modified`, `modified_by`) VALUES ('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_DESCRIPTION', 'right', '#sidebarmenu nav > ul:first-of-type > li:last-child', 0, 1, '', 1, '*', '', '"{\"required\":1,\"requiredvalue\":\"\"}"', 0, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0);
INSERT INTO `#__guidedtours` (`title`, `description`, `extensions`, `url`, `published`, `language`, `note`, `access`, `uid`, `autostart`, `created`, `created_by`, `modified`, `modified_by`) VALUES ('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_DESCRIPTION', '["com_cpanel"]', 'administrator/index.php', 1, '*', '', 1, 'joomla-whatsnew-5-2', 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0);
UPDATE `#__guidedtour_steps` SET `tour_id` = LAST_INSERT_ID() WHERE `tour_id`=0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO "#__guidedtour_steps" ("title", "description", "position", "target", "type", "interactive_type", "url", "published", "language", "note", "params", "tour_id", "created", "created_by", "modified", "modified_by") VALUES ('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_DESCRIPTION', 'right', '#sidebarmenu nav > ul:first-of-type > li:last-child', 0, 1, '', 1, '*', '', '"{\"required\":1,\"requiredvalue\":\"\"}"', 0, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0);
INSERT INTO "#__guidedtours" ("title", "description", "extensions", "url", "published", "language", "note", "access", "uid", "autostart", "created", "created_by", "modified", "modified_by") VALUES ('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_DESCRIPTION', '["com_cpanel"]', 'administrator/index.php', 1, '*', '', 1, 'joomla-whatsnew-5-2', 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0);
UPDATE "#__guidedtour_steps" SET "tour_id" = currval(pg_get_serial_sequence('#__guidedtours','id')) WHERE "tour_id"=0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_DESCRIPTION = "<h1 class=\"fw-medium\">Welcome to Joomla 5.2!</h1><div class=\"row align-items-center mb-4 pt-4 border-top border-1\"><div class=\"col-md-6 col-lg-5 text-center text-md-start mb-3 mb-md-0\"><img class=\"img-fluid\" src=\"media/com_guidedtours/images/5_2/enhancedtourheader.png\" alt=\"The first step of the welcome tour, showing the new header look\" width=\"640\" height=\"384\"></div><div class=\"col-md-6 col-lg-7\"><h2 class=\"mb-3\">Guided Tours Updates</h2><h3>Auto-start Tours</h3><p>This feature will allow you to create your own auto-start Guided Tour. The contextual tour can be opted out for one or all users. Tours can be restarted from the Guided Tours menu.</p><h3>Enhancements</h3><ul class=\"mb-3\"><li>For clarity, the <em>Step Counter</em> was positioned first in the tour header.</li><li>The modal window resizes automatically to accommodate larger content and images.</li></ul></div></div><div class=\"row align-items-center border-top border-1 pt-4\"><div class=\"col-md-6 col-lg-7 mb-3\"><h2 class=\"mb-3\">Core Updates</h2><h3>Mail Template Layout</h3><p>Take it a step further by creating an entirely unique layout (including logo) which can be applied to one or all mail templates.</p><p>From <span class=\"fw-medium\">Global Configuration -&gt; Mail Templates</span>, layouts can be defined in HTML.</p><h3>Other Enhancements and Fixes</h3><ul class=\"mb-3\"><li>Nested Subforms - Allows the nesting of Subform inside a Subform Custom Field</li><li>Total Count - The count and total number of list items</li></ul></div><div class=\"col-md-6 col-lg-5\"><img class=\"img-fluid\" src=\"media/com_guidedtours/images/5_2/mailtemplate.png\" alt=\"Mail template example, including a header logo and a footer\" width=\"640\" height=\"370\" loading=\"lazy\"></div></div>"
COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_TITLE = "What’s New in Joomla 5.2!"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_DESCRIPTION = "<h3>Joomla 5.2 Full Release Notes</h3><p><a title=\"Click to view full release notes\" href=\"https://www.joomla.org/announcements.html\" target=\"_blank\" rel=\"noopener\">View the full release notes on joomla.org</a></p><hr><h3>Help and Information</h3><p>Many resources to help you can be found here together with additional links to more resources, documentation, support and how to become involved in Joomla.</p>"
COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_TITLE = "More Information and Help"
1 change: 1 addition & 0 deletions administrator/language/en-GB/plg_system_guidedtours.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PLG_SYSTEM_GUIDEDTOURS_COMPLETE="Complete"
PLG_SYSTEM_GUIDEDTOURS_COULD_NOT_LOAD_THE_TOUR="Could not start the tour. No valid ID given."
PLG_SYSTEM_GUIDEDTOURS_DESCRIPTION="System Guided Tour Plugin"
PLG_SYSTEM_GUIDEDTOURS_HIDE_FOREVER="Hide Forever"
PLG_SYSTEM_GUIDEDTOURS_LEARN_MORE="Learn More"
PLG_SYSTEM_GUIDEDTOURS_NEXT="Next"
PLG_SYSTEM_GUIDEDTOURS_START="Start"
PLG_SYSTEM_GUIDEDTOURS_STEP_NUMBER_OF="Step {number} of {total}" ; Do not translate the text between the {}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 30 additions & 6 deletions plugins/system/guidedtours/src/Extension/GuidedTours.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,15 @@ private function processTour($item)
$temp->id = 0;
$temp->title = $this->getApplication()->getLanguage()->_($item->title);
$temp->description = $this->getApplication()->getLanguage()->_($item->description);
$temp->description = $this->fixImagePaths($temp->description);
$temp->url = $item->url;

// Replace 'images/' to '../images/' when using an image from /images in backend.
$temp->description = preg_replace('*src\=\"(?!administrator\/)images/*', 'src="../images/', $temp->description);

// Set the start label for the tour.
$temp->start_label = Text::_('PLG_SYSTEM_GUIDEDTOURS_START');
// What's new tours have a different label.
if (str_contains($item->uid, 'joomla-whatsnew')) {
$temp->start_label = Text::_('PLG_SYSTEM_GUIDEDTOURS_LEARN_MORE');
}

$tour->steps[] = $temp;

Expand All @@ -342,6 +344,7 @@ private function processTour($item)
$temp->id = $i + 1;
$temp->title = $this->getApplication()->getLanguage()->_($step->title);
$temp->description = $this->getApplication()->getLanguage()->_($step->description);
$temp->description = $this->fixImagePaths($temp->description);
$temp->position = $step->position;
$temp->target = $step->target;
$temp->type = $this->stepType[$step->type];
Expand All @@ -351,12 +354,33 @@ private function processTour($item)
$temp->tour_id = $step->tour_id;
$temp->step_id = $step->id;

// Replace 'images/' to '../images/' when using an image from /images in backend.
$temp->description = preg_replace('*src\=\"(?!administrator\/)images/*', 'src="../images/', $temp->description);

$tour->steps[] = $temp;
}

return $tour;
}

/**
* Return a modified version of a given string with usable image paths for tours
*
* @param string $description The string to fix
*
* @return string
*
* @since __DEPLOY_VERSION__
*/
private function fixImagePaths($description)
{
return preg_replace(
[
'*src=\"(?!administrator\/)images/*',
'*src=\"media/*',
obuisard marked this conversation as resolved.
Show resolved Hide resolved
],
[
'src="../images/',
'src="../media/',
],
$description
);
}
}