diff --git a/.gitignore b/.gitignore index 9864f50..2278c9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ +.DS_Store /.idea /composer.lock /.vscode -/.DS_Store /.ddev /logs /var diff --git a/Build/Gruntfile.js b/Build/Gruntfile.js index c904ed4..b13cec8 100644 --- a/Build/Gruntfile.js +++ b/Build/Gruntfile.js @@ -31,6 +31,11 @@ module.exports = function (grunt) { scssFilePaths: [], cssFilePaths: [] }, + 'contactWidget': { + stylesheets: ['contactWidget'], + scssFilePaths: [], + cssFilePaths: [] + }, }, scssFilePaths: [], }; diff --git a/Classes/Widgets/ContactWidget.php b/Classes/Widgets/ContactWidget.php new file mode 100644 index 0000000..859e97f --- /dev/null +++ b/Classes/Widgets/ContactWidget.php @@ -0,0 +1,77 @@ +configuration = $configuration; + $this->view = $view; + $this->buttonProvider = $buttonProvider; + $this->options = $options; + } + + public function getCssFiles(): array + { + return [ + 'EXT:widgets/Resources/Public/Css/contactWidget.css', + ]; + } + + public function renderWidgetContent(): string + { + + $this->view->setTemplate('Widget/ContactWidget'); + $this->view->assignMultiple([ + 'options' => $this->options, + 'button' => $this->buttonProvider, + 'configuration' => $this->configuration, + ]); + return $this->view->render(); + } +} diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 752055c..22536f8 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -49,3 +49,37 @@ services: iconIdentifier: 'content-widget-list' height: 'medium' width: 'medium' + + dashboard.buttons.contact: + class: 'TYPO3\CMS\Dashboard\Widgets\Provider\ButtonProvider' + arguments: + $title: 'Find a partner' + $link: 'https://typo3.com/services/find-a-typo3-partner/official-typo3-partner-finder' + $target: '_blank' + + widgets.dashboard.widget.contact: + class: 'FriendsOfTYPO3\Widgets\Widgets\ContactWidget' + arguments: + $view: '@dashboard.views.widget' + $buttonProvider: '@dashboard.buttons.contact' + $options: + template: 'Widget/ContactWidget' + introText: 'LLL:EXT:widgets/Resources/Private/Language/locallang.xlf:widgets.dashboard.widget.contact.defaultIntro' + company: '' + address: '' + postalCode: '' + place: '' + country: '' + tel: '' + mail: '' + website: '' + logoPath: 'EXT:backend/Resources/Public/Images/typo3_orange.svg' + tags: + - name: dashboard.widget + identifier: 'widgets-contact' + groupNames: 'general' + title: 'LLL:EXT:widgets/Resources/Private/Language/locallang.xlf:widgets.dashboard.widget.contact.title' + description: 'LLL:EXT:widgets/Resources/Private/Language/locallang.xlf:widgets.dashboard.widget.contact.description' + iconIdentifier: 'content-widget-list' + height: 'medium' + width: 'small' diff --git a/Documentation/Images/ContactWidget.png b/Documentation/Images/ContactWidget.png new file mode 100644 index 0000000..f5e47a6 Binary files /dev/null and b/Documentation/Images/ContactWidget.png differ diff --git a/Documentation/Widgets/ContactWidget.rst b/Documentation/Widgets/ContactWidget.rst new file mode 100644 index 0000000..ba30eca --- /dev/null +++ b/Documentation/Widgets/ContactWidget.rst @@ -0,0 +1,52 @@ +.. include:: ../Includes.txt + +.. _contact-widget: + +=========================== +Contact Widget +=========================== + +This widget will show you the contact information of your your TYPO3 supplier. +To show your supplier contact information some configuration is required. + + +.. figure:: ../Images/ContactWidget.png + :class: with-shadow + :alt: Show the contact information + :width: 500px + + An example of the contact widget with supplier information. + + +Options +------- +This widget has some options. To override the default options, see :ref:`Adjust settings of registered widgets `. + +An example: + +.. code-block:: yaml + + dashboard.buttons.contact: + class: 'TYPO3\CMS\Dashboard\Widgets\Provider\ButtonProvider' + arguments: + $title: 'Support' + $link: 'https://maxserv.com/support' + $target: '_blank' + + widgets.dashboard.widget.contact: + class: 'FriendsOfTYPO3\Widgets\Widgets\ContactWidget' + arguments: + $view: '@dashboard.views.widget' + $buttonProvider: '@dashboard.buttons.contact' + $options: + template: 'Widget/ContactWidget' + introText: '' + company: 'MaxServ' + address: 'Taxandriaweg 11' + postalCode: '5142 PA' + place: 'Waalwijk' + country: 'The Netherlands' + tel: '+31 416 30 10 00' + mail: 'info@maxserv.com' + website: 'https://www.maxserv.com' + logoPath: 'https://typo3.com/fileadmin/partner/logo-maxserv-zonder-groot.png' diff --git a/README.md b/README.md index 7452057..4b913c0 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This extension currently contains the following widgets: * **Current online users**, Will show you which users are currently online; * **Status Report**, Gives you an overview of errors and warnings in your installation; * **Pages without Meta Description**, Returns a list of last edited pages without a Meta Description; +* **Contact information**, Will show contact information of your supplier; ## I miss widgets! Do you have an idea for a widget showing information that is available by core extensions, please diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 9e0ac45..aec6ee6 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -36,6 +36,13 @@ Last change + + Tel: + + + Mail: + + Current online users @@ -60,6 +67,20 @@ SEO + + Contact information + + + Will show contact information of your supplier + + + TYPO3 + + + No information of your supplier found!

+ Good partners are crucial to success. Our certified, audited partner agencies and freelancers are doing remarkable, high-quality work every day and we can help you find the best match for your project.]]> + +
diff --git a/Resources/Private/Sass/contactWidget.scss b/Resources/Private/Sass/contactWidget.scss new file mode 100644 index 0000000..be6ba60 --- /dev/null +++ b/Resources/Private/Sass/contactWidget.scss @@ -0,0 +1,9 @@ +@import "Base"; + +.widget { + .widget-contact-logo { + width: 75%; + max-width: 290px; + margin-bottom: 20px; + } +} diff --git a/Resources/Private/Templates/Widget/ContactWidget.html b/Resources/Private/Templates/Widget/ContactWidget.html new file mode 100644 index 0000000..f8db7af --- /dev/null +++ b/Resources/Private/Templates/Widget/ContactWidget.html @@ -0,0 +1,65 @@ + + + + + + + {f:translate(key: options.company, default: options.company)} + + + {f:translate(key: 'widgets.dashboard.widget.contact.defaultCompany')} + + + + + + + +

+ {f:translate(key: options.introText, default: options.introText) -> f:format.raw()} +

+
+

+ + {options.company}
+
+ + {options.address}
+
+ + {options.postalCode} {options.place}
+
+ + {options.country}
+
+

+ +

+ + + {options.tel}
+
+ + + + {options.mail} +
+
+

+
+ +

+ {options.website} +

+
+
+ + + + {f:translate(id: button.title, default: button.title)} + + + + diff --git a/Resources/Public/Css/contactWidget.css b/Resources/Public/Css/contactWidget.css new file mode 100644 index 0000000..f81818f --- /dev/null +++ b/Resources/Public/Css/contactWidget.css @@ -0,0 +1 @@ +.widget .widget-contact-logo{width:75%;max-width:290px;margin-bottom:20px} \ No newline at end of file