Skip to content

Commit

Permalink
Added to navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin committed Sep 9, 2021
1 parent 414db44 commit 1ee81a1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## 1.3.3 - 2020-12-22
### Fixed
- Vue version [#18](https://github.com/dutchheight/craft-cookie-boss/issues/18)
- Invalid after days bug [#16](https://github.com/dutchheight/craft-cookie-boss/issues/16)
- Invalid after days bug [#16](https://github.com/dutchheight/craft-cookie-boss/issues/16)

## 1.4.0 - 2021-09-09
### Fixed
- Added a dashboard menu item
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dutchheight/craft-cookie-boss",
"description": "Allow your visitors to set their cookie preference.",
"type": "craft-plugin",
"version": "1.3.3",
"version": "1.4.0",
"keywords": [
"craft",
"cms",
Expand Down
14 changes: 14 additions & 0 deletions src/CookieBoss.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
use Craft;
use craft\base\Plugin;
use craft\events\RegisterUrlRulesEvent;
use craft\events\RegisterCpNavItemsEvent;
use craft\helpers\UrlHelper;
use craft\web\twig\variables\Cp;
use craft\web\twig\variables\CraftVariable;
use craft\web\UrlManager;
use dutchheight\cookieboss\models\Settings;
Expand Down Expand Up @@ -109,6 +111,18 @@ function (RegisterUrlRulesEvent $event) {
}
);

Event::on(
Cp::class,
Cp::EVENT_REGISTER_CP_NAV_ITEMS,
function(RegisterCpNavItemsEvent $event) {
$event->navItems[] = [
'url' => 'cookie-boss/settings',
'label' => 'Cookie Boss',
'icon' => '@dutchheight/cookieboss/assetbundles/cookieboss/dist/img/CookieBoss-icon.svg',
];
}
);

// Install only for non-console Control Panel requests
$request = Craft::$app->getRequest();
if ($request->getIsCpRequest() && !$request->getIsConsoleRequest()) {
Expand Down
32 changes: 10 additions & 22 deletions src/assetbundles/cookieboss/dist/img/CookieBoss-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1ee81a1

Please sign in to comment.