Skip to content

Commit 52d9fcc

Browse files
mfleesonheelc29laoneodgrammatikosandewt
authored
End of Support Plugin for Joomla 4.4 (#40565)
* End of Support Plugin for Joomla 4.4 * Update mysql/base.sql - missing , * Update plugins/quickicon/eos/src/Extension/Eos.php Co-authored-by: heelc29 <[email protected]> * Update plugins/quickicon/eos/src/Extension/Eos.php Co-authored-by: heelc29 <[email protected]> * Update plugins/quickicon/eos/src/Extension/Eos.php Co-authored-by: heelc29 <[email protected]> * Update plugins/quickicon/eos/src/Extension/Eos.php Co-authored-by: heelc29 <[email protected]> * Update plugins/quickicon/eos/src/Extension/Eos.php Co-authored-by: heelc29 <[email protected]> * Update plugins/quickicon/eos/services/provider.php Co-authored-by: Allon Moritz <[email protected]> * Update plugins/quickicon/eos/services/provider.php Co-authored-by: Allon Moritz <[email protected]> * All requested changes made. Lets see what happens! * Removed __construct, followed Dimitris and JSanders suggestions * PHPCs fix again * Update Eos.php * Update provider.php * Update plugins/quickicon/eos/src/Extension/Eos.php Co-authored-by: Dimitris Grammatikogiannis <[email protected]> * Update plugins/quickicon/eos/services/provider.php Co-authored-by: jsanders <[email protected]> * Update provider.php * Update plugins/quickicon/eos/src/Extension/Eos.php Co-authored-by: jsanders <[email protected]> * Update to all files to get almost clean PR. Do not Review this one, wait for next please. Some files are showing in git some are not so this is all 10 files updated to the correct code. The next release will remove the extra spaces in this release which I've added to make sure all 10 files upload. Please do not review this PR but wait for the next one in about 10 mins. * Ready for checking. Here's the files ready for checking. * Updating GetMessageInfo in Eos to correctly just return an array * Changing Const from Public to Private * Updates to set language to only load when needed. Fix to allow building Fix from #40565 (comment) * Update stats-message.es6.js * Update stats-message.es6.js * Update Eos.php - set hardcoded date to 2025-10-25 * Update stats-message.es6.js - revert changes --------- Co-authored-by: heelc29 <[email protected]> Co-authored-by: Allon Moritz <[email protected]> Co-authored-by: Dimitris Grammatikogiannis <[email protected]> Co-authored-by: jsanders <[email protected]> Co-authored-by: Richard Fath <[email protected]> Co-authored-by: Martin Carl Kopp <[email protected]>
1 parent 075301d commit 52d9fcc

File tree

11 files changed

+492
-0
lines changed

11 files changed

+492
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES
2+
(0, 'plg_quickicon_eos', 'plugin', 'eos', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 7, 0);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES
2+
(0, 'plg_quickicon_eos', 'plugin', 'eos', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 7, 0);
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
; Joomla! Project
2+
; (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
3+
; License GNU General Public License version 2 or later; see LICENSE.txt
4+
; Note : All ini files need to be saved as UTF-8
5+
6+
PLG_QUICKICON_EOS="Quick Icon - Joomla! End Of Support Notification"
7+
PLG_QUICKICON_EOS_GROUPNAME_EOS="End Of Support"
8+
PLG_QUICKICON_EOS_GROUPNAME_INFO="Upgrade Information"
9+
PLG_QUICKICON_EOS_GROUPNAME_WARNING="Support Status"
10+
PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED="<p>Support has ended for your version of Joomla. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Migrate to the next version</a> as soon as possible.</p>"
11+
PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED_SHORT="Support has ended for your version of Joomla <span class=\"icon-new-tab\"></span>"
12+
PLG_QUICKICON_EOS_MESSAGE_INFO_01="<p>The latest version of Joomla has arrived! Find out all that it has to offer you. Check the landing page for <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">its features</a> and improvements.</p>"
13+
PLG_QUICKICON_EOS_MESSAGE_INFO_01_SHORT="The latest version of Joomla has arrived! <span class=\"icon-new-tab\"></span>"
14+
PLG_QUICKICON_EOS_MESSAGE_INFO_02="<p>When is the time to migrate to the next version? Once the extensions your site needs are compatible. Learn <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">how to use the Pre-Update Checker</a>. </p>"
15+
PLG_QUICKICON_EOS_MESSAGE_INFO_02_SHORT="Use Pre-Update Check for extension compatibility <span class=\"icon-new-tab\"></span>"
16+
PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY="<p>This version of Joomla has entered security only mode. Support ends %1$s. Start <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">planning to migrate</a> to the next version of Joomla today.</p>"
17+
PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY_SHORT="This version of Joomla ends support on %1$s. <span class=\"icon-new-tab\"></span>"
18+
PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING="<p>Support ends on %1$s for this version of Joomla. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Migrate to the latest version of Joomla</a> as soon as possible.</p>"
19+
PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING_SHORT="End of support for this version of Joomla on %1$s. <span class=\"icon-new-tab\"></span>"
20+
PLG_QUICKICON_EOS_SNOOZE_BUTTON="Snooze this message for all users"
21+
PLG_QUICKICON_EOS_XML_DESCRIPTION="Checks for the end of support status of Joomla and notifies you when visiting the Control Panel page."
22+
; Below is a copy of the 3.10 text definitions for reference.
23+
PLG_QUICKICON_EOS310="Quick Icon - Joomla 3.10 End Of Support Notification"
24+
PLG_QUICKICON_EOS310_GROUPNAME_EOS="End Of Support"
25+
PLG_QUICKICON_EOS310_GROUPNAME_INFO="Upgrade Information"
26+
PLG_QUICKICON_EOS310_GROUPNAME_WARNING="Support Status"
27+
PLG_QUICKICON_EOS310_MESSAGE_ERROR_SUPPORT_ENDED="<p>Support has ended for your version of Joomla 3.10. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Migrate to Joomla 4</a> <span class=\"icon-new-tab\"></span>as soon as possible.</p>"
28+
PLG_QUICKICON_EOS310_MESSAGE_ERROR_SUPPORT_ENDED_SHORT="Support has ended for Joomla 3.10 <span class=\"icon-new-tab\"></span>"
29+
PLG_QUICKICON_EOS310_MESSAGE_INFO_01="<p>Joomla 4 has arrived! Find out all that Joomla 4 has to offer you. Check the landing page for <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Joomla 4 features</a> <span class=\"icon-new-tab\"></span>and improvements.</p>"
30+
PLG_QUICKICON_EOS310_MESSAGE_INFO_01_SHORT="Joomla 4 has arrived! <span class=\"icon-new-tab\"></span>"
31+
PLG_QUICKICON_EOS310_MESSAGE_INFO_02="<p>When is the time to migrate to Joomla 4? Once the extensions your site needs are compatible. Learn <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">how to use the Pre-Update Checker</a>. <span class=\"icon-new-tab\"></span></p>"
32+
PLG_QUICKICON_EOS310_MESSAGE_INFO_02_SHORT="Use Pre-Update Check for extension compatibility <span class=\"icon-new-tab\"></span>"
33+
PLG_QUICKICON_EOS310_MESSAGE_WARNING_SECURITY_ONLY="<p>Joomla 3.10 has entered security only mode. Support ends %1$s. Start <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">planning to migrate</a> <span class=\"icon-new-tab\"></span>to Joomla 4 today.</p>"
34+
PLG_QUICKICON_EOS310_MESSAGE_WARNING_SECURITY_ONLY_SHORT="Joomla 3.10 to end support on %1$s. <span class=\"icon-new-tab\"></span>"
35+
PLG_QUICKICON_EOS310_MESSAGE_WARNING_SUPPORT_ENDING="<p>Support ends on %1$s for Joomla 3.10. <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">Migrate to Joomla 4</a> <span class=\"icon-new-tab\"></span>as soon as possible.</p>"
36+
PLG_QUICKICON_EOS310_MESSAGE_WARNING_SUPPORT_ENDING_SHORT="End of support for Joomla 3.10 on %1$s. <span class=\"icon-new-tab\"></span>"
37+
PLG_QUICKICON_EOS310_SNOOZE_BUTTON="Snooze this message for all users"
38+
PLG_QUICKICON_EOS310_XML_DESCRIPTION="Checks for the end of support status of Joomla 3.10 and notifies you when visiting the Control Panel page."
39+
;All of this text is currently being written for Joomla 5 by Phil Watson and Jenn Gress. TODO
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
; Joomla! Project
2+
; (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
3+
; License GNU General Public License version 2 or later; see LICENSE.txt
4+
; Note : All ini files need to be saved as UTF-8
5+
6+
PLG_QUICKICON_EOS="Quick Icon - Joomla! End Of Support Notification"
7+
PLG_QUICKICON_EOS_XML_DESCRIPTION="Checks for the end of support status of Joomla and places a notification on the Control Panel page."
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* @package Joomla.Plugin
3+
* @subpackage Quickicon.eos
4+
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
5+
* @license GNU General Public License version 2 or later; see LICENSE.txt
6+
*/
7+
if (!Joomla) {
8+
throw new Error('Joomla API is not properly initialised');
9+
}
10+
11+
const url = new URL(`${Joomla.getOptions('system.paths').baseFull}index.php?option=com_ajax&group=quickicon&plugin=eos&format=json`);
12+
13+
async function onMutatedMessagesContainer(mutationList, observer) {
14+
// eslint-disable-next-line no-restricted-syntax
15+
for (const mutation of mutationList) {
16+
const nodes = Array.from(mutation.addedNodes);
17+
if (!nodes.length) {
18+
return;
19+
}
20+
21+
const alerts = nodes.filter((node) => node.querySelector('.eosnotify-snooze-btn'));
22+
if (!alerts.length) {
23+
return;
24+
}
25+
26+
observer.disconnect();
27+
alerts[0].querySelector('.eosnotify-snooze-btn').addEventListener('click', () => fetch(url, { headers: { 'X-CSRF-Token': Joomla.getOptions('csrf.token') || '' } })
28+
.then((response) => {
29+
if (response.ok) {
30+
alerts[0].closest('joomla-alert').close();
31+
}
32+
}));
33+
}
34+
}
35+
36+
const observer = new MutationObserver(onMutatedMessagesContainer);
37+
observer.observe(document.querySelector('#system-message-container'), { attributes: false, childList: true, subtree: true });

installation/sql/mysql/base.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`,
328328
(0, 'plg_quickicon_downloadkey', 'plugin', 'downloadkey', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 4, 0),
329329
(0, 'plg_quickicon_privacycheck', 'plugin', 'privacycheck', 'quickicon', 0, 1, 1, 0, 1, '', '{}', '', 5, 0),
330330
(0, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 6, 0),
331+
(0, 'plg_quickicon_eos', 'plugin', 'eos', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 7, 0),
331332
(0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 1, 0),
332333
(0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 2, 0),
333334
(0, 'plg_system_accessibility', 'plugin', 'accessibility', 'system', 0, 0, 1, 0, 1, '', '{}', '', 1, 0),

installation/sql/postgresql/base.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder",
334334
(0, 'plg_quickicon_downloadkey', 'plugin', 'downloadkey', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 4, 0),
335335
(0, 'plg_quickicon_privacycheck', 'plugin', 'privacycheck', 'quickicon', 0, 1, 1, 0, 1, '', '{}', '', 5, 0),
336336
(0, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 6, 0),
337+
(0, 'plg_quickicon_eos', 'plugin', 'eos', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 7, 0),
337338
(0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 1, 0),
338339
(0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 2, 0),
339340
(0, 'plg_system_accessibility', 'plugin', 'accessibility', 'system', 0, 0, 1, 0, 1, '', '{}', '', 1, 0),

libraries/src/Extension/ExtensionHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ class ExtensionHelper
273273
['plugin', 'overridecheck', 'quickicon', 0],
274274
['plugin', 'phpversioncheck', 'quickicon', 0],
275275
['plugin', 'privacycheck', 'quickicon', 0],
276+
['plugin', 'eos', 'quickicon', 0],
276277

277278
// Core plugin extensions - sample data
278279
['plugin', 'blog', 'sampledata', 0],

plugins/quickicon/eos/eos.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extension type="plugin" group="quickicon" method="upgrade">
3+
<name>plg_quickicon_eos</name>
4+
<author>Joomla! Project</author>
5+
<creationDate>2023-05</creationDate>
6+
<copyright>(C) 2023 Open Source Matters, Inc.</copyright>
7+
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
8+
<authorEmail>[email protected]</authorEmail>
9+
<authorUrl>www.joomla.org</authorUrl>
10+
<version>4.4.0</version>
11+
<description>PLG_QUICKICON_EOS_XML_DESCRIPTION</description>
12+
<namespace path="src">Joomla\Plugin\Quickicon\Eos</namespace>
13+
<files>
14+
<folder plugin="eos">services</folder>
15+
<folder>src</folder>
16+
</files>
17+
<languages>
18+
<language tag="en-GB">language/en-GB/plg_quickicon_eos.ini</language>
19+
<language tag="en-GB">language/en-GB/plg_quickicon_eos.sys.ini</language>
20+
</languages>
21+
<config>
22+
<fields name="params">
23+
<fieldset name="basic">
24+
<field
25+
name="last_snoozed_id"
26+
type="hidden"
27+
/>
28+
</fieldset>
29+
</fields>
30+
</config>
31+
</extension>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
/**
4+
* @package Joomla.Plugin
5+
* @subpackage Quickicon.eos
6+
*
7+
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
8+
* @license GNU General Public License version 2 or later; see LICENSE.txt
9+
*/
10+
11+
defined('_JEXEC') or die;
12+
13+
use Joomla\CMS\Extension\PluginInterface;
14+
use Joomla\CMS\Factory;
15+
use Joomla\CMS\Plugin\PluginHelper;
16+
use Joomla\Database\DatabaseInterface;
17+
use Joomla\DI\Container;
18+
use Joomla\DI\ServiceProviderInterface;
19+
use Joomla\Event\DispatcherInterface;
20+
use Joomla\Plugin\Quickicon\Eos\Extension\Eos;
21+
22+
return new class () implements ServiceProviderInterface {
23+
/**
24+
* Registers the service provider with a DI container.
25+
*
26+
* @param Container $container The DI container.
27+
*
28+
* @return void
29+
*
30+
* @since __DEPLOY_VERSION__
31+
*
32+
* @throws Exception
33+
*/
34+
public function register(Container $container): void
35+
{
36+
$container->set(
37+
PluginInterface::class,
38+
function (Container $container) {
39+
$dispatcher = $container->get(DispatcherInterface::class);
40+
$plugin = new Eos(
41+
$dispatcher,
42+
(array) PluginHelper::getPlugin('quickicon', 'eos')
43+
);
44+
$plugin->setApplication(Factory::getApplication());
45+
$plugin->setDatabase($container->get(DatabaseInterface::class));
46+
47+
return $plugin;
48+
}
49+
);
50+
}
51+
};

0 commit comments

Comments
 (0)