[BUGFIX] Fix backend stylesheed directory collision
This commit is contained in:
parent
94a7c42289
commit
316c0d5b8d
57
Classes/Utility/DatabaseUtility.php
Normal file
57
Classes/Utility/DatabaseUtility.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
namespace Cjel\TemplatesAide\Utility;
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* This file is part of the "Templates Aide" Extension for TYPO3 CMS.
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please read the
|
||||||
|
* LICENSE.txt file that was distributed with this source code.
|
||||||
|
*
|
||||||
|
* (c) 2022 Philipp Dieter
|
||||||
|
*
|
||||||
|
***/
|
||||||
|
|
||||||
|
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||||
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
|
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||||
|
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds functions to help with database interactions
|
||||||
|
*/
|
||||||
|
class DatabaseUtility
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mysql date format
|
||||||
|
*/
|
||||||
|
const MYSQL_DATE_FORMAT = 'Y-m-d H:i:s';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns table name by model
|
||||||
|
*
|
||||||
|
* @param $model object model
|
||||||
|
* @return string table name
|
||||||
|
*/
|
||||||
|
public static function getTableNameFromModelClass($class)
|
||||||
|
{
|
||||||
|
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
|
||||||
|
$dataMapper = $objectManager->get(DataMapper::class);
|
||||||
|
return $dataMapper->getDataMap($class)->getTableName();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new query builder and returns it
|
||||||
|
*
|
||||||
|
* @param $tablename string table name
|
||||||
|
* @return object queryBuilder
|
||||||
|
*/
|
||||||
|
public static function getQueryBuilderFromTableName($tableName)
|
||||||
|
{
|
||||||
|
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||||
|
->getConnectionForTable($tableName)
|
||||||
|
->createQueryBuilder();
|
||||||
|
return $queryBuilder;
|
||||||
|
}
|
||||||
|
}
|
@ -40,7 +40,7 @@ call_user_func(
|
|||||||
'EXT:templates_aide/Resources/Public/Css/backend/production-stage';
|
'EXT:templates_aide/Resources/Public/Css/backend/production-stage';
|
||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['default'] =
|
$GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['templates_aide_default'] =
|
||||||
'EXT:templates_aide/Resources/Public/Css/backend/default';
|
'EXT:templates_aide/Resources/Public/Css/backend/default';
|
||||||
|
|
||||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
|
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user