Skip to content

Commit

Permalink
[TASK] #15 | Introduce InternalContentObjects submodule
Browse files Browse the repository at this point in the history
Signed-off-by: kamiyang <[email protected]>
  • Loading branch information
KamiYang committed Oct 23, 2018
1 parent 96ae1c6 commit 35d56ac
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 7 deletions.
56 changes: 56 additions & 0 deletions Classes/Modules/Info/InternalContentObjects.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);

namespace Psychomieze\AdminpanelExtended\Modules\Info;

/*
* This file is part of the TYPO3 Adminpanel Initiative.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/

use TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule;
use TYPO3\CMS\Adminpanel\ModuleApi\ContentProviderInterface;
use TYPO3\CMS\Adminpanel\ModuleApi\ModuleData;

/**
* Class InternalContentObjects
*/
class InternalContentObjects extends AbstractSubModule implements ContentProviderInterface
{
/**
* Identifier for this module,
* for example "preview" or "cache"
*
* @return string
*/
public function getIdentifier(): string
{
return 'internal-content-objects';
}

/**
* Module label
*
* @return string
*/
public function getLabel(): string
{
return 'Internal Content Objects';
}

/**
* Main method for content generation of an admin panel module.
* Return content as HTML. For modules implementing the DataProviderInterface
* the "ModuleData" object is automatically filled with the stored data - if
* no data is given a "fresh" ModuleData object is injected.
*
* @param \TYPO3\CMS\Adminpanel\ModuleApi\ModuleData $data
* @return string
*/
public function getContent(ModuleData $data): string
{
return '';
}
}
21 changes: 14 additions & 7 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,22 @@ function () {
);
}

if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']['info']) &&
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('beuser')) {
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']['info'])) {
$infoSubModules = [
'internal-content-objects' => [
'module' => Psychomieze\AdminpanelExtended\Modules\Info\InternalContentObjects::class
]
];

if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('beuser')) {
$infoSubModules['userinformation'] = [
'module' => Psychomieze\AdminpanelExtended\Modules\Info\UserInformation::class
];
}

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']['info']['submodules'] = array_replace_recursive(
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']['info']['submodules'],
[
'userinformation' => [
'module' => Psychomieze\AdminpanelExtended\Modules\Info\UserInformation::class
]
]
$infoSubModules
);
}
}
Expand Down

0 comments on commit 35d56ac

Please sign in to comment.