-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from a-kehr/controller
Umsetzung als Symfony Bundle
- Loading branch information
Showing
32 changed files
with
500 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/.idea/ | ||
/vendor/ | ||
/composer.lock | ||
/composer.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
$date = date('Y'); | ||
|
||
$header = <<<EOF | ||
Contao Onepage Navigation for Contao Open Source CMS. | ||
@copyright Copyright (c) $date, Erdmann & Freunde | ||
@author Erdmann & Freunde <https://erdmann-freunde.de> | ||
@license MIT | ||
@link https://github.com/erdmannfreunde/contao-onepage-navigation | ||
EOF; | ||
|
||
$finder = (new \PhpCsFixer\Finder()) | ||
->in(__DIR__ . '/src'); | ||
|
||
return (new \PhpCsFixer\Config()) | ||
->setRules( | ||
[ | ||
'@Symfony' => true, | ||
'header_comment' => [ | ||
'header' => $header | ||
], | ||
] | ||
) | ||
->setFinder($finder) | ||
->setUsingCache(false) | ||
->setLineEnding("\r\n"); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
services: | ||
_defaults: | ||
autoconfigure: true | ||
autowire: true | ||
|
||
EuF\OnepageNavigation\EventListener\InsertTagsListener: ~ | ||
EuF\OnepageNavigation\EventListener\GetArticleListener: ~ | ||
EuF\OnepageNavigation\Controller\FrontendModule\OnepageNavigationController: ~ | ||
EuF\OnepageNavigation\EventListener\DataContainer\GenerateAliasSaveCallback: ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Contao Onepage Navigation for Contao Open Source CMS. | ||
* | ||
* @copyright Copyright (c) 2024, Erdmann & Freunde | ||
* @author Erdmann & Freunde <https://erdmann-freunde.de> | ||
* @license MIT | ||
* @link https://github.com/erdmannfreunde/contao-onepage-navigation | ||
*/ | ||
|
||
use Contao\CoreBundle\DataContainer\PaletteManipulator; | ||
|
||
/* | ||
* Palettes | ||
*/ | ||
PaletteManipulator::create() | ||
->addLegend('onepage_legend', 'layout_legend', PaletteManipulator::POSITION_BEFORE) | ||
->addField('addNavigation', 'onepage_legend', PaletteManipulator::POSITION_APPEND) | ||
->applyToPalette('default', 'tl_article'); | ||
|
||
$GLOBALS['TL_DCA']['tl_article']['palettes']['__selector__'][] = 'addNavigation'; | ||
$GLOBALS['TL_DCA']['tl_article']['subpalettes']['addNavigation'] = 'navigation_title,navigation_jumpTo'; | ||
|
||
/* | ||
* Fields | ||
*/ | ||
$GLOBALS['TL_DCA']['tl_article']['fields']['addNavigation'] = [ | ||
'exclude' => true, | ||
'inputType' => 'checkbox', | ||
'eval' => [ | ||
'submitOnChange' => true, | ||
'doNotCopy' => true, | ||
], | ||
'sql' => [ | ||
'type' => 'string', | ||
'length' => 1, | ||
'fixed' => true, | ||
'default' => '', | ||
], | ||
]; | ||
|
||
$GLOBALS['TL_DCA']['tl_article']['fields']['navigation_title'] = [ | ||
'exclude' => true, | ||
'inputType' => 'text', | ||
'search' => true, | ||
'eval' => [ | ||
'mandatory' => false, | ||
'decodeEntities' => true, | ||
'maxlength' => 255, | ||
'tl_class' => 'w50', | ||
], | ||
'sql' => [ | ||
'type' => 'string', | ||
'default' => '', | ||
], | ||
]; | ||
|
||
$GLOBALS['TL_DCA']['tl_article']['fields']['navigation_jumpTo'] = [ | ||
'exclude' => true, | ||
'inputType' => 'text', | ||
'search' => true, | ||
'eval' => [ | ||
'maxlength' => 255, | ||
'tl_class' => 'w50', | ||
'rgxp' => 'alias', | ||
], | ||
'sql' => [ | ||
'type' => 'string', | ||
'default' => '', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Contao Onepage Navigation for Contao Open Source CMS. | ||
* | ||
* @copyright Copyright (c) 2024, Erdmann & Freunde | ||
* @author Erdmann & Freunde <https://erdmann-freunde.de> | ||
* @license MIT | ||
* @link https://github.com/erdmannfreunde/contao-onepage-navigation | ||
*/ | ||
|
||
use EuF\OnepageNavigation\Controller\FrontendModule\OnepageNavigationController; | ||
|
||
/* | ||
* Palettes | ||
*/ | ||
$GLOBALS['TL_DCA']['tl_module']['palettes'][OnepageNavigationController::TYPE] = '{title_legend},name,headline,type;{reference_legend:hide},defineRoot;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Contao Onepage Navigation for Contao Open Source CMS. | ||
* | ||
* @copyright Copyright (c) 2024, Erdmann & Freunde | ||
* @author Erdmann & Freunde <https://erdmann-freunde.de> | ||
* @license MIT | ||
* @link https://github.com/erdmannfreunde/contao-onepage-navigation | ||
*/ | ||
|
||
/* | ||
* Legends | ||
*/ | ||
$GLOBALS['TL_LANG']['tl_article']['onepage_legend'] = 'Onepage-Navigation'; | ||
|
||
/* | ||
* Fields | ||
*/ | ||
$GLOBALS['TL_LANG']['tl_article']['addNavigation'] = ['Als Navigationspunkt hinzufügen', 'Wenn Sie diesen Artikel zur Navigation hinzufügen möchten, aktivieren Sie bitte die Checkbox.']; | ||
$GLOBALS['TL_LANG']['tl_article']['navigation_title'] = ['Navigationtitel', 'Bitte geben Sie den Titel für die Navigation ein, wenn dieser abweichend vom allgemeinen Titel ist.']; | ||
$GLOBALS['TL_LANG']['tl_article']['navigation_jumpTo'] = ['Sprungmarke', 'Hier können Sie eine optionale Bezeichnung der Sprungmarke eingeben. Diese wird nur gesetzt, wenn Sie keine ID festgelegt haben.']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
15 changes: 15 additions & 0 deletions
15
contao/templates/frontend_module/onepage_navigation.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends '@Contao/frontend_module/_base.html.twig' %} | ||
|
||
{% set searchable = false %} | ||
|
||
{% block content %} | ||
{% if hasItems %} | ||
<ul class="level_1"> | ||
{% for item in navigation %} | ||
<li{% if item.css is defined %} class="{{ item.css }}"{% endif %} data-onepage-link="{{ item.navigation_jumpTo }}"> | ||
<a href="{{ item.onepage_jump }}" data-onepage-link="{{ item.navigation_jumpTo }}" title="{{ item.title }}">{{ item.title }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endblock %} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
parameters: | ||
level: 6 | ||
|
||
featureToggles: | ||
alwaysTrueAlwaysReported: false | ||
detectDeadTypeInMultiCatch: false | ||
disableCheckMissingIterableValueType: false | ||
|
||
universalObjectCratesClasses: | ||
- Contao\Model | ||
- Contao\ArticleModel | ||
- Contao\DataContainer | ||
- Contao\Model\Collection | ||
|
||
ignoreErrors: | ||
- identifier: missingType.iterableValue | ||
|
||
treatPhpDocTypesAsCertain: false | ||
rememberPossiblyImpureFunctionValues: false |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.