Skip to content

Commit

Permalink
refactor: replaced adminbar with new package name
Browse files Browse the repository at this point in the history
  • Loading branch information
wbrowar committed Dec 7, 2023
1 parent e4bf071 commit 0e5512b
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 39 deletions.
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 4.0.0-beta.1 - 2023-12-01

> {warning} Admin Bar’s composer package name has changed from `wbrowar/adminbar` to `wbrowar/craft-admin-bar`. Update your composer.json to point to [the new package on Packagist.](https://packagist.org/packages/wbrowar/craft-admin-bar)
## 4.0.0 - 2023-12-01
### Added
- Added static translations for all strings on admin bar.
- Added `rtl` config option that can be passed into `adminBar()` as `adminBar({ rtl: true })`.
Expand All @@ -20,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- The `adminbar()` twig function has been deprecated and changed to `adminBar()` to better follow Craft Twig naming conventions.
- Changed all CP URLs to use the `cpUrl()` Twig method, instead of `url()`.
- Changed the Custom CSS text area field into a [Craft Code Editor](https://github.com/nystudio107/craft-code-editor) field.
- Changed all instances of `adminbar` with `admin-bar` or `craft-admin-bar`, where applicable.

### Fixed
- Fixed an issue preventing removing items from the Custom Links settings table field.
Expand All @@ -46,27 +50,27 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## 3.2.0 - 2022-05-07
### Added
- Craft 4 compatibility [#28](https://github.com/wbrowar/craft-adminbar/issues/28)
- Craft 4 compatibility [#28](https://github.com/wbrowar/craft-admin-bar/issues/28)

### Removed
- Removed Edit Links and Admin Bar Widgets


## 3.1.11 - 2019-10-31
### Fixed
- Composer 2 compatibility [#23](https://github.com/wbrowar/craft-adminbar/issues/23)
- Composer 2 compatibility [#23](https://github.com/wbrowar/craft-admin-bar/issues/23)


## 3.1.10 - 2019-11-28
### Changed
- Bumped minimum Craft CMS requirement to `^3.3.16`

### Fixed
- Fixed Admin Bar appearing in Live Preview based on a change in Craft 3.2 ([#16](https://github.com/wbrowar/craft-adminbar/issues/16))
- Fixed Admin Bar appearing in Live Preview based on a change in Craft 3.2 ([#16](https://github.com/wbrowar/craft-admin-bar/issues/16))

## 3.1.9 - 2019-11-28
### Added
- You can now set the Edit Link to a custom URL or URI (it will be run through the `url()` Twig function). ([#15](https://github.com/wbrowar/craft-adminbar/issues/15))
- You can now set the Edit Link to a custom URL or URI (it will be run through the `url()` Twig function). ([#15](https://github.com/wbrowar/craft-admin-bar/issues/15))
- The label for the Edit Link can be set to a custom string when setting a custom Edit Link URL.

### Removed
Expand Down
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ If you are creating a Craft CMS site with a Twig front end, you can use this plu

If you are creating a headless site, or a site that is statically cached, you may not need this plugin, and in that case you can add [Admin Bar Component](https://github.com/wbrowar/admin-bar-component) directly into your site’s JavaScript (via a bundler or a `<script>` tag).

> :warning: Admin Bar’s composer package name has changed from `wbrowar/adminbar` to `wbrowar/craft-admin-bar`. Update your composer.json to point to [the new package on Packagist.](https://packagist.org/packages/wbrowar/craft-admin-bar)
## Requirements
* Craft 4.0.0

## Installation
To install the plugin, you can find it in the [Craft Plugin Store](https://plugins.craftcms.com/admin-bar), or follow these instructions:

1. Open your terminal and go to your Craft project:

`cd /path/to/project`
```bash
cd /path/to/project
```

2. Then tell Composer to require the plugin:

`composer require wbrowar/adminbar`
```bash
composer require wbrowar/craft-admin-bar
```

3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Admin Bar.

Expand Down Expand Up @@ -68,15 +72,15 @@ Here are the settings you can change with the config file:

### Admin Bar

| Setting | Default | Description |
| --- | --- |--------------------------------------------------------------------------------------------------------------------------|
| `additionalLinks` | *[]* | Add links to Admin Bar using the [properties found below](https://github.com/wbrowar/craft-3-adminbar#additional-links). |
| `displayGreeting` | *true* | Displays the logged in user's photo (if it's set) and "Hi, [friendlyname]". |
| `displayDashboardLink` | *true* | A link to the CP Dashboard. |
| `displayDefaultEditSection` | *true* | Display the name of the section in the default entry/category edit link if the user has permission to edit it. |
| `displayGuideLink` | *true* | If the [Guide](https://plugins.craftcms.com/guide) plugin is installed, a link to the Guide CP Section is displayed. |
| `displayLogout` | *true* | Displays a button that logs you out of Craft CMS. |
| `displaySettingsLink` | *true* | A link to the CP Settings page that appears only to admins. |
| Setting | Default | Description |
| --- | --- |-------------------------------------------------------------------------------------------------------------------------|
| `additionalLinks` | *[]* | Add links to Admin Bar using the [properties found below](https://github.com/wbrowar/craft-admin-bar#additional-links). |
| `displayGreeting` | *true* | Displays the logged in user's photo (if it's set) and "Hi, [friendlyname]". |
| `displayDashboardLink` | *true* | A link to the CP Dashboard. |
| `displayDefaultEditSection` | *true* | Display the name of the section in the default entry/category edit link if the user has permission to edit it. |
| `displayGuideLink` | *true* | If the [Guide](https://plugins.craftcms.com/guide) plugin is installed, a link to the Guide CP Section is displayed. |
| `displayLogout` | *true* | Displays a button that logs you out of Craft CMS. |
| `displaySettingsLink` | *true* | A link to the CP Settings page that appears only to admins. |

#### Additional Links
You can add links to Admin Bar using the config file by passing properties into an array, called `additionalLinks`. There are examples commented out in the `config.php` file, and here are the properties you can use to create links.
Expand All @@ -95,6 +99,6 @@ You can add links to Admin Bar using the config file by passing properties into
## Releases
Release notes can be found at [CHANGELOG.md](https://github.com/wbrowar/craft-3-adminbar/blob/master/CHANGELOG.md)
Release notes can be found at [CHANGELOG.md](https://github.com/wbrowar/craft-admin-bar/blob/main/CHANGELOG.md)
Please, let me know if this plugin is useful or if you have any suggestions or issues. [@wbrowar](https://twitter.com/wbrowar)
24 changes: 14 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
{
"name": "wbrowar/adminbar",
"name": "wbrowar/craft-admin-bar",
"description": "Front-end shortcuts for clients logged into Craft CMS.",
"type": "craft-plugin",
"version": "4.0.0-beta.0",
"version": "4.0.0",
"keywords": [
"craft",
"cms",
"craftcms",
"craft-plugin",
"admin bar"
"admin bar",
"admin-bar",
"toolbar",
"admin toolbar",
"author experience",
"ax"
],
"support": {
"docs": "https://raw.githubusercontent.com/wbrowar/craft-adminbar/3.x-craft-4/README.md",
"issues": "https://github.com/wbrowar/craft-adminbar/issues"
"docs": "https://raw.githubusercontent.com/wbrowar/craft-admin-bar/main/README.md",
"issues": "https://github.com/wbrowar/craft-admin-bar/issues"
},
"license": "MIT",
"authors": [
{
"name": "Will Browar",
"homepage": "https://wbrowar.com/plugins/adminbar"
"homepage": "https://wbrowar.com"
}
],
"require": {
Expand All @@ -36,10 +41,9 @@
"schemaVersion": "3.1.0",
"hasCpSettings": true,
"hasCpSection": false,
"changelogUrl": "https://raw.githubusercontent.com/wbrowar/craft-adminbar/3.x-craft-4/CHANGELOG.md",
"components": {
"bar": "wbrowar\\adminbar\\services\\Bar"
},
"developerUrl": "https://wbrowar.com",
"documentationUrl": "https://raw.githubusercontent.com/wbrowar/craft-admin-bar/main/README.md",
"changelogUrl": "https://raw.githubusercontent.com/wbrowar/craft-admin-bar/main/CHANGELOG.md",
"class": "wbrowar\\adminbar\\AdminBar"
}
}
7 changes: 6 additions & 1 deletion src/AdminBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Front-end shortcuts for clients logged into Craft CMS.
*
* @link https://wbrowar.com/plugins/adminbar
* @link https://wbrowar.com
* @copyright Copyright (c) 2017 Will Browar
*/

Expand Down Expand Up @@ -71,6 +71,11 @@ public function init(): void
parent::init();
self::$plugin = $this;

// Add our services
$this->setComponents([
"bar" => "wbrowar\adminbar\services\Bar"
]);

// Add in our Twig extensions
Craft::$app->view->registerTwigExtension(new AdminBarTwigExtension());

Expand Down
6 changes: 3 additions & 3 deletions src/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Front-end shortcuts for clients logged into Craft CMS.
*
* @link https://wbrowar.com/plugins/adminbar
* @link https://wbrowar.com
* @copyright Copyright (c) 2017 Will Browar
*/

Expand Down Expand Up @@ -59,8 +59,8 @@
],
// an example of a plugin action link
[
'title' => 'Clear Cache',
'url' => 'adminbar/clearTemplateCache',
'title' => 'Save Entry',
'url' => 'entries/save-entry',
'type' => 'action',
'admin' => true,
],
Expand Down
4 changes: 1 addition & 3 deletions src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
*
* Front-end shortcuts for clients logged into Craft CMS.
*
* @link https://wbrowar.com/plugins/adminbar
* @link https://wbrowar.com
* @copyright Copyright (c) 2017 Will Browar
*/

namespace wbrowar\adminbar\models;

//use wbrowar\adminbar\AdminBar;

//use Craft;
use craft\base\Model;

Expand Down
2 changes: 1 addition & 1 deletion src/services/Bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Front-end shortcuts for clients logged into Craft CMS.
*
* @link https://wbrowar.com/plugins/adminbar
* @link https://wbrowar.com
* @copyright Copyright (c) 2017 Will Browar
*/

Expand Down
2 changes: 1 addition & 1 deletion src/translations/en/admin-bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Front-end shortcuts for clients logged into Craft CMS.
*
* @link https://wbrowar.com/plugins/adminbar
* @link https://wbrowar.com
* @copyright Copyright (c) 2017 Will Browar
*/

Expand Down
2 changes: 1 addition & 1 deletion src/twigextensions/AdminBarTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Front-end shortcuts for clients logged into Craft CMS.
*
* @link https://wbrowar.com/plugins/adminbar
* @link https://wbrowar.com
* @copyright Copyright (c) 2017 Will Browar
*/

Expand Down

0 comments on commit 0e5512b

Please sign in to comment.