(Grav GitSync) Automatic Commit from smokephil

This commit is contained in:
smokephil 2024-03-22 22:42:22 +01:00 committed by GitSync
commit 4267db646d
2765 changed files with 462171 additions and 0 deletions

View file

@ -0,0 +1,28 @@
# v1.1.1
## 01/01/2023
1. [](#bugfix)
* Fixed error when `$link['external']` is not set
# v1.1.0
## 12/28/2022
1. [](#new)
* Support external links [#10](https://github.com/trilbymedia/grav-plugin-quick-tray-links/pull/10)
1. [](#improved)
* Skip empty links + support authorization [#13](https://github.com/trilbymedia/grav-plugin-quick-tray-links/pull/13)
1. [](#bugfix)
* Fixed translations because of special chars [#14](https://github.com/trilbymedia/grav-plugin-quick-tray-links/pull/14)
# v1.0.1
## 12/02/2020
1. [](#improved)
* Added translations
* Updated blueprints
# v1.0.0
## 08/15/2017
1. [](#new)
* ChangeLog started...

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 Trilby Media, LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,51 @@
# Quick Tray Links Plugin
The **Quick Tray Links** Plugin is for [Grav CMS](http://github.com/getgrav/grav). Easily add customizable admin quick tray links
![](assets/quicktray-links.png)
## Installation
Installing the Quick Tray Links plugin can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.
### GPM Installation (Preferred)
The simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's terminal (also called the command line). From the root of your Grav install type:
bin/gpm install quick-tray-links
This will install the Quick Tray Links plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/quick-tray-links`.
## Configuration
Before configuring this plugin, you should copy the `user/plugins/quick-tray-links/quick-tray-links.yaml` to `user/config/plugins/quick-tray-links.yaml` and only edit that copy.
Here is the default configuration and an explanation of available options:
```yaml
enabled: true
links:
- icon: fa fa-book
link: https://learn.getgrav.org
tooltip: Grav Documentation and Tutorials
external: true
- icon: fa fa-info
link: /admin/config/info
tooltip: PHP Information
external: true
```
Possible fields for each link include:
* `icon` - icon classes to render icon
* `link` - Can be a relative URL or an absolute URL
* `tooltip` - The tooltip to display on hover
* `external` - Set to true, to open the link in a new window
* `class` - Any CSS classes you wish to add to the icon link
* `authorize` - A string that can be use to check authorization
## Usage
Simply create a configuration with the links you wish to see displayed in the Quick-Tray area

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View file

@ -0,0 +1,65 @@
name: Quick Tray Links
type: plugin
slug: quick-tray-links
version: 1.1.1
description: Easily add customizable admin quick tray links
icon: link
author:
name: Trilby Media, LLC
email: devs@trilbymedia.com
homepage: https://github.com/trilbymedia/grav-plugin-quick-tray-links
demo: http://demo.yoursite.com
keywords: grav, plugin, etc
bugs: https://github.com/trilbymedia/grav-plugin-quick-tray-links/issues
docs: https://github.com/trilbymedia/grav-plugin-quick-tray-links/blob/develop/README.md
license: MIT
form:
validation: strict
fields:
enabled:
type: toggle
label: PLUGIN_ADMIN.PLUGIN_STATUS
highlight: 1
default: 0
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
links:
type: list
label: PLUGIN_QUICK_TRAY_LINKS.LINKS
help: PLUGIN_QUICK_TRAY_LINKS.LINKS_HELP
fields:
.icon:
type: iconpicker
label: PLUGIN_QUICK_TRAY_LINKS.ICON
default: fa fa-question-circle
validate:
required: true
.link:
type: text
label: PLUGIN_QUICK_TRAY_LINKS.LINK
default: http://somelink.com
validate:
required: true
.tooltip:
type: textarea
label: PLUGIN_QUICK_TRAY_LINKS.TOOLTIP
.external:
type: toggle
label: PLUGIN_QUICK_TRAY_LINKS.EXTERNAL.LABEL
help: PLUGIN_QUICK_TRAY_LINKS.EXTERNAL.HINT
highlight: 1
default: 1
options:
0: PLUGIN_QUICK_TRAY_LINKS.NO
1: PLUGIN_QUICK_TRAY_LINKS.YES
validate:
type: bool

View file

@ -0,0 +1,47 @@
en:
PLUGIN_QUICK_TRAY_LINKS:
LINKS: 'Links'
LINKS_HELP: 'Links defined here will show up in the navigation quick-tray'
ICON: 'Icon'
LINK: 'Link'
TOOLTIP: 'Tooltip'
EXTERNAL:
LABEL: 'External'
HINT: 'Opens the link in a new window'
YES: 'Yes'
NO: 'No'
ru:
PLUGIN_QUICK_TRAY_LINKS:
LINKS: 'Ссылки'
LINKS_HELP: 'Определенные здесь ссылки будут отображаться в панели быстрого доступа'
ICON: 'Иконка'
LINK: 'Ссылка'
TOOLTIP: 'Подсказка'
uk:
PLUGIN_QUICK_TRAY_LINKS:
LINKS: 'Посилання'
LINKS_HELP: 'Визначені тут посилання відображатимуться у швидкому лотку навігації'
ICON: 'Іконка'
LINK: 'Посилання'
TOOLTIP: 'Підказка'
fr:
PLUGIN_QUICK_TRAY_LINKS:
LINKS: 'Liens'
LINKS_HELP: "Les liens ajoutés ici apparaitront dans la barre d'accès rapide du menu"
ICON: 'Icone'
LINK: 'Lien'
TOOLTIP: 'Infobulle'
de:
PLUGIN_QUICK_TRAY_LINKS:
LINKS: 'Links'
LINKS_HELP: 'Hier definierte Links werden im Quick-Tray angezeigt'
ICON: 'Icon'
LINK: 'Link'
TOOLTIP: 'Tooltip'
EXTERNAL:
LABEL: 'Extern'
HINT: 'Öffnet den Link in einem neuen Fenster'
YES: 'Ja'
NO: 'Nein'

View file

@ -0,0 +1,51 @@
<?php
namespace Grav\Plugin;
use Grav\Common\Plugin;
use RocketTheme\Toolbox\Event\Event;
/**
* Class QuickTrayLinksPlugin
* @package Grav\Plugin
*/
class QuickTrayLinksPlugin extends Plugin
{
/**
* @return array
*
* The getSubscribedEvents() gives the core a list of events
* that the plugin wants to listen to. The key of each
* array section is the event that the plugin listens to
* and the value (in the form of an array) contains the
* callable (or function) as well as the priority. The
* higher the number the higher the priority.
*/
public static function getSubscribedEvents()
{
return [
'onAdminMenu' => ['onAdminMenu', 0]
];
}
public function onAdminMenu()
{
$counter = 0;
foreach ($this->grav['config']->get('plugins.quick-tray-links.links') as $link) {
if ($link == null || $link == false) {
continue;
}
$options = [
'icon' => $link['icon'],
'route' => $link['link'],
'hint' => isset($link['tooltip']) ? $link['tooltip'] : '',
'authorize' => isset($link['authorize']) ? $link['authorize'] : ''
];
if (isset($link['external']) and $link['external'] == true) {
$options['target'] = '_blank';
}
$this->grav['twig']->plugins_quick_tray['QuickTrayLinks-' . $counter++] = $options;
}
}
}

View file

@ -0,0 +1,10 @@
enabled: true
links:
- icon: fa fa-book
link: https://learn.getgrav.org
tooltip: Grav Documentation and Tutorials
external: true
- icon: fa fa-info
link: /admin/config/info
tooltip: PHP Information
external: true