33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-23 03:19:00 +00:00

Merge pull request #264 from mtmeyrick/master

Link to Patch Tester after installation
This commit is contained in:
Roland Dalmulder 2020-04-12 15:04:28 +02:00 committed by GitHub
commit b5dfe5d3f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 73 additions and 1 deletions

View File

@ -7,3 +7,7 @@ COM_PATCHTESTER="Joomla! Patch Tester"
COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES="Could not install the template overrides for the following templates: %s"
COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES="Could not remove the template overrides for the following templates: %s"
COM_PATCHTESTER_XML_DESCRIPTION="Component for pull request management testing"
COM_PATCHTESTER_UPDATE_TEXT="Patch Tester Update script. Patch Tester now updated to version %s."
COM_PATCHTESTER_INSTALL_INSTRUCTIONS="<p>Thank you for installing the Joomla! Patch Tester.</p><p>To use the Joomla! Patch Tester you first need to setup your GitHub credentials in the Joomla! Patch Tester Options. <a href=""index.php?option=com_config&view=component&component=com_patchtester&returnurl=aW5kZXgucGhwP29wdGlvbj1jb21fcGF0Y2h0ZXN0ZXI=#authentication"" alt="Go to Options">Go to the Joomla! Patch Tester Options</a> to setup your credentials. After clicking on Save & Close you will be taken to the Joomla! Patch Tester where you can start using the Patch Tester."
COM_PATCHTESTER_UPDATE_INSTRUCTIONS="<p>Thank you for updating the Joomla! Patch Tester.</p><p><a href=""index.php?option=com_patchtester"" alt="Go to Patch Tester">Go to the Joomla! Patch Tester</a></p>"
COM_PATCHTESTER_UNINSTALL_THANK_YOU="Thank you for using the Joomla! Patch Tester for testing patches for the latest version of Joomla!"

View File

@ -6,8 +6,11 @@
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
use Joomla\CMS\Installer\InstallerScript;
use Joomla\CMS\Language\Text;
/**
* Installation class to perform additional changes during install/uninstall/update
@ -16,6 +19,7 @@ use Joomla\CMS\Installer\InstallerScript;
*/
class Com_PatchtesterInstallerScript extends InstallerScript
{
/**
* Extension script constructor.
*
@ -34,6 +38,70 @@ class Com_PatchtesterInstallerScript extends InstallerScript
'/administrator/components/com_patchtester/PatchTester/Table',
'/components/com_patchtester',
);
Factory::getApplication()
->getLanguage()
->load('com_patchtester.sys', JPATH_ADMINISTRATOR, null, true);
}
/**
* Show the message on install.
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 4.0.0
*/
public function install(ComponentAdapter $parent): void
{
?>
<h1>
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
<?php echo Text::_('COM_PATCHTESTER'); ?>
</h1>
<p><?php echo Text::_('COM_PATCHTESTER_INSTALL_INSTRUCTIONS'); ?></p>
<?php
}
/**
* Show the message on install.
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 4.0.0
*/
public function update(ComponentAdapter $parent): void
{
?>
<h1>
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
<?php echo Text::_('COM_PATCHTESTER'); ?>
</h1>
<p><?php echo Text::_('COM_PATCHTESTER_UPDATE_INSTRUCTIONS'); ?></p>
<?php
}
/**
* Show the message on install.
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 4.0.0
*/
public function uninstall(ComponentAdapter $parent): void
{
?>
<h1>
<?php echo HTMLHelper::_('image', 'media/com_patchtester/images/icon-48-patchtester.png', Text::_('COM_PATCHTESTER')); ?>
</h1>
<p><?php echo Text::_('COM_PATCHTESTER_UNINSTALL_THANK_YOU'); ?></p>
<?php
}
/**
@ -46,7 +114,7 @@ class Com_PatchtesterInstallerScript extends InstallerScript
*
* @since 3.0.0
*/
public function postflight($type, $parent)
public function postflight(string $type, ComponentAdapter $parent): void
{
$this->removeFiles();
}