-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExtension.php
More file actions
43 lines (35 loc) · 1.42 KB
/
Extension.php
File metadata and controls
43 lines (35 loc) · 1.42 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
<?php
namespace Extension\Copona\ElFinderFileManager;
// << Vendor/Extension_kkāds vai Vendor/Extension
use Copona\System\Library\Extension\ExtensionBase;
class Extension extends ExtensionBase {
/**
* Define details about extension
* @return array
*/
public function details() {
return [
'name' => 'Elfinder File Manager', // Name, nosaukums.
'description' => ''
];
}
public function initAdmin() {
$location = 'admin/menu/design';
$this->registry->get('hook')->setHook($location, [$this, 'addToAdminMenu']);
}
public function addToAdminMenu(&$data): void {
$id = 'elfindermanager';
$route = 'common/elfinder';
$link_name = 'Elfinder File Manager';
if ($this->registry->get('user')->hasPermission('access', $route)) {
$data[] = [
'id' => $id,
'icon' => 'fa-tags',
'name' => '<span style="color: green;">' . $link_name . '</span>',
'href' => $this->registry->get('url')->link($route, 'token=' . $this->registry->get('session')->data('token'), true),
'denied' => ($this->registry->get('user')->hasPermission('access', $route) ? false : true), // available in the future. Taken from DEV repo.
'children' => [],
];
}
}
}