generated from Nodarx/template
b79666566a
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
40 lines
1.5 KiB
PHP
40 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KTXM\ServiceWopi;
|
|
|
|
use KTXF\Module\Configuration\ConsoleModuleContextInterface;
|
|
use KTXF\Module\Configuration\BrowserModuleContextInterface;
|
|
use KTXF\Module\Configuration\ModuleContextInterface;
|
|
use KTXF\Module\ModuleInstanceAbstract;
|
|
use KTXM\ServiceWopi\Console\CheckCommand;
|
|
use KTXM\ServiceWopi\Console\CleanupCommand;
|
|
use KTXM\ServiceWopi\Console\ConfigureCommand;
|
|
|
|
class Module extends ModuleInstanceAbstract
|
|
{
|
|
public function handle(): string { return 'service_wopi'; }
|
|
public function label(): string { return 'WOPI Service'; }
|
|
public function author(): string { return 'Ktrix'; }
|
|
public function version(): string { return '0.0.1'; }
|
|
public function description(): string { return 'Read-only WOPI document access and discovery'; }
|
|
|
|
public function permissions(): array
|
|
{
|
|
return ['service_wopi.view' => ['label' => 'View office documents', 'description' => 'Open documents in the configured office server', 'group' => 'Documents']];
|
|
}
|
|
|
|
public function configure(ModuleContextInterface $context): void
|
|
{
|
|
if ($context instanceof BrowserModuleContextInterface) {
|
|
$context->registerModule($this, 'ServiceWopi', 'static/module.mjs');
|
|
}
|
|
if ($context instanceof ConsoleModuleContextInterface) {
|
|
$context->registerCommand(CheckCommand::class);
|
|
$context->registerCommand(CleanupCommand::class);
|
|
$context->registerCommand(ConfigureCommand::class);
|
|
}
|
|
}
|
|
}
|