-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaxstarter.php
More file actions
75 lines (61 loc) · 1.64 KB
/
Copy pathaxstarter.php
File metadata and controls
75 lines (61 loc) · 1.64 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
<?php
use AxStarter\Module\Form;
use AxStarter\Module\Hook as AxHook;
use AxStarter\Module\Installer;
require_once __DIR__ . '/vendor/autoload.php';
class AxStarter extends Module
{
/**
* AxStarter constructor.
*/
public function __construct()
{
$this->name = 'axstarter';
$this->version = '1.1.0';
$this->author = 'Axome';
parent::__construct();
$this->displayName = $this->l('Axome :: Module Starter');
$this->bootstrap = true;
}
/**
* Magic method PHP.
* All hooks are declared in \AxStarter\Axome\Hook class
*
* @param string $name
* @param array $arguments
*/
public function __call(string $name, array $arguments)
{
if (method_exists(AxHook::class, $name)) {
# If the function is hook method, execute the treatment in \AxWebservice\Axome\Hook class
if (substr($name, 0, 4) === 'hook') {
return AxHook::execute($name, $this, isset($arguments[0]) ? $arguments[0] : null);
}
}
}
/**
* @return bool
*/
public function install() : bool
{
$installer = new Installer($this);
if (!parent::install() || !$installer->run())
return false;
return true;
}
/**
* @return bool
*/
public function uninstall() : bool
{
return parent::uninstall();
}
/**
* BackOffice module form
*/
public function getContent() : string
{
$form = new Form($this, $this->context);
return $form->processConfiguration() . $form->getForm() . $form->displayToken();
}
}