wi-events/Plugin.php

128 lines
3.0 KiB
PHP
Raw Normal View History

2023-01-07 16:10:18 +01:00
<?php
namespace Zoomyboy\Event;
use Backend;
2023-02-12 21:41:40 +01:00
use Carbon\Carbon;
2023-01-07 16:10:18 +01:00
use System\Classes\PluginBase;
/**
* event Plugin Information File.
*/
class Plugin extends PluginBase
{
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'event',
'description' => 'No description provided yet...',
'author' => 'zoomyboy',
'icon' => 'icon-leaf',
];
}
/**
* Register method, called when the plugin is first registered.
*
* @return void
*/
public function register()
{
}
/**
* Boot method, called right before the request route.
*
* @return array
*/
public function boot()
{
}
/**
* Registers any front-end components implemented in this plugin.
*
* @return array
*/
public function registerComponents()
{
return [
'Zoomyboy\Event\Components\EventForm' => 'event_form',
];
}
/**
* Registers any back-end permissions used by this plugin.
*
* @return array
*/
public function registerPermissions()
{
return []; // Remove this line to activate
return [
'zoomyboy.event.some_permission' => [
'tab' => 'event',
'label' => 'Some permission',
],
];
}
/**
* Registers back-end navigation items for this plugin.
*
* @return array
*/
public function registerNavigation()
{
return [
'event' => [
'label' => 'Teilnehmer',
'url' => Backend::url('zoomyboy/event/participant'),
'icon' => 'icon-leaf',
'permissions' => ['zoomyboy.event.*'],
'order' => 500,
2023-02-12 01:25:16 +01:00
'sideMenu' => [
'event' => [
'label' => 'Veranstaltungen',
'url' => Backend::url('zoomyboy/event/event'),
'icon' => 'icon-leaf',
'permissions' => ['zoomyboy.event.*'],
'order' => 500,
],
'participant' => [
'label' => 'Teilnehmer',
'url' => Backend::url('zoomyboy/event/participant'),
'icon' => 'icon-leaf',
'permissions' => ['zoomyboy.event.*'],
'order' => 500,
],
],
2023-01-07 16:10:18 +01:00
],
];
}
2023-01-07 18:42:56 +01:00
2023-02-12 21:41:40 +01:00
public function registerMarkupTags(): array
{
return [
'filters' => [
'date' => function ($date) {
return Carbon::parse($date)->format('d.m.Y');
},
],
];
}
2023-01-07 18:42:56 +01:00
public function registerMailTemplates()
{
return [
'zoomyboy.event::mail.confirm',
];
}
2023-01-07 16:10:18 +01:00
}