Repository navigation
Expand file tree
/
Copy pathConsoleUI.php
More file actions
59 lines (50 loc) · 2.12 KB
/
Copy pathConsoleUI.php
File metadata and controls
59 lines (50 loc) · 2.12 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
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\ConsoleUI;
class ConsoleUI extends \Piwik\Plugin
{
public function registerEvents()
{
return [
'Template.afterEventsReport' => 'renderOpenmostCommunicationAfterEvents',
'Widget.filterWidgets' => 'addOpenmostCommunicationWidgets',
'Template.beforeContent' => 'renderOpenmostCommunication',
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys',
];
}
public function getStylesheetFiles(&$stylesheets)
{
$stylesheets[] = 'plugins/ConsoleUI/vue/src/ConsolePage/ConsolePage.less';
}
public function getClientSideTranslationKeys(&$translationKeys)
{
$keys = [
'Console', 'Disabled', 'SecurityNotice', 'InputLabel', 'InputPlaceholder', 'Run', 'Running', 'Stop',
'Stopping', 'Stopped', 'Clear', 'Copy', 'Copied', 'OutputLabel', 'OutputEmpty', 'ExitCode', 'Duration',
'OutputTruncated', 'ConnectionLost', 'UnexpectedError', 'ReloadPage', 'Library', 'LibrarySearch', 'LibraryEmpty',
'LibraryCount', 'Arguments', 'Options', 'GlobalOptions', 'Required', 'Optional', 'Usage',
'InsertCommand', 'KeyboardHints', 'NoDescription', 'Suggestions', 'Aliases',
];
foreach ($keys as $key) {
$translationKeys[] = 'ConsoleUI_' . $key;
}
}
public function renderOpenmostCommunication(&$out, $layout, $module = '', $action = '')
{
OpenmostCommunication::beforeContent($out, (string) $layout, (string) $module, (string) $action, $this->getPluginName());
}
public function addOpenmostCommunicationWidgets($list)
{
OpenmostCommunication::filterWidgets($list, $this->getPluginName());
}
public function renderOpenmostCommunicationAfterEvents(&$out, $dataTable = null)
{
OpenmostCommunication::afterEventsReport($out, $this->getPluginName());
}
}