|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* For licensing terms, see /license.txt */ |
|
4
|
|
|
|
|
5
|
|
|
namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Class SurveyQuestion. |
|
9
|
|
|
*/ |
|
10
|
|
|
class SurveyQuestion extends Basic |
|
11
|
|
|
{ |
|
12
|
|
|
/** |
|
13
|
|
|
* Get the toolbar config. |
|
14
|
|
|
* |
|
15
|
|
|
* @return array |
|
16
|
|
|
*/ |
|
17
|
|
|
public function getConfig() |
|
18
|
|
|
{ |
|
19
|
|
|
if ('true' != api_get_setting('more_buttons_maximized_mode')) { |
|
20
|
|
|
$config['toolbar'] = $this->getNormalToolbar(); |
|
|
|
|
|
|
21
|
|
|
} else { |
|
22
|
|
|
$config['toolbar_minToolbar'] = $this->getMinimizedToolbar(); |
|
23
|
|
|
$config['toolbar_maxToolbar'] = $this->getMaximizedToolbar(); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
return $config; |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Get the toolbar configuration when CKEditor is maximized. |
|
31
|
|
|
* |
|
32
|
|
|
* @return array |
|
33
|
|
|
*/ |
|
34
|
|
|
protected function getMaximizedToolbar() |
|
35
|
|
|
{ |
|
36
|
|
|
return [ |
|
37
|
|
|
$this->getNewPageBlock(), |
|
38
|
|
|
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', 'inserthtml'], |
|
39
|
|
|
['Undo', 'Redo', '-', 'SelectAll', 'Find', '-', 'RemoveFormat'], |
|
40
|
|
|
['Link', 'Unlink', 'Anchor', 'Glossary'], |
|
41
|
|
|
[ |
|
42
|
|
|
'Image', |
|
43
|
|
|
'Mapping', |
|
44
|
|
|
'Video', |
|
45
|
|
|
'Oembed', |
|
46
|
|
|
'Flash', |
|
47
|
|
|
'Youtube', |
|
48
|
|
|
'Audio', |
|
49
|
|
|
'leaflet', |
|
50
|
|
|
'Smiley', |
|
51
|
|
|
'SpecialChar', |
|
52
|
|
|
'Asciimath', |
|
53
|
|
|
'Asciisvg', |
|
54
|
|
|
], |
|
55
|
|
|
'/', |
|
56
|
|
|
['Table', '-', 'CreateDiv'], |
|
57
|
|
|
['BulletedList', 'NumberedList', 'HorizontalRule', '-', 'Outdent', 'Indent', 'Blockquote'], |
|
58
|
|
|
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], |
|
59
|
|
|
[ |
|
60
|
|
|
'Bold', |
|
61
|
|
|
'Italic', |
|
62
|
|
|
'Underline', |
|
63
|
|
|
'Strike', |
|
64
|
|
|
'-', |
|
65
|
|
|
'Subscript', |
|
66
|
|
|
'Superscript', |
|
67
|
|
|
'-', |
|
68
|
|
|
'TextColor', |
|
69
|
|
|
'BGColor', |
|
70
|
|
|
api_get_configuration_value('translate_html') ? 'Language' : '', |
|
71
|
|
|
], |
|
72
|
|
|
['true' == api_get_setting('allow_spellcheck') ? 'Scayt' : ''], |
|
73
|
|
|
['Styles', 'Format', 'Font', 'FontSize'], |
|
74
|
|
|
['PageBreak', 'ShowBlocks'], |
|
75
|
|
|
'true' == api_get_setting('enabled_wiris') ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''], |
|
76
|
|
|
['Toolbarswitch', 'Source'], |
|
77
|
|
|
]; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Get the toolbar configuration when CKEditor is minimized. |
|
82
|
|
|
* |
|
83
|
|
|
* @return array |
|
84
|
|
|
*/ |
|
85
|
|
|
protected function getMinimizedToolbar() |
|
86
|
|
|
{ |
|
87
|
|
|
return [ |
|
88
|
|
|
$this->getNewPageBlock(), |
|
89
|
|
|
['Undo', 'Redo'], |
|
90
|
|
|
['Link', 'Image', 'Video', 'Oembed', 'Flash', 'Youtube', 'Audio', 'Table', 'Asciimath', 'Asciisvg'], |
|
91
|
|
|
['BulletedList', 'NumberedList', 'HorizontalRule'], |
|
92
|
|
|
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], |
|
93
|
|
|
[ |
|
94
|
|
|
'Styles', |
|
95
|
|
|
'Format', |
|
96
|
|
|
'Font', |
|
97
|
|
|
'FontSize', |
|
98
|
|
|
'Bold', |
|
99
|
|
|
'Italic', |
|
100
|
|
|
'Underline', |
|
101
|
|
|
'TextColor', |
|
102
|
|
|
'BGColor', |
|
103
|
|
|
api_get_configuration_value('translate_html') ? 'Language' : '', |
|
104
|
|
|
], |
|
105
|
|
|
'true' == api_get_setting('enabled_wiris') ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''], |
|
106
|
|
|
['Toolbarswitch', 'Source'], |
|
107
|
|
|
]; |
|
108
|
|
|
} |
|
109
|
|
|
} |
|
110
|
|
|
|