JoomlaPolska / jezyk-J4

Język polski dla Joomla 4
GNU General Public License v2.0
3 stars 5 forks source link

EOS - Plugin Disabling Quick Icon Display and adding correct text definitions #368

Closed joomlapl-bot closed 12 months ago

joomlapl-bot commented 1 year ago

PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/40774 Poniżej zmiany w oryginale:

Click to expand the diff! ```diff diff --git a/administrator/language/en-GB/plg_quickicon_eos.ini b/administrator/language/en-GB/plg_quickicon_eos.ini index f4af7d0ce768..2a47e0fe6e5b 100644 --- a/administrator/language/en-GB/plg_quickicon_eos.ini +++ b/administrator/language/en-GB/plg_quickicon_eos.ini @@ -3,37 +3,11 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt ; Note : All ini files need to be saved as UTF-8 -PLG_QUICKICON_EOS="Quick Icon - Joomla! End Of Support Notification" -PLG_QUICKICON_EOS_GROUPNAME_EOS="End Of Support" -PLG_QUICKICON_EOS_GROUPNAME_INFO="Upgrade Information" -PLG_QUICKICON_EOS_GROUPNAME_WARNING="Support Status" -PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED="

Support has ended for your version of Joomla. Migrate to the next version as soon as possible.

" -PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED_SHORT="Support has ended for your version of Joomla " -PLG_QUICKICON_EOS_MESSAGE_INFO_01="

The latest version of Joomla has arrived! Find out all that it has to offer you. Check the landing page for its features and improvements.

" -PLG_QUICKICON_EOS_MESSAGE_INFO_01_SHORT="The latest version of Joomla has arrived! " -PLG_QUICKICON_EOS_MESSAGE_INFO_02="

When is the time to migrate to the next version? Once the extensions your site needs are compatible. Learn how to use the Pre-Update Checker.

" -PLG_QUICKICON_EOS_MESSAGE_INFO_02_SHORT="Use Pre-Update Check for extension compatibility " -PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY="

This version of Joomla has entered security only mode. Support ends %1$s. Start planning to migrate to the next version of Joomla today.

" -PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY_SHORT="This version of Joomla ends support on %1$s. " -PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING="

Support ends on %1$s for this version of Joomla. Migrate to the latest version of Joomla as soon as possible.

" -PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING_SHORT="End of support for this version of Joomla on %1$s. " +PLG_QUICKICON_EOS="Quick Icon - Joomla 4.4 End Of Support Notification" +PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED="

Support has ended for your version of Joomla 4.4. Upgrade to Joomla 5 as soon as possible.

" +PLG_QUICKICON_EOS_MESSAGE_INFO_01="

Joomla 5 has arrived! Find out all that Joomla 5 has to offer you. Check the landing page for Joomla 5 features and improvements.

" +PLG_QUICKICON_EOS_MESSAGE_INFO_02="

When is the time to upgrade to Joomla 5? Once the extensions your site needs are compatible. Learn how to use the Pre-Update Checker.

" +PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY="

Joomla 4.4 has entered security only mode. Support ends %1$s. Start planning to upgrade to Joomla 5 today.

" +PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING="

Support ends on %1$s for Joomla 4.4 Upgrade to Joomla 5 as soon as possible.

" PLG_QUICKICON_EOS_SNOOZE_BUTTON="Snooze this message for all users" -PLG_QUICKICON_EOS_XML_DESCRIPTION="Checks for the end of support status of Joomla and notifies you when visiting the Control Panel page." -; Below is a copy of the 3.10 text definitions for reference. -PLG_QUICKICON_EOS310="Quick Icon - Joomla 3.10 End Of Support Notification" -PLG_QUICKICON_EOS310_GROUPNAME_EOS="End Of Support" -PLG_QUICKICON_EOS310_GROUPNAME_INFO="Upgrade Information" -PLG_QUICKICON_EOS310_GROUPNAME_WARNING="Support Status" -PLG_QUICKICON_EOS310_MESSAGE_ERROR_SUPPORT_ENDED="

Support has ended for your version of Joomla 3.10. Migrate to Joomla 4 as soon as possible.

" -PLG_QUICKICON_EOS310_MESSAGE_ERROR_SUPPORT_ENDED_SHORT="Support has ended for Joomla 3.10 " -PLG_QUICKICON_EOS310_MESSAGE_INFO_01="

Joomla 4 has arrived! Find out all that Joomla 4 has to offer you. Check the landing page for Joomla 4 features and improvements.

" -PLG_QUICKICON_EOS310_MESSAGE_INFO_01_SHORT="Joomla 4 has arrived! " -PLG_QUICKICON_EOS310_MESSAGE_INFO_02="

When is the time to migrate to Joomla 4? Once the extensions your site needs are compatible. Learn how to use the Pre-Update Checker.

" -PLG_QUICKICON_EOS310_MESSAGE_INFO_02_SHORT="Use Pre-Update Check for extension compatibility " -PLG_QUICKICON_EOS310_MESSAGE_WARNING_SECURITY_ONLY="

Joomla 3.10 has entered security only mode. Support ends %1$s. Start planning to migrate to Joomla 4 today.

" -PLG_QUICKICON_EOS310_MESSAGE_WARNING_SECURITY_ONLY_SHORT="Joomla 3.10 to end support on %1$s. " -PLG_QUICKICON_EOS310_MESSAGE_WARNING_SUPPORT_ENDING="

Support ends on %1$s for Joomla 3.10. Migrate to Joomla 4 as soon as possible.

" -PLG_QUICKICON_EOS310_MESSAGE_WARNING_SUPPORT_ENDING_SHORT="End of support for Joomla 3.10 on %1$s. " -PLG_QUICKICON_EOS310_SNOOZE_BUTTON="Snooze this message for all users" -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." -;All of this text is currently being written for Joomla 5 by Phil Watson and Jenn Gress. TODO +PLG_QUICKICON_EOS_XML_DESCRIPTION="Checks for the end of support status of Joomla 4.4 and notifies you when visiting the Control Panel page." diff --git a/plugins/quickicon/eos/src/Extension/Eos.php b/plugins/quickicon/eos/src/Extension/Eos.php index 0cc7beec9bef..a269585b9995 100644 --- a/plugins/quickicon/eos/src/Extension/Eos.php +++ b/plugins/quickicon/eos/src/Extension/Eos.php @@ -82,11 +82,10 @@ public static function getSubscribedEvents(): array } /** - * Check and show the the alert and quickicon message. + * Check and show the the alert. * * This method is called when the Quick Icons module is constructing its set - * of icons. You can return an array which defines a single icon and it will - * be rendered right after the stock Quick Icons. + * of icons. * * @param QuickIconsEvent $event The event object * @@ -128,27 +127,6 @@ public function getEndOfServiceNotification(QuickIconsEvent $event): void $app->getDocument()->getWebAssetManager() ->registerAndUseScript('plg_quickicon_eos.script', 'plg_quickicon_eos/snooze.js', [], ['type' => 'module']); - - $result = $event->getArgument('result', []); - $messageTextQuickIcon = sprintf( - $app->getLanguage()->_($this->currentMessage['quickiconText']), - HTMLHelper::_('date', Eos::EOS_DATE, $app->getLanguage()->_('DATE_FORMAT_LC3')) - ); - - // The message as quickicon - - $result[] = [ - [ - 'link' => $this->currentMessage['messageLink'], - 'image' => $this->currentMessage['image'], - 'text' => $messageTextQuickIcon, - 'id' => 'plg_quickicon_eos', - 'group' => $this->currentMessage['groupText'], - 'class' => $this->currentMessage['messageType'], - ], - ]; - - $event->setArgument('result', $result); } /** @@ -209,70 +187,55 @@ private function getMessageInfo(int $monthsUntilEOS, int $inverted): array // The EOS date has passed - Support has ended if ($inverted === 1) { return [ - 'id' => 5, - 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED', - 'quickiconText' => 'PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED_SHORT', - 'messageType' => 'error', - 'image' => 'fa fa-life-ring', - 'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Planning_for_Mini-Migration_-_Joomla_3.10.x_to_4.x', - 'groupText' => 'PLG_QUICKICON_EOS_GROUPNAME_EOS', - 'snoozable' => false, + 'id' => 5, + 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED', + 'messageType' => 'error', + 'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_4.4.x_to_5.x_Planning_and_Upgrade_Step_by_Step', + 'snoozable' => false, ]; } // The security support is ending in 6 months if ($monthsUntilEOS < 6) { return [ - 'id' => 4, - 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING', - 'quickiconText' => 'PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING_SHORT', - 'messageType' => 'warning', - 'image' => 'fa fa-life-ring', - 'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Planning_for_Mini-Migration_-_Joomla_3.10.x_to_4.x', - 'groupText' => 'PLG_QUICKICON_EOS_GROUPNAME_WARNING', - 'snoozable' => true, + 'id' => 4, + 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING', + 'messageType' => 'warning', + 'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_4.4.x_to_5.x_Planning_and_Upgrade_Step_by_Step', + 'snoozable' => true, ]; } // We are in security only mode now, 12 month to go from now on if ($monthsUntilEOS < 12) { return [ - 'id' => 3, - 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY', - 'quickiconText' => 'PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY_SHORT', - 'messageType' => 'warning', - 'image' => 'fa fa-life-ring', - 'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Planning_for_Mini-Migration_-_Joomla_3.10.x_to_4.x', - 'groupText' => 'PLG_QUICKICON_EOS_GROUPNAME_WARNING', - 'snoozable' => true, + 'id' => 3, + 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY', + 'messageType' => 'warning', + 'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_4.4.x_to_5.x_Planning_and_Upgrade_Step_by_Step', + 'snoozable' => true, ]; } // We still have 16 month to go, lets remind our users about the pre upgrade checker if ($monthsUntilEOS < 16) { return [ - 'id' => 2, - 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_INFO_02', - 'quickiconText' => 'PLG_QUICKICON_EOS_MESSAGE_INFO_02_SHORT', - 'messageType' => 'info', - 'image' => 'fa fa-life-ring', - 'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Pre-Update_Check', - 'groupText' => 'PLG_QUICKICON_EOS_GROUPNAME_INFO', - 'snoozable' => true, + 'id' => 2, + 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_INFO_02', + 'messageType' => 'info', + 'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Pre-Update_Check', + 'snoozable' => true, ]; } // Lets start our messages 2 month after the initial release, still 22 month to go if ($monthsUntilEOS < 22) { return [ - 'id' => 1, - 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_INFO_01', - 'quickiconText' => 'PLG_QUICKICON_EOS_MESSAGE_INFO_01_SHORT', - 'messageType' => 'info', - 'image' => 'fa fa-life-ring', - 'messageLink' => 'https://www.joomla.org/4/#features', - 'groupText' => 'PLG_QUICKICON_EOS_GROUPNAME_INFO', - 'snoozable' => true, + 'id' => 1, + 'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_INFO_01', + 'messageType' => 'info', + 'messageLink' => 'https://joomla.org/5', + 'snoozable' => true, ]; } ```