Repository navigation
Expand file tree
/
Copy pathProcessKeyHelp.module.php
More file actions
90 lines (78 loc) · 3.24 KB
/
Copy pathProcessKeyHelp.module.php
File metadata and controls
90 lines (78 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php namespace ProcessWire;
require_once __DIR__ . '/views/_icons.php';
require_once __DIR__ . '/src/ProcessKeyHelp/ProcessKeyHelpAdminContextTrait.php';
require_once __DIR__ . '/src/ProcessKeyHelp/ProcessKeyHelpScreensTrait.php';
require_once __DIR__ . '/src/ProcessKeyHelp/ProcessKeyHelpInstallerTrait.php';
require_once __DIR__ . '/src/ProcessKeyHelp/ProcessKeyHelpAccessTrait.php';
require_once __DIR__ . '/src/ProcessKeyHelp/ProcessKeyHelpInstallerSupportTrait.php';
require_once __DIR__ . '/src/ProcessKeyHelp/ProcessKeyHelpRenderingTrait.php';
/**
* ProcessKeyHelp
*
* Admin UI for the KeyHelp hosting panel integration.
* Depends on the KeyHelp module for configuration and API access.
*
* @author Maxim Semenov <maxim@smnv.org> (smnv.org)
* @link https://smnv.org
* @license MIT
* @version 100
*/
class ProcessKeyHelp extends Process implements Module {
use ProcessKeyHelpAdminContextTrait;
use ProcessKeyHelpScreensTrait;
use ProcessKeyHelpInstallerTrait;
use ProcessKeyHelpAccessTrait;
use ProcessKeyHelpInstallerSupportTrait;
use ProcessKeyHelpRenderingTrait;
// Permission names
const PERM_VIEW = 'keyhelp-view';
const PERM_EDIT = 'keyhelp-edit';
const PERM_DELETE = 'keyhelp-delete';
const PERM_SERVER = 'keyhelp-server';
public static function getModuleInfo(): array {
return [
'title' => 'KeyHelp',
'version' => 100,
'summary' => 'Admin UI for KeyHelp hosting panel integration.',
'author' => 'Maxim Semenov',
'href' => 'https://smnv.org',
'singular' => true,
'autoload' => false,
'icon' => 'server',
'requires' => ['KeyHelp', 'ProcessWire>=3.0.200'],
'page' => [
'name' => 'keyhelp',
'title' => 'KeyHelp',
'parent' => 'admin',
],
'permissions' => [
self::PERM_VIEW => 'KeyHelp: view domains, databases, email, FTP, cron, SSL, server info',
self::PERM_EDIT => 'KeyHelp: create and edit resources (requires keyhelp-view)',
self::PERM_DELETE => 'KeyHelp: delete resources (requires keyhelp-view)',
self::PERM_SERVER => 'KeyHelp: access server info and reboot (multi-tenant only)',
],
];
}
// -----------------------------------------------------------------------
// Shortcut to core module
// -----------------------------------------------------------------------
private function kh(): KeyHelp {
return $this->wire('modules')->get('KeyHelp');
}
private function adminUrl(): string {
return $this->wire('config')->urls->admin . 'keyhelp/';
}
public function ___executed($methodName): void {
$this->setAdminContext($methodName);
}
// -----------------------------------------------------------------------
// Install / Uninstall
// -----------------------------------------------------------------------
public function ___install(): void {
parent::___install();
$this->ensureProcessWireInstallTable();
}
public function ___uninstall(): void {
parent::___uninstall();
}
}