PR CI / flow (pull_request) Successful in 3s
PR CI / ledger (pull_request) Successful in 3s
PR CI / ui (pull_request) Successful in 17s
PR CI / test (lowest) (pull_request) Successful in 47s
PR CI / test (stable) (pull_request) Successful in 51s
PR CI / security (pull_request) Successful in 53s
PR CI / pr-ci (pull_request) Successful in 1s
PR CI / release-automerge (pull_request) Successful in 3s
55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace IriksIT\Manager\Modules\Revisions;
|
|
|
|
use IriksIT\Manager\Modules\BaseModule;
|
|
use IriksIT\Manager\Support\Permission;
|
|
use IriksIT\Manager\Support\Revisions;
|
|
|
|
/** The history of posts and pages (and of what a site adds): see an earlier state and put it back. */
|
|
class RevisionsModule extends BaseModule
|
|
{
|
|
public function key(): string
|
|
{
|
|
return 'revisions';
|
|
}
|
|
|
|
public function label(): string
|
|
{
|
|
return 'History';
|
|
}
|
|
|
|
public function enabledByDefault(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function tables(): array
|
|
{
|
|
return ['revisions'];
|
|
}
|
|
|
|
public function permissions(): array
|
|
{
|
|
return [
|
|
new Permission('revisions.view', 'See the history of posts and pages', 'History'),
|
|
new Permission('revisions.restore', 'Put an earlier version of a post or page back', 'History', needs: ['revisions.view']),
|
|
];
|
|
}
|
|
|
|
public function actions(): array
|
|
{
|
|
return ['revisions.restore' => ['Put an earlier version back']];
|
|
}
|
|
|
|
public function views(): array
|
|
{
|
|
return ['revisions.index' => 'Opened the history of a text'];
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
Revisions::listen();
|
|
}
|
|
}
|