-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.php
43 lines (35 loc) · 969 Bytes
/
Plugin.php
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 BigSheetImporter;
use BigSheetImporter\Controllers\Controller;
use MapasCulturais\App;
class Plugin extends \MapasCulturais\Plugin
{
/**
* @var App
*/
private $app;
public function _init()
{
$this->app = App::i();
$plugin = $this;
$this->app->hook('template(panel.opportunities.tab-avaliacoes):after', function () use ($plugin) {
$plugin->tabImport();
});
}
/**
* @throws \Exception
*/
function register()
{
$this->app->registerController('bigsheet', Controller::class);
}
private function tabImport()
{
if (!$this->app->user->isUserAdmin($this->app->user)) {
return;
}
$this->app->view->enqueueStyle('app','bigsheet-style', 'css/bigsheet.css');
$this->app->view->part('bigsheet/tab-import');
$this->app->view->enqueueScript('app','bigsheet-script', 'js/bigsheet.js');
}
}