Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] remove sidebar config menu and dark mode #61

Closed
wants to merge 9 commits into from
Closed
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
/.Build/ export-ignore
/.cache/ export-ignore
/.ddev/ export-ignore
/.crowdin.yml export-ignore
/.editorconfig export-ignore
/.eslintignore export-ignore
/.eslintrc.json export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.gitlab/ export-ignore
/.mergify.xml export-ignore
/.php-cs-fixer.php export-ignore
/.phpstan.bootstrap.php export-ignore
/.phpstorm.meta.php export-ignore
/.prettierrc.js export-ignore
/Tests/ export-ignore
/codeception.yml export-ignore
/composer.lock export-ignore
/generate-documentation.sh export-ignore
/package.json export-ignore
/phive.xml export-ignore
/phpcs.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/stylelint.config.js export-ignore
yarn.lock export-ignore
/tools/ export-ignore binary
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.directory
/*.idea
/.Build/*
/.cache
/.php-cs-fixer.cache
/.phpunit.result.cache
/Documentation-GENERATED-temp/
Expand All @@ -17,6 +18,7 @@
/build
/clover.xml
/composer.lock
/generate-documentation.sh export-ignore
/nbproject
/node_modules
/node_modules/
Expand Down
6 changes: 4 additions & 2 deletions Classes/Configuration/FlexForm/FlexFormTools8.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* The TYPO3 project - inspiring people to share!
*/

use RuntimeException;
use Tvp\TemplaVoilaPlus\Utility\TemplaVoilaUtility;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Configuration\FlexForm\Exception\InvalidIdentifierException;
Expand Down Expand Up @@ -67,7 +68,6 @@ class FlexFormTools8 extends \TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTool
* @param string $fieldName The field name
* @param array $row The data row
* @return string Identifier string
* @throws \RuntimeException If TCA is misconfigured
*/
public function getDataStructureIdentifier(array $fieldTca, string $tableName, string $fieldName, array $row): string
{
Expand All @@ -83,6 +83,7 @@ public function getDataStructureIdentifier(array $fieldTca, string $tableName, s
} catch (InvalidPointerFieldValueException $e) {
} catch (InvalidSinglePointerFieldException $e) {
} catch (InvalidIdentifierException $e) {
} catch (RuntimeException $e) {
}
// phpcs:enable
return '';
Expand Down Expand Up @@ -115,7 +116,7 @@ public function getDataStructureIdentifier(array $fieldTca, string $tableName, s
*
* @param string $identifier String to find the data structure location
* @return array Parsed and normalized data structure
* @throws InvalidIdentifierException
* @throws InvalidIdentifierException|RuntimeException
*/
public function parseDataStructureByIdentifier(string $identifier): array
{
Expand Down Expand Up @@ -175,6 +176,7 @@ public function traverseFlexFormXMLData($table, $field, $row, $callBackObj, $cal
} catch (InvalidParentRowRootException $e) {
} catch (InvalidPointerFieldValueException $e) {
} catch (InvalidIdentifierException $e) {
} catch (RuntimeException $e) {
}
// phpcs:enable

Expand Down
21 changes: 15 additions & 6 deletions Classes/Controller/Backend/LinkBrowserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ protected function initDocumentTemplate()
{
parent::initDocumentTemplate();
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$pageRenderer->addRequireJsConfiguration(
[
'map' => [
'*' => ['TYPO3/CMS/Backend/FormEngineLinkBrowserAdapter' => PathUtility::getRelativePathTo(ExtensionManagementUtility::extPath('templavoilaplus')) . '/Resources/Public/JavaScript/FormEngineLinkBrowserAdapter']
if (version_compare(TYPO3_version, '10.4', '<=')) {
$pageRenderer->addRequireJsConfiguration(
[
'map' => [
'*' => [
'TYPO3/CMS/Backend/FormEngineLinkBrowserAdapter' => PathUtility::getRelativePathTo(
ExtensionManagementUtility::extPath('templavoilaplus')
) .
'/Resources/Public/JavaScript/FormEngineLinkBrowserAdapter'
]
]
]
]
);
);
} else {
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Templavoilaplus/ParentWindow');
}
}
}
4 changes: 3 additions & 1 deletion Classes/Core/Page/JavaScriptModuleInstruction.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class JavaScriptModuleInstruction extends CoreJavaScriptModuleInstruction
*/
public function __construct(string $name, int $flags)
{
$name = preg_replace($this->pattern, $this->replace, $name);
if (version_compare(TYPO3_version, '10.4', '<=')) {
$name = preg_replace($this->pattern, $this->replace, $name);
}
parent::__construct($name, $flags);
}
}
2 changes: 1 addition & 1 deletion Classes/Service/DataHandling/DataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function moveRecord_firstElementPostProcess(
[$table, $uid, $destPid, $sourceRecordBeforeMove, $updateFields]
);
}
if ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tx_templavoilaplus_api']['apiIsRunningTCEmain']) {
if ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tx_templavoilaplus_api']['apiIsRunningTCEmain'] ?? false) {
return;
}
if ($table != 'tt_content') {
Expand Down
17 changes: 8 additions & 9 deletions Configuration/TCA/Overrides/be_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
'tx_templavoilaplus_access' => [
'label' => 'LLL:EXT:templavoilaplus/Resources/Private/Language/locallang_db.xlf:be_groups.tx_templavoilaplus_access',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_templavoilaplus_datastructure,tx_templavoilaplus_tmplobj',
'prepend_tname' => 1,
'size' => 5,
'autoSizeMax' => 15,
'multiple' => 1,
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'allowNonIdValues' => 1,
'itemsProcFunc' => \Tvp\TemplaVoilaPlus\Service\ItemsProcFunc::class . '->mapItems',
'size' => 1,
'minitems' => 0,
'maxitems' => 1000,
'show_thumbs' => 1,
'maxitems' => 1,
'showIconTable' => true,
'selicon_cols' => 10,
],
],
];
Expand Down
4 changes: 0 additions & 4 deletions Resources/Private/Partials/Backend/Tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ <h2>
<span class="sidenav-item sidenav-item-trash"><tvp:icon identifier="actions-delete" size="default"/></span>
<span class="sidenav-item-explanation"><f:translate key="LLL:EXT:templavoilaplus/Resources/Private/Language/Backend/PageLayout.xlf:trashAriaLabel"/></span>
</li>
<li>
<span class="sidenav-item sidenav-item-config"><tvp:icon identifier="actions-cog-alt" size="default"/></span>
<span class="sidenav-item-explanation"><f:translate key="LLL:EXT:templavoilaplus/Resources/Private/Language/Backend/PageLayout.xlf:configAriaLabel"/></span>
</li>
</ul>
<h2>
<f:translate key="LLL:EXT:templavoilaplus/Resources/Private/Language/Backend/PageLayout.xlf:tutorial.editing.heading"/>
Expand Down
4 changes: 0 additions & 4 deletions Resources/Private/Templates/Backend/PageLayout/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@
<core:icon identifier="actions-delete" size="default"/>
<span class="position-absolute translate-middle badge rounded-pill bg-danger">{unused.tt_content.count}</span>
</li>
<li class="sidenav-item sidenav-item-config" id="navbarConfig" data-tooltip-content="#navbarConfigTooltip"
{tvp:toolTipAttributes(text:'{f:translate(key:\'LLL:EXT:templavoilaplus/Resources/Private/Language/Backend/PageLayout.xlf:configAriaLabel\')}',placement:'left')} >
<tvp:icon identifier="actions-cog-alt" size="default"/>
</li>
</ul>
</nav>
</div>
Expand Down
20 changes: 20 additions & 0 deletions Resources/Public/JavaScript/ParentWindow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
define([
'TYPO3/CMS/Backend/FormEngineLinkBrowserAdapter'
], function(FormEngineLinkBrowserAdapter, ElementBrowser) {
const FormEngineLinkBrowserAdapterParentFunction = FormEngineLinkBrowserAdapter.getParent;
const getParent = () => {
if (
typeof window.parent !== 'undefined' &&
typeof window.parent.document.list_frame !== 'undefined' &&
window.parent.frames.list_frame.parent.document.querySelector('.t3js-modal-iframe') !== null &&
window.parent.frames.list_frame.parent.document.querySelectorAll('.t3js-modal-iframe').length > 1
) {
return window.parent.frames.list_frame.parent.document.querySelector('.t3js-modal-iframe').contentWindow;
}
return null;
}

FormEngineLinkBrowserAdapter.getParent = () => {
return getParent() || FormEngineLinkBrowserAdapterParentFunction();
}
});
119 changes: 0 additions & 119 deletions Resources/Public/StyleSheet/PageLayout.css
Original file line number Diff line number Diff line change
Expand Up @@ -502,122 +502,3 @@ div.tvjs-dropzone {
.blue {
background-color: #98c3ff;
}

/** DARK MODE **/

.dark-mode-on #sidenav {
background-color: #2d2d2d;
}

.dark-mode-on .sidenav-item {
background-color: #393939;
border-color: #2d2d2d;
}

.dark-mode-on .sidenav-item.disabled {
background-color: #2d2d2d;
}

.dark-mode-on .dark-mode-on .sidenav-item:hover:not(.disabled) {
background-color: #aaa;
}

/** TYPO3 Module Elements **/
.dark-mode-on .module {
background-color: #666;
}

.dark-mode-on .module-docheader {
border: none;
background-color: #2d2d2d;
color: #fff;
}

.dark-mode-on .t3-page-column-header,
.dark-mode-on .t3-page-ce .t3-page-ce-header {
background-color: #393939;
color: #999;
border: none;
}

.dark-mode-on .t3-page-ce .t3-page-ce-body {
background-color: #666;
}

.dark-mode-on .btn-default,
.dark-mode-on .btn-light,
.dark-mode-on .icon-status-dialog-notification {
background-color: #393939;
border-color: #999;
color: #999;
}

.dark-mode-on .card,
.dark-mode-on .panel {
background-color: #393939;
border-color: #999;
color: #999;
}

.dark-mode-on .bg-light {
background-color: rgba(128, 128, 128, var(--bs-bg-opacity)) !important;
}

.dark-mode-on .nav-tabs,
.dark-mode-on .panel .panel-heading {
background-color: #808080;
color: #000;
}

.dark-mode-on .nav-tabs > li > a.nav-link.active,
.dark-mode-on .nav.nav-tabs > li:not(.nav-item) > a.active:not(.nav-link) {
background-color: #393939;
color: #ddd;
border-bottom-color: #393939;
}

.dark-mode-on .bg-info {
background-color: rgba(35, 40, 90, var(--bs-bg-opacity)) !important;
}

/** Tooltipster own dark mode */
.dark-mode-on .tooltipster-sidetip .tooltipster-box {
border: 1px solid #999;
background: #393939;
}

.dark-mode-on .tooltipster-sidetip .tooltipster-content {
color: #fff;
}

.dark-mode-on .tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-background {
border-bottom-color: #393939;
}

.dark-mode-on .tooltipster-sidetip.tooltipster-left .tooltipster-arrow-background {
border-left-color: #393939;
}

.dark-mode-on .tooltipster-sidetip.tooltipster-right .tooltipster-arrow-background {
border-right-color: #393939;
}

.dark-mode-on .tooltipster-sidetip.tooltipster-top .tooltipster-arrow-background {
border-top-color: #393939;
}

.dark-mode-on .tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-border {
border-bottom-color: #999;
}

.dark-mode-on .tooltipster-sidetip.tooltipster-left .tooltipster-arrow-border {
border-left-color: #999;
}

.dark-mode-on .tooltipster-sidetip.tooltipster-right .tooltipster-arrow-border {
border-right-color: #999;
}

.dark-mode-on .tooltipster-sidetip.tooltipster-top .tooltipster-arrow-border {
border-top-color: #999;
}
Loading