wi-events/Plugin.php

130 lines
3.1 KiB
PHP

<?php
namespace Zoomyboy\Event;
use Backend;
use Carbon\Carbon;
use System\Classes\PluginBase;
use Zoomyboy\Event\Console\EventManageCommand;
/**
* 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()
{
$this->registerConsoleCommand('event.event-manage', EventManageCommand::class);
}
/**
* 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,
'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,
],
],
],
];
}
public function registerMarkupTags(): array
{
return [
'filters' => [
'date' => function ($date) {
return Carbon::parse($date)->format('d.m.Y');
},
],
];
}
public function registerMailTemplates()
{
return [
'zoomyboy.event::mail.confirm',
];
}
}