105 lines
2.6 KiB
PHP
105 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace Zoomyboy\Owncloud;
|
|
|
|
use Backend;
|
|
use Backend\Models\UserRole;
|
|
use System\Classes\PluginBase;
|
|
use Zoomyboy\Owncloud\Components\Confirm;
|
|
use Zoomyboy\Owncloud\Components\Form;
|
|
use Zoomyboy\Owncloud\Models\Settings;
|
|
|
|
/**
|
|
* owncloud Plugin Information File.
|
|
*/
|
|
class Plugin extends PluginBase
|
|
{
|
|
/**
|
|
* Returns information about this plugin.
|
|
*/
|
|
public function pluginDetails(): array
|
|
{
|
|
return [
|
|
'name' => 'zoomyboy.owncloud::lang.plugin.name',
|
|
'description' => 'zoomyboy.owncloud::lang.plugin.description',
|
|
'author' => 'zoomyboy',
|
|
'icon' => 'icon-leaf',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Register method, called when the plugin is first registered.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Boot method, called right before the request route.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Registers any frontend components implemented in this plugin.
|
|
*/
|
|
public function registerComponents(): array
|
|
{
|
|
return [
|
|
Form::class => 'owncloud_form',
|
|
Confirm::class => 'owncloud_confirm',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Registers any backend permissions used by this plugin.
|
|
*/
|
|
public function registerPermissions(): array
|
|
{
|
|
return []; // Remove this line to activate
|
|
|
|
return [
|
|
'zoomyboy.owncloud.some_permission' => [
|
|
'tab' => 'zoomyboy.owncloud::lang.plugin.name',
|
|
'label' => 'zoomyboy.owncloud::lang.permissions.some_permission',
|
|
'roles' => [UserRole::CODE_DEVELOPER, UserRole::CODE_PUBLISHER],
|
|
],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Registers backend navigation items for this plugin.
|
|
*/
|
|
public function registerNavigation(): array
|
|
{
|
|
return []; // Remove this line to activate
|
|
|
|
return [
|
|
'owncloud' => [
|
|
'label' => 'zoomyboy.owncloud::lang.plugin.name',
|
|
'url' => Backend::url('zoomyboy/owncloud/mycontroller'),
|
|
'icon' => 'icon-leaf',
|
|
'permissions' => ['zoomyboy.owncloud.*'],
|
|
'order' => 500,
|
|
],
|
|
];
|
|
}
|
|
|
|
public function registerSettings(): array
|
|
{
|
|
return [
|
|
'settings' => [
|
|
'label' => 'Owncloud Settings',
|
|
'description' => 'Owncloud Zugangsdaten',
|
|
'category' => 'Services',
|
|
'icon' => 'icon-cog',
|
|
'class' => Settings::class,
|
|
'order' => 500,
|
|
'keywords' => 'owncloud api',
|
|
'permissions' => [],
|
|
],
|
|
];
|
|
}
|
|
}
|