Skip to content

Commit

Permalink
Remove atum template
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
  • Loading branch information
roland-d committed Apr 4, 2020
1 parent 4e759d9 commit 73f0781
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 390 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
123 changes: 0 additions & 123 deletions administrator/components/com_patchtester/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,14 +16,6 @@
*/
class Com_PatchtesterInstallerScript extends InstallerScript
{
/**
* Array of templates with supported overrides
*
* @var array
* @since 2.0
*/
protected $templateOverrides = array('atum');

/**
* Extension script constructor.
*
Expand All @@ -51,73 +40,6 @@ public function __construct()
);
}

/**
* 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
*
Expand All @@ -132,49 +54,4 @@ public function postflight($type, $parent)
{
$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)));
}
}
}

This file was deleted.

163 changes: 0 additions & 163 deletions administrator/templates/atum/html/com_patchtester/pulls/default.php

This file was deleted.

Loading

0 comments on commit 73f0781

Please sign in to comment.