Editor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 63
dl 0
loc 98
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEditorHelp() 0 5 1
B getMarkupSet() 0 82 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Saito - The Threaded Web Forum
7
 *
8
 * @copyright Copyright (c) the Saito Project Developers
9
 * @link https://github.com/Schlaefer/Saito
10
 * @license http://opensource.org/licenses/MIT
11
 */
12
13
namespace Plugin\BbcodeParser\src\Lib;
14
15
use App\View\Helper\ParserHelper;
16
17
class Editor
18
{
19
    /**
20
     * {@inheritDoc}
21
     */
22
    public function getEditorHelp(ParserHelper $helper): string
23
    {
24
        return $helper->SaitoHelp->icon(
25
            'BbcodeParser.1',
26
            ['label' => __d('bbcode_parser', 'parsedAsBbcode')]
27
        );
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function getMarkupSet(): array
34
    {
35
        return [
36
            [
37
                'name' => "<i class='fa fa-bold'></i>",
38
                'title' => __('Bold'),
39
                'className' => 'btn-markup-Bold',
40
                'type' => 'enclose',
41
                'openWith' => '[b]',
42
                'closeWith' => '[/b]',
43
            ],
44
            [
45
                'name' => "<i class='fa fa-italic'></i>",
46
                'title' => __('Italic'),
47
                'className' => 'btn-markup-Italic',
48
                'type' => 'enclose',
49
                'openWith' => '[i]',
50
                'closeWith' => '[/i]',
51
            ],
52
            [
53
                'name' => "<i class='fa fa-strikethrough'></i>",
54
                'title' => __('Strike Through'),
55
                'className' => 'btn-markup-Stroke',
56
                'type' => 'enclose',
57
                'openWith' => '[strike]',
58
                'closeWith' => '[/strike]',
59
            ],
60
            [
61
                'name' => "<i class='fa fa-s-code'></i>",
62
                'title' => __('Code'),
63
                'className' => 'btn-markup-Code',
64
                'type' => 'enclose',
65
                'openWith' => "[code=text]\n",
66
                'closeWith' => "\n[/code]",
67
            ],
68
            [
69
                'name' => "<i class='fa fa-list-ul'></i>",
70
                'title' => __('Bullet List'),
71
                'className' => 'btn-markup-List',
72
                'type' => 'enclose',
73
                'openWith' => "[list]\n[*] ",
74
                'closeWith' => "\n[*]\n[/list]",
75
            ],
76
            [
77
                'name' => "<i class='fa fa-stop'></i>",
78
                'className' => 'btn-markup-Spoiler',
79
                'title' => __('Spoiler'),
80
                'type' => 'enclose',
81
                'openWith' => '[spoiler]',
82
                'closeWith' => '[/spoiler]',
83
            ],
84
            [
85
                'name' => "<i class='fa fa-quote-left'></i>",
86
                'className' => 'btn-markup-Quote',
87
                'title' => __('Cite'),
88
                'type' => 'enclose',
89
                'openWith' => '[quote]',
90
                'closeWith' => '[/quote]',
91
            ],
92
            [
93
                'type' => 'separator',
94
            ],
95
            [
96
                'name' => "<i class='fa fa-link'></i>",
97
                'title' => __('Link'),
98
                'className' => 'btn-markup-Link',
99
                'type' => 'saito-link',
100
                'handler' => 'link',
101
            ],
102
            [
103
                'name' => "<i class='fa fa-multimedia'></i>",
104
                'className' => 'btn-markup-Media',
105
                'title' => __('Media'),
106
                'type' => 'saito-media',
107
                'handler' => 'media',
108
            ],
109
            [
110
                'name' => '<i class=\'fa fa-upload\'></i>',
111
                'title' => __('Upload'),
112
                'className' => 'btn-markup-Upload',
113
                'type' => 'saito-upload',
114
                'handler' => 'upload',
115
            ],
116
        ];
117
    }
118
}
119