-
Notifications
You must be signed in to change notification settings - Fork 6
moved email message to & cc names to config file #538
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a998953
moved email message to & cc names to config file
Jurj-Bogdan b465ae6
phpcs fix
Jurj-Bogdan a853945
implemented dot-navigation package
MarioRadu 7962a7e
implemented dot-navigation package
MarioRadu a15e796
requested changes
Jurj-Bogdan 9cf4c46
included missing key in dist file
Jurj-Bogdan 2d13d4c
keys changed
Jurj-Bogdan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -45,12 +45,20 @@ return [ | |
| ], | ||
| ], | ||
| 'contact' => [ | ||
| 'notification_receivers' => [], | ||
| 'message_receivers' => [ | ||
| 'to' => [ | ||
| 'subject' => 'Dotkernel Contact', | ||
| 'message_sender' => [ | ||
| 'name' => '', | ||
| 'address' => '', | ||
|
||
| ], | ||
| 'message_recipients' => [ | ||
| 'name' => 'Dotkernel Team', | ||
| 'to' => [ | ||
| 'tech@example.com', | ||
| ], | ||
| 'cc' => [ | ||
| 'tech@example.com', | ||
| ], | ||
| 'cc' => [ | ||
| 'bcc' => [ | ||
| 'tech@example.com', | ||
| ], | ||
| ], | ||
|
|
||
This file contains hidden or 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,169 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| return [ | ||
| 'dot_navigation' => [ | ||
| //enable menu item active if any child is active | ||
| 'active_recursion' => true, | ||
| 'containers' => [ | ||
| 'left_menu' => [ | ||
| 'type' => 'ArrayProvider', | ||
| 'options' => [ | ||
| 'items' => [ | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Pages', | ||
| 'route' => [], | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'nav-link dropdown-toggle', | ||
| 'href' => '#', | ||
| ], | ||
| 'pages' => [ | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Home', | ||
| 'uri' => '/home', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'dropdown-item', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'About Us', | ||
| 'uri' => '/page/about-us', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'dropdown-item', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Who We Are', | ||
| 'uri' => '/page/who-we-are', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'dropdown-item', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Premium content', | ||
| 'uri' => '/page/premium-content', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'dropdown-item', | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Contribute', | ||
| 'uri' => 'https://github.com/dotkernel', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'nav-link', | ||
| 'target' => '_blank', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Contact Us', | ||
| 'uri' => '/contact/form', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'nav-link', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Disabled', | ||
| 'uri' => '/', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'nav-link disabled', | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| 'guest_menu' => [ | ||
| 'type' => 'ArrayProvider', | ||
| 'options' => [ | ||
| 'items' => [ | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Log in', | ||
| 'uri' => '/user/login', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'nav-link', | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| 'user_menu' => [ | ||
| 'type' => 'ArrayProvider', | ||
| 'options' => [ | ||
| 'items' => [ | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Profile', | ||
| 'uri' => '/account/details', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'nav-link', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Log out', | ||
| 'uri' => '/user/logout', | ||
| ], | ||
| 'attributes' => [ | ||
| 'class' => 'nav-link', | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| 'user_profile_menu' => [ | ||
| 'type' => 'ArrayProvider', | ||
| 'options' => [ | ||
| 'items' => [ | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Avatar', | ||
| 'uri' => '/account/avatar', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Details', | ||
| 'uri' => '/account/details', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Change password', | ||
| 'uri' => '/account/change-password', | ||
| ], | ||
| ], | ||
| [ | ||
| 'options' => [ | ||
| 'label' => 'Delete account', | ||
| 'uri' => '/account/delete-account', | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| //register custom providers here | ||
| 'provider_manager' => [], | ||
| ], | ||
| ]; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,46 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Frontend\App\Twig\Extension; | ||
|
|
||
| use Dot\DependencyInjection\Attribute\Inject; | ||
| use Mezzio\Helper\UrlHelper; | ||
| use Twig\Extension\AbstractExtension; | ||
| use Twig\TwigFunction; | ||
|
|
||
| class RouteExtension extends AbstractExtension | ||
| { | ||
| #[Inject(UrlHelper::class)] | ||
| public function __construct( | ||
| private readonly UrlHelper $urlHelper, | ||
| ) { | ||
| } | ||
|
|
||
| public function getFunctions(): array | ||
| { | ||
| return [ | ||
| new TwigFunction('getCurrentRoute', [$this, 'getCurrentRoute']), | ||
| new TwigFunction('isRoute', [$this, 'isRoute']), | ||
| ]; | ||
| } | ||
|
|
||
| public function getCurrentRoute(): ?string | ||
| { | ||
| return $this->urlHelper->getRequest()?->getUri()?->getPath(); | ||
| } | ||
|
|
||
| public function isRoute(?string $route): bool | ||
| { | ||
| if (null === $route) { | ||
| return false; | ||
| } | ||
|
|
||
| $currentRoute = $this->getCurrentRoute(); | ||
| if (null === $currentRoute) { | ||
| return false; | ||
| } | ||
|
|
||
| return $currentRoute === $route; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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,27 @@ | ||
| {% set extraAttributes = '' %} | ||
| {% if page is defined %} | ||
| <ul class="navbar-nav mr-auto"> | ||
| {% endif %} | ||
| {% for page in container %} | ||
| {% if navigation.isAllowed(page) %} | ||
| {% if page.hasChildren() %} | ||
| <li class="nav-item dropdown"> | ||
| <a {% autoescape false %}{{ pageAttributes(page) ~ extraAttributes }}{% endautoescape %} id="pageDropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ page.getOption('label') }}</a> | ||
| <div class="dropdown-menu" aria-labelledby="pageDropdown"> | ||
| {{ navigationPartial(page, 'partial::menu') }} | ||
| </div> | ||
| </li> | ||
| {% else %} | ||
| {% if page.hasParent() %} | ||
| <a {% autoescape false %}{{ pageAttributes(page) ~ extraAttributes }}{% endautoescape %} href="{{ navigation.getHref(page) }}" {% autoescape false %}{{ pageAttributes(page) ~ extraAttributes }}{% endautoescape %}>{{ page.getOption('label') }}</a> | ||
| {% else %} | ||
| <li class="nav-item"> | ||
| <a {% autoescape false %}{{ pageAttributes(page) ~ extraAttributes }}{% endautoescape %} href="{{ navigation.getHref(page) }}" {% autoescape false %}{{ pageAttributes(page) ~ extraAttributes }}{% endautoescape %}>{{ page.getOption('label') }}</a> | ||
| </li> | ||
| {% endif %} | ||
| {% endif %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% if page is defined %} | ||
| </ul> | ||
| {% endif %} |
This file contains hidden or 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,8 @@ | ||
| {% set extraAttributes = '' %} | ||
| {% for page in container %} | ||
| {% if navigation.isAllowed(page) %} | ||
| <li class="{% if isRoute(page.getOption('uri')) %}active{% endif %}"> | ||
| <a href="{{ navigation.getHref(page) }}" class="text-decoration-none" {% autoescape false %}{{ pageAttributes(page) ~ extraAttributes }}{% endautoescape %}>{{ page.getOption('label') }}</a> | ||
| </li> | ||
| {% endif %} | ||
| {% endfor %} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better a variable name like
from_name