From 73f07810f2a428df762d2b888bf26d34fb6e08dd Mon Sep 17 00:00:00 2001 From: Roland Dalmulder Date: Sat, 4 Apr 2020 09:00:19 +0200 Subject: [PATCH] Remove atum template Signed-off-by: Roland Dalmulder --- .../en-GB/en-GB.com_patchtester.sys.ini | 2 - .../components/com_patchtester/script.php | 123 ------------- .../html/com_patchtester/fetch/default.php | 28 --- .../html/com_patchtester/pulls/default.php | 163 ------------------ .../com_patchtester/pulls/default_items.php | 72 -------- build/patchtester/build.sh | 2 - 6 files changed, 390 deletions(-) delete mode 100644 administrator/templates/atum/html/com_patchtester/fetch/default.php delete mode 100644 administrator/templates/atum/html/com_patchtester/pulls/default.php delete mode 100644 administrator/templates/atum/html/com_patchtester/pulls/default_items.php diff --git a/administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.sys.ini b/administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.sys.ini index e418c57..38ed319 100644 --- a/administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.sys.ini +++ b/administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.sys.ini @@ -4,6 +4,4 @@ ; Note : All ini files need to be saved as UTF-8 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" diff --git a/administrator/components/com_patchtester/script.php b/administrator/components/com_patchtester/script.php index ccfcb74..aef50e7 100644 --- a/administrator/components/com_patchtester/script.php +++ b/administrator/components/com_patchtester/script.php @@ -6,11 +6,8 @@ * @license GNU General Public License version 2 or later */ -use Joomla\CMS\Factory; -use Joomla\CMS\Filesystem\Folder; 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 @@ -19,14 +16,6 @@ use Joomla\CMS\Language\Text; */ class Com_PatchtesterInstallerScript extends InstallerScript { - /** - * Array of templates with supported overrides - * - * @var array - * @since 2.0 - */ - protected $templateOverrides = array('atum'); - /** * Extension script constructor. * @@ -51,73 +40,6 @@ class Com_PatchtesterInstallerScript extends InstallerScript ); } - /** - * Function to perform changes during install - * - * @param ComponentAdapter $parent The class calling this method - * - * @return void - * - * @since 2.0 - */ - public function install($parent) - { - $this->copyLayouts(); - } - - /** - * Function to perform changes during update - * - * @param ComponentAdapter $parent The class calling this method - * - * @return void - * - * @since 2.0 - */ - public function update($parent) - { - $this->copyLayouts(); - } - - /** - * Function to perform changes during uninstall - * - * @param ComponentAdapter $parent The class calling this method - * - * @return void - * - * @since 2.0 - */ - public function uninstall($parent) - { - // Initialize the error array - $errorTemplates = array(); - - // Loop the supported templates - foreach ($this->templateOverrides as $template) - { - // Set the file paths - $tmplRoot = JPATH_ADMINISTRATOR . '/templates/' . $template; - $overrideFolder = JPATH_ADMINISTRATOR . '/templates/' . $template . '/html/com_patchtester'; - - // Make sure the template is actually installed - if (is_dir($tmplRoot)) - { - // If there's a failure in copying the overrides, log it to the error array - if (Folder::delete($overrideFolder)) - { - $errorTemplates[] = ucfirst($template); - } - } - } - - // If we couldn't remove any overrides, notify the user - if (count($errorTemplates) > 0) - { - Factory::getApplication()->enqueueMessage(Text::sprintf('COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES', implode(', ', $errorTemplates))); - } - } - /** * Function to perform changes during postflight * @@ -132,49 +54,4 @@ class Com_PatchtesterInstallerScript extends InstallerScript { $this->removeFiles(); } - - /** - * Function to copy layout overrides for core templates at install or update - * - * @return void - * - * @since 2.0 - */ - private function copyLayouts() - { - // Initialize the error array - $errorTemplates = array(); - - // Loop the supported templates - foreach ($this->templateOverrides as $template) - { - // Set the file paths - $source = __DIR__ . '/' . $template; - $tmplRoot = JPATH_ADMINISTRATOR . '/templates/' . $template; - $destination = JPATH_ADMINISTRATOR . '/templates/' . $template . '/html/com_patchtester'; - - // Make sure the template is actually installed - if (is_dir($tmplRoot)) - { - // If there's a failure in copying the overrides, log it to the error array - try - { - if (Folder::copy($source, $destination, '', true)) - { - $errorTemplates[] = ucfirst($template); - } - } - catch (RuntimeException $exception) - { - $errorTemplates[] = ucfirst($template); - } - } - } - - // If we couldn't remove any overrides, notify the user - if (count($errorTemplates) > 0) - { - Factory::getApplication()->enqueueMessage(Text::sprintf('COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES', implode(', ', $errorTemplates))); - } - } } diff --git a/administrator/templates/atum/html/com_patchtester/fetch/default.php b/administrator/templates/atum/html/com_patchtester/fetch/default.php deleted file mode 100644 index b2a2b8f..0000000 --- a/administrator/templates/atum/html/com_patchtester/fetch/default.php +++ /dev/null @@ -1,28 +0,0 @@ - 'auto', 'relative' => true)); - -?> - -
-

-

-
-
-
- -
diff --git a/administrator/templates/atum/html/com_patchtester/pulls/default.php b/administrator/templates/atum/html/com_patchtester/pulls/default.php deleted file mode 100644 index 6467150..0000000 --- a/administrator/templates/atum/html/com_patchtester/pulls/default.php +++ /dev/null @@ -1,163 +0,0 @@ - true, - 'filterButton' => true, - 'defaultLimit' => Factory::getApplication()->get('list_limit', 20), - 'searchFieldSelector' => '#filter_search', - 'selectorFieldName' => 'client_id', - 'showSelector' => false, - 'orderFieldSelector' => '#list_fullordering', - 'showNoResults' => false, - 'noResultsText' => '', - 'formSelector' => '#adminForm', -); - -HTMLHelper::_('behavior.core'); -HTMLHelper::_('searchtools.form', '#adminForm', $searchToolsOptions); -HTMLHelper::_('stylesheet', 'com_patchtester/octicons.css', array('version' => '3.5.0', 'relative' => true)); -HTMLHelper::_('script', 'com_patchtester/patchtester.js', array('version' => 'auto', 'relative' => true)); - -$listOrder = $this->escape($this->state->get('list.fullordering', 'a.pull_id DESC')); -$listLimit = (int) ($this->state->get('list.limit')); -$filterApplied = $this->escape($this->state->get('filter.applied')); -$filterBranch = $this->escape($this->state->get('filter.branch')); -$filterRtc = $this->escape($this->state->get('filter.rtc')); -?> -
-
-
-
- -
- items)) : ?> -
- - -
- - - - - - - - - - - - - - - loadTemplate('items'); ?> - -
- , -
- - - - - - - - - - - -
- - - pagination->getListFooter(); ?> - - - - - -
-
-
-
-
diff --git a/administrator/templates/atum/html/com_patchtester/pulls/default_items.php b/administrator/templates/atum/html/com_patchtester/pulls/default_items.php deleted file mode 100644 index f9810ee..0000000 --- a/administrator/templates/atum/html/com_patchtester/pulls/default_items.php +++ /dev/null @@ -1,72 +0,0 @@ -items as $i => $item) : - $status = ''; - - if ($item->applied) : - $status = ' class="table-active"'; - endif; -?> -> - - pull_id; ?> - - - escape($item->title); ?> - -
-
- - - -
-
- - - -
- applied) : ?> -
- sha, 0, 10)); ?> -
- -
- - - escape($item->branch); ?> - - - is_rtc) : ?> - - - - - - - applied) : ?> - - - - - - - applied) : ?> - - - - - - -