Completed
Push — master ( a848da...37f5b2 )
by Henry
05:28
created

ConfirmAction::renderStart()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Redaxscript\Modules\ConfirmAction;
3
4
use Redaxscript\Head;
5
use Redaxscript\Module;
6
use Redaxscript\Modules;
7
8
/**
9
 * confirm critical action
10
 *
11
 * @since 4.3.0
12
 *
13
 * @package Redaxscript
14
 * @category Modules
15
 * @author Henry Ruhs
16
 */
17
18
class ConfirmAction extends Module\Module
19
{
20
	/**
21
	 * array of the module
22
	 *
23
	 * @var array
24
	 */
25
26
	protected static $_moduleArray =
27
	[
28
		'name' => 'Confirm Action',
29
		'alias' => 'ConfirmAction',
30
		'author' => 'Redaxmedia',
31
		'description' => 'Confirm critical action',
32
		'version' => '4.3.0'
33
	];
34
35
	/**
36
	 * renderStart
37
	 *
38
	 * @since 4.3.0
39
	 */
40
41
	public function renderStart() : void
42
	{
43
		$script = Head\Script::getInstance();
44
		$script
45
			->init('foot')
46
			->appendFile(
47
			[
48
				'modules/ConfirmAction/assets/scripts/init.js',
49
				'modules/ConfirmAction/dist/scripts/confirm-action.min.js'
50
			]);
51
	}
52
53
	/**
54
	 * install the module
55
	 *
56
	 * @since 4.3.0
57
	 *
58
	 * @return bool
59
	 */
60
61
	public function install() : bool
62
	{
63
		$dialog = new Modules\Dialog\Dialog($this->_registry, $this->_request, $this->_language, $this->_config);
64
		return $dialog->reinstall() && parent::install();
65
	}
66
}
67