From 1afbc9add0bf970baf85fe87d72131e45b55bb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Mon, 29 Oct 2018 09:27:02 +0100 Subject: [PATCH] Add plugin to embed BusPro password change form --- .../Classes/Controller/PasswordController.php | 45 +++++++++++++++++++ .../TCA/Overrides/tt_content.php | 6 +++ .../ext/ep_products/ext_localconf.php | 11 +++++ .../Private/Templates/Password/Index.html | 18 ++++++++ 4 files changed, 80 insertions(+) create mode 100644 web/typo3conf/ext/ep_products/Classes/Controller/PasswordController.php create mode 100644 web/typo3conf/ext/ep_theme/Resources/Private/Templates/Password/Index.html diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/PasswordController.php b/web/typo3conf/ext/ep_products/Classes/Controller/PasswordController.php new file mode 100644 index 00000000..3ec68031 --- /dev/null +++ b/web/typo3conf/ext/ep_products/Classes/Controller/PasswordController.php @@ -0,0 +1,45 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class PasswordController extends ActionController +{ + + public function indexAction() + { + // Conflicting argument 'id' needs to be replaced with 'bpn_id'! + $this->view->assignMultiple([ + 'bpnDbPassword' => GeneralUtility::_GET('db_passwort'), + 'bpnId' => GeneralUtility::_GET('bpn_id'), + ]); + } + +} diff --git a/web/typo3conf/ext/ep_products/Configuration/TCA/Overrides/tt_content.php b/web/typo3conf/ext/ep_products/Configuration/TCA/Overrides/tt_content.php index a24fecd4..32393cbd 100644 --- a/web/typo3conf/ext/ep_products/Configuration/TCA/Overrides/tt_content.php +++ b/web/typo3conf/ext/ep_products/Configuration/TCA/Overrides/tt_content.php @@ -149,6 +149,12 @@ call_user_func(function () { 'Merkliste' ); + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'EP.EpProducts', + 'password', + 'Passwort BusPro' + ); + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_product_detail'] = 'pi_flexform'; \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( 'epproducts_product_detail', 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_product_detail.xml' diff --git a/web/typo3conf/ext/ep_products/ext_localconf.php b/web/typo3conf/ext/ep_products/ext_localconf.php index 64a73fd3..b7632434 100644 --- a/web/typo3conf/ext/ep_products/ext_localconf.php +++ b/web/typo3conf/ext/ep_products/ext_localconf.php @@ -308,6 +308,17 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\EP\EpProducts\T ] ); +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'EP.' . $_EXTKEY, + 'password', + [ + 'Password' => 'index', + ], + [ + 'Password' => '', + ] +); + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'EP.' . $_EXTKEY, 'ajax', diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Password/Index.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Password/Index.html new file mode 100644 index 00000000..1c41a1db --- /dev/null +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Password/Index.html @@ -0,0 +1,18 @@ + + + + + +
+
+
+ +
+
+
+
+ +