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 15 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 IGNORE 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 IGNORE 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);
obuisard marked this conversation as resolved.
Show resolved Hide resolved
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) ON CONFLICT DO NOTHING;
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) ON CONFLICT DO NOTHING;
obuisard marked this conversation as resolved.
Show resolved Hide resolved
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-4 col-xl-3 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=\"415\" height=\"411\"></div><div class=\"col-md-6 col-lg-8 col-xl-9\"><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-8 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-4\"><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=\"689\" height=\"378\" 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 class=\"text-underline\" 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>"
obuisard marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -8,6 +8,7 @@ PLG_SYSTEM_GUIDEDTOURS_BACK="Back"
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_LEARNMORE="Learn More"
obuisard marked this conversation as resolved.
Show resolved Hide resolved
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.
32 changes: 26 additions & 6 deletions plugins/system/guidedtours/src/Extension/GuidedTours.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,9 @@ 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);

$tour->steps[] = $temp;

foreach ($steps as $i => $step) {
Expand All @@ -267,6 +265,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 @@ -276,12 +275,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
);
}
}