-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwysiwyg.php
208 lines (162 loc) · 5.86 KB
/
wysiwyg.php
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Tiny MCE controller file.
|
| $URL$
| $Id$
+----------------------------------------------------------------------------+
*/
$_E107['no_online'] = true;
$_E107['no_forceuserupdate'] = true;
$_E107['no_menus'] = true;
$_E107['no_maintenance'] = true;
require_once(__DIR__.'/../../class2.php'); //TODO Prevent Theme loading.
/*
https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.2/tinymce.min.js
<script>
tinymce.init({
selector: 'textarea#tiny'
plugins: [
'a11ychecker','advlist','advcode','advtable','autolink','checklist','export',
'lists','link','image','charmap','preview','anchor','searchreplace','visualblocks',
'powerpaste','fullscreen','formatpainter','insertdatetime','media','table','help','wordcount'
],
toolbar: 'undo redo | a11ycheck casechange blocks | bold italic backcolor | alignleft aligncenter alignright alignjustify |' +
'bullist numlist checklist outdent indent | removeformat | code table help'
})
</script>
OLD**************************************************
echo '
tinymce.init({
"selector": ".e-wysiwyg",
"theme": "modern",
"plugins": "advlist autolink lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking save table contextmenu directionality emoticons template paste textcolor",
"language": "en",
"menubar": "edit view format insert table tools",
"toolbar1": "undo redo | styleselect | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | e107-image e107-video e107-glyph | preview",
"external_plugins": {"e107":"/e107_plugins/tinymce5/plugins/e107/plugin.js","example":"/e107_plugins/tinymce5/plugins/example/plugin.js"},
"image_advtab": true,
"extended_valid_elements": "i[*], object[*],embed[*],bbcode[*]",
"convert_fonts_to_spans": false,
"content_css": "http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css",
"relative_urls": false,
"preformatted": true,
// "document_base_url": "http://eternal.technology/"
});
';
exit;
*/
/*
echo 'tinymce.init({
selector: ".e-wysiwyg",
theme: "modern",
plugins: "template",
toolbar: "template",
// template_cdate_classes: "cdate creationdate",
// template_mdate_classes: "mdate modifieddate",
// template_selected_content_classes: "selcontent",
// template_cdate_format: "%m/%d/%Y : %H:%M:%S",
// template_mdate_format: "%m/%d/%Y : %H:%M:%S",
// template_replace_values: {
// username : "Jack Black",
// staffid : "991234"
// },
templates : [
{
title: "Editor Details",
url: "editor_details.htm",
description: "Adds Editor Name and Staff ID"
},
{
title: "Timestamp",
content: "Some Content goes here. ",
description: "Adds an editing timestamp."
}
]
});';
*/
// exit;
/*
$text = <<<TMPL
tinymce.init({
selector: ".e-wysiwyg",
theme: "modern",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor "
],
external_plugins: {
"example": "{e_PLUGIN_ABS}tinymce5/plugins/example/plugin.min.js",
"e107" : "{e_PLUGIN_ABS}tinymce5/plugins/e107/plugin.js"
},
menubar: "edit view format insert table tools",
toolbar1: "undo redo | styleselect | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | e107-image e107-video e107-glyph | preview",
image_advtab: true,
extended_valid_elements: 'span[*],i[*],iframe[*]',
trim_span_elements: false,
content_css: 'http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css',
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
});
TMPL;
$output = str_replace("{e_PLUGIN_ABS}", e_PLUGIN_ABS, $text);
*/
require_once(__DIR__."/wysiwyg_class.php");
$wy = new wysiwyg();
$config = varset($_GET['config'],false); // e_QUERY;
$gen = $wy->renderConfig($config);
define('USE_GZIP', true);
$compression_browser_support = false;
$compression_server_support = false;
if(strpos(varset($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') !== false)
{
$compression_browser_support = true;
}
if(ini_get("zlib.output_compression")=='' && function_exists("gzencode"))
{
$compression_server_support = true;
}
if(ADMIN && e_QUERY == 'debug' || !empty($_GET['debug']))
{
define('e_IFRAME', true);
require_once(HEADERF);
echo "<table class='table'><tr>";
echo "
<td>
".print_a($gen,true)."
</td>
</tr></table>";
// echo "<br />Browser gZip support: ".$compression_browser_support;
// echo "<br />Server gZip support: ". $compression_server_support;
require_once(FOOTERF);
}
elseif((USE_GZIP === true) && $compression_browser_support && $compression_server_support)
{
while (ob_get_length() !== false) // clear out anything that may have been echoed from class2.php or theme
{
ob_end_clean();
}
header('Content-type: text/javascript;charset=UTF-8');
header('Content-Encoding: gzip');
$minified = e107::minify($gen);
$gzipoutput = gzencode($minified,6);
header('Content-Length: '.strlen($gzipoutput));
echo $gzipoutput;
}
else
{
while (ob_get_length() !== false) // clear out anything that may have been echoed from class2.php or theme
{
ob_end_clean();
}
ob_start();
ob_implicit_flush(0);
header('Content-type: text/javascript', TRUE);
echo $gen;
}
exit;