wi-adrema-plugin/Plugin.php

107 lines
2.3 KiB
PHP

<?php
namespace Silva\Adrema;
use Backend;
use Silva\Adrema\Components\EventIndex;
use Silva\Adrema\Components\EventRegister;
use Silva\Adrema\Models\Settings;
use System\Classes\PluginBase;
/**
* Plugin Information File
*
* @link https://docs.octobercms.com/3.x/extend/system/plugins.html
*/
class Plugin extends PluginBase
{
/**
* pluginDetails about this plugin.
*/
public function pluginDetails()
{
return [
'name' => 'adrema',
'description' => 'No description provided yet...',
'author' => 'silva',
'icon' => 'icon-leaf'
];
}
/**
* register method, called when the plugin is first registered.
*/
public function register()
{
//
}
/**
* boot method, called right before the request route.
*/
public function boot()
{
//
}
/**
* registerComponents used by the frontend.
*/
public function registerComponents()
{
return [
EventIndex::class => 'adrema_event_index',
EventRegister::class => 'adrema_event_register',
];
}
/**
* registerPermissions used by the backend.
*/
public function registerPermissions()
{
return []; // Remove this line to activate
return [
'silva.adrema.some_permission' => [
'tab' => 'adrema',
'label' => 'Some permission'
],
];
}
/**
* registerPermissions used by the backend.
*/
public function registerSettings()
{
return [
'settings' => [
'label' => 'Adrema',
'description' => 'setting_description',
'category' => 'CATEGORY_CMS',
'icon' => 'icon-cog',
'class' => Settings::class,
]
];
}
/**
* registerNavigation used by the backend.
*/
public function registerNavigation()
{
return []; // Remove this line to activate
return [
'adrema' => [
'label' => 'adrema',
'url' => Backend::url('silva/adrema/mycontroller'),
'icon' => 'icon-leaf',
'permissions' => ['silva.adrema.*'],
'order' => 500,
],
];
}
}