Completed
Push — master ( 2d0401...d6967e )
by Henry
15:58 queued 06:03
created

CodeEditor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 48
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderStart() 0 24 2
1
<?php
2
namespace Redaxscript\Modules\CodeEditor;
3
4
use Redaxscript\Head;
5
use Redaxscript\Module;
6
7
/**
8
 * publish content with perfect code
9
 *
10
 * @since 2.6.0
11
 *
12
 * @package Redaxscript
13
 * @category Modules
14
 * @author Henry Ruhs
15
 */
16
17
class CodeEditor extends Module\Module
18
{
19
	/**
20
	 * array of the module
21
	 *
22
	 * @var array
23
	 */
24
25
	protected static $_moduleArray =
26
	[
27
		'name' => 'Code Editor',
28
		'alias' => 'CodeEditor',
29
		'author' => 'Redaxmedia',
30
		'description' => 'Publish content with perfect code',
31
		'version' => '4.3.0'
32
	];
33
34
	/**
35
	 * renderStart
36
	 *
37
	 * @since 3.0.0
38
	 */
39
40
	public function renderStart() : void
41
	{
42
		if ($this->_registry->get('loggedIn') === $this->_registry->get('token'))
43
		{
44
			/* link */
45
46
			$link = Head\Link::getInstance();
47
			$link
48
				->init()
49
				->appendFile('modules/CodeEditor/dist/styles/ace.min.css');
50
51
			/* script */
52
53
			$script = Head\Script::getInstance();
54
			$script
55
				->init('foot')
56
				->appendFile(
57
				[
58
					'https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.11/ace.js',
59
					'modules/CodeEditor/assets/scripts/init.js',
60
					'modules/CodeEditor/dist/scripts/ace.min.js'
61
				]);
62
		}
63
	}
64
}
65