...
  View open merge request
Commits (3)
<?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!
*/
$extensionKey = 'ter';
return [
'ctrl' => [
'label' => 'extensionkey',
'default_sortby' => 'ORDER BY extensionuid',
'crdate' => 'crdate',
'tstamp' => 'tstamp',
'delete' => 'deleted',
'title' => 'LLL:EXT:ter/locallang_tca.xml:tx_ter_extensionqueue',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($extensionKey) . 'tx_ter_extensionqueue.gif',
'dividers2tabs' => true,
],
'interface' => [
'showRecordFieldList' => 'hidden, extensionkey, extensionuid, imported_to_fe',
],
'columns' => [
'hidden' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => [
'type' => 'check',
],
],
'extensionkey' => [
'label' => 'LLL:EXT:ter/locallang_tca.xml:tx_ter_extensionqueue.extensionkey',
'config' => [
'type' => 'input',
'size' => '20',
'max' => '40',
],
],
'extensionuid' => [
'label' => 'LLL:EXT:ter/locallang_tca.xml:tx_ter_extensionqueue.extensionuid',
'config' => [
'type' => 'input',
'size' => '15',
'max' => '11',
],
],
'imported_to_fe' => [
'label' => 'LLL:EXT:ter/locallang_tca.xml:tx_ter_extensionqueue.imported_into_fe',
'config' => [
'type' => 'checkbox'
],
],
],
'types' => [
'1' => ['showitem' => 'extensionuid,extensionkey,imported_into_fe'],
]
];
......@@ -965,6 +965,7 @@ class tx_ter_api
$where = 'extensionkey = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($extensionKey, $table) . '
AND version = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($extensionInfoData->version, $table);
$extensionUid = $this->updateOrInsertRecord($table, $extensionRow, $where);
$extensionRow['uid'] = $extensionUid;
// Get dependencies
$dependenciesArr = [];
......@@ -1027,15 +1028,12 @@ class tx_ter_api
$where = 'extensionuid = ' . (int)$extensionUid;
$this->updateOrInsertRecord($table, $extensionDetailsRow, $where);
// Put new extension version into queue
$extensionQueue = [
'pid' => (int)$this->parentObj->extensionsPID,
'extensionuid' => (int)$extensionUid,
'extensionkey' => $extensionKey,
];
$signalSlotDispatcher = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class)
->get(TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$table = 'tx_ter_extensionqueue';
$this->updateOrInsertRecord($table, $extensionQueue);
$signalSlotDispatcher->dispatch(__CLASS__, 'extensionUploaded', [
'extensionRecord' => $extensionRow,
]);
}
......
......@@ -96,20 +96,3 @@ CREATE TABLE tx_ter_extensiondetails (
KEY extuid (extensionuid)
);
#
# Table structure for table 'tx_ter_extensionqueue'
#
CREATE TABLE tx_ter_extensionqueue (
uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
extensionkey varchar(30) DEFAULT '' NOT NULL,
extensionuid int(11) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
imported_to_fe tinyint(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY imported (imported_to_fe)
);
<?php
namespace T3o\TerFe2\Slot;
/*
* 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 T3o\TerFe2\Domain\Service\ExtensionImportService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Slots to react to extension upload signals from EXT:ter.
*
* Currently, only one signal is defined, but there might be more in the future
*/
class ExtensionUploadSlots
{
public function extensionUploaded($extensionRecord)
{
$service = GeneralUtility::makeInstance(ExtensionImportService::class);
$service->importExtension($extensionRecord);
}
}
......@@ -34,6 +34,7 @@ $EM_CONF[$_EXTKEY] = [
'depends' => [
'extbase' => '',
'fluid' => '',
'ter' => '',
],
'conflicts' => [
],
......
......@@ -56,13 +56,6 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders']['soap
],
];
// Register import from queue task
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\ImportExtensionsFromQueueTask::class] = [
'extension' => 'ter_fe2',
'title' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xlf:tx_terfe2_task_importextensionsfromqueuetask.name',
'description' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xlf:tx_terfe2_task_importextensionsfromqueuetask.description',
];
// Register import all extensions
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task\ImportAllExtensionKeysTask::class] = [
'extension' => 'ter_fe2',
......@@ -85,3 +78,12 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\TerFe2\Task
];
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['ter_fe2:extension'] = 'EXT:ter_fe2/Classes/Controller/Eid/ExtensionController.php';
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class)
->get(TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(
tx_ter_api::class, 'extensionUploaded',
\T3o\TerFe2\Slot\ExtensionUploadSlots::class, 'extensionUploaded'
);