Commit e2b5e0db authored by Benni Mack's avatar Benni Mack
Browse files

[TASK] Remove unused code

* The Configuration/ExtConf PHP class is never used and removed
* the file Command/TerCommand is empty and removed
* All plugin registration of ext_tables.php is moved to Configuration/TCA/Overrides
* Unused "locallang.php" is removed
parent 4f4fe900
Pipeline #9058 passed with stages
in 6 minutes and 32 seconds
<?php
namespace T3o\Ter\Configuration;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\SingletonInterface;
/**
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class ExtConf implements SingletonInterface
{
/**
* repository directory
*
* @var string
*/
protected $repositoryDir = '';
/**
* constructor of this class
* This method reads the global configuration and calls the setter methods.
*/
public function __construct()
{
// get global configuration
$extConf = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['ter'];
if (is_array($extConf) && count($extConf)) {
// call setter method foreach configuration entry
foreach ($extConf as $key => $value) {
$methodName = 'set' . ucfirst($key);
if (method_exists($this, $methodName)) {
$this->$methodName($value);
}
}
}
}
/**
* Returns the repositoryDir
*
* @return string $repositoryDir
*/
public function getRepositoryDir(): string
{
return $this->repositoryDir;
}
/**
* Sets the repositoryDir
*
* @param string $repositoryDir
*/
public function setRepositoryDir(string $repositoryDir)
{
$this->repositoryDir = rtrim($repositoryDir, '/') . '/';
}
}
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
// Remove the old "CODE", "Layout" and the "recursive" fields
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_pi1'] = 'layout,select_key,pages,recursive';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['ter_pi1'] = 'layout,select_key,pages,recursive';
// Add plugin and datasets
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['TER SOAP Server', $_EXTKEY . '_pi1'], 'list_type', $_EXTKEY);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(['TER SOAP Server', 'ter_pi1'], 'list_type', 'ter');
// Add static configuration files
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'resources/static/', 'TER Server');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('ter', 'resources/static/', 'TER Server');
......@@ -3,14 +3,12 @@ if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi1/class.tx_ter_pi1.php', '_pi1', 'list_type', 0);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43('ter', '', '_pi1', 'list_type', false);
// Register core version update task
if (TYPO3_MODE === 'BE') {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\Ter\Task\UpdateCurrentVersionListTask::class] = [
'extension' => $_EXTKEY,
'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:tx_ter_updateCurrentVersionListTask.name',
'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:tx_ter_updateCurrentVersionListTask.description',
'additionalFields' => ''
];
}
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\Ter\Task\UpdateCurrentVersionListTask::class] = [
'extension' => 'ter',
'title' => 'LLL:EXT:ter/locallang.xml:tx_ter_updateCurrentVersionListTask.name',
'description' => 'LLL:EXT:ter/locallang.xml:tx_ter_updateCurrentVersionListTask.description',
'additionalFields' => ''
];
......@@ -46,7 +46,6 @@ class tx_ter_pi1 extends AbstractPlugin
public function main($content, $conf)
{
$this->pi_initPIflexForm();
$this->conf = $conf;
$this->extensionsPID = $conf['pid'];
......
<?php
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Language labels for plugin 'tx_ter_pi1'
*
* This file is detected by the translation tool.
*/
$LOCAL_LANG = [
'default' => [],
'dk' => [],
'de' => [],
'no' => [],
'it' => [],
'fr' => [],
'es' => [],
'nl' => [],
'cz' => [],
'pl' => [],
'si' => [],
'fi' => [],
'tr' => [],
'se' => [],
'pt' => [],
'ru' => [],
'ro' => [],
];
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment