@@ -55,7 +55,7 @@ |
||
55 | 55 | * An array containing editor properties as returned from hook_editor(). |
56 | 56 | * |
57 | 57 | * @return |
58 | - * The installed editor version. |
|
58 | + null|string The installed editor version. |
|
59 | 59 | */ |
60 | 60 | function wysiwyg_ckeditor_version($editor) { |
61 | 61 | $library = $editor['library path'] . '/ckeditor.js'; |
@@ -9,23 +9,23 @@ discard block |
||
9 | 9 | * Plugin implementation of hook_editor(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_ckeditor_editor() { |
12 | - $editor['ckeditor'] = array( |
|
12 | + $editor['ckeditor'] = array( |
|
13 | 13 | 'title' => 'CKEditor', |
14 | 14 | 'vendor url' => 'http://ckeditor.com', |
15 | 15 | 'download url' => 'http://ckeditor.com/download', |
16 | 16 | 'libraries' => array( |
17 | - '' => array( |
|
17 | + '' => array( |
|
18 | 18 | 'title' => 'Default', |
19 | 19 | 'files' => array( |
20 | - 'ckeditor.js' => array('preprocess' => FALSE), |
|
20 | + 'ckeditor.js' => array('preprocess' => FALSE), |
|
21 | 21 | ), |
22 | - ), |
|
23 | - 'src' => array( |
|
22 | + ), |
|
23 | + 'src' => array( |
|
24 | 24 | 'title' => 'Source', |
25 | 25 | 'files' => array( |
26 | - 'ckeditor_source.js' => array('preprocess' => FALSE), |
|
26 | + 'ckeditor_source.js' => array('preprocess' => FALSE), |
|
27 | + ), |
|
27 | 28 | ), |
28 | - ), |
|
29 | 29 | ), |
30 | 30 | 'version callback' => 'wysiwyg_ckeditor_version', |
31 | 31 | 'themes callback' => 'wysiwyg_ckeditor_themes', |
@@ -33,19 +33,19 @@ discard block |
||
33 | 33 | 'plugin callback' => 'wysiwyg_ckeditor_plugins', |
34 | 34 | 'plugin settings callback' => 'wysiwyg_ckeditor_plugin_settings', |
35 | 35 | 'proxy plugin' => array( |
36 | - 'drupal' => array( |
|
36 | + 'drupal' => array( |
|
37 | 37 | 'load' => TRUE, |
38 | 38 | 'proxy' => TRUE, |
39 | - ), |
|
39 | + ), |
|
40 | 40 | ), |
41 | 41 | 'proxy plugin settings callback' => 'wysiwyg_ckeditor_proxy_plugin_settings', |
42 | 42 | 'versions' => array( |
43 | - '3.0.0.3665' => array( |
|
43 | + '3.0.0.3665' => array( |
|
44 | 44 | 'js files' => array('ckeditor-3.0.js'), |
45 | - ), |
|
45 | + ), |
|
46 | 46 | ), |
47 | - ); |
|
48 | - return $editor; |
|
47 | + ); |
|
48 | + return $editor; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -58,25 +58,25 @@ discard block |
||
58 | 58 | * The installed editor version. |
59 | 59 | */ |
60 | 60 | function wysiwyg_ckeditor_version($editor) { |
61 | - $library = $editor['library path'] . '/ckeditor.js'; |
|
62 | - if (!file_exists($library)) { |
|
61 | + $library = $editor['library path'] . '/ckeditor.js'; |
|
62 | + if (!file_exists($library)) { |
|
63 | 63 | return; |
64 | - } |
|
65 | - $library = fopen($library, 'r'); |
|
66 | - $max_lines = 8; |
|
67 | - while ($max_lines && $line = fgets($library, 500)) { |
|
64 | + } |
|
65 | + $library = fopen($library, 'r'); |
|
66 | + $max_lines = 8; |
|
67 | + while ($max_lines && $line = fgets($library, 500)) { |
|
68 | 68 | // version:'CKEditor 3.0 SVN',revision:'3665' |
69 | 69 | // version:'3.0 RC',revision:'3753' |
70 | 70 | // version:'3.0.1',revision:'4391' |
71 | 71 | if (preg_match('@version:\'(?:CKEditor )?([\d\.]+)(?:.+revision:\'([\d]+))?@', $line, $version)) { |
72 | - fclose($library); |
|
73 | - // Version numbers need to have three parts since 3.0.1. |
|
74 | - $version[1] = preg_replace('/^(\d+)\.(\d+)$/', '${1}.${2}.0', $version[1]); |
|
75 | - return $version[1] . '.' . $version[2]; |
|
72 | + fclose($library); |
|
73 | + // Version numbers need to have three parts since 3.0.1. |
|
74 | + $version[1] = preg_replace('/^(\d+)\.(\d+)$/', '${1}.${2}.0', $version[1]); |
|
75 | + return $version[1] . '.' . $version[2]; |
|
76 | 76 | } |
77 | 77 | $max_lines--; |
78 | - } |
|
79 | - fclose($library); |
|
78 | + } |
|
79 | + fclose($library); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -92,23 +92,23 @@ discard block |
||
92 | 92 | * theme name. |
93 | 93 | */ |
94 | 94 | function wysiwyg_ckeditor_themes($editor, $profile) { |
95 | - // @todo Skins are not themes but this will do for now. |
|
96 | - $path = $editor['library path'] . '/skins/'; |
|
97 | - if (file_exists($path) && ($dir_handle = opendir($path))) { |
|
95 | + // @todo Skins are not themes but this will do for now. |
|
96 | + $path = $editor['library path'] . '/skins/'; |
|
97 | + if (file_exists($path) && ($dir_handle = opendir($path))) { |
|
98 | 98 | $themes = array(); |
99 | 99 | while ($file = readdir($dir_handle)) { |
100 | - if (is_dir($path . $file) && substr($file, 0, 1) != '.' && $file != 'CVS') { |
|
100 | + if (is_dir($path . $file) && substr($file, 0, 1) != '.' && $file != 'CVS') { |
|
101 | 101 | $themes[] = $file; |
102 | - } |
|
102 | + } |
|
103 | 103 | } |
104 | 104 | closedir($dir_handle); |
105 | 105 | natcasesort($themes); |
106 | 106 | $themes = array_values($themes); |
107 | 107 | return !empty($themes) ? $themes : array('default'); |
108 | - } |
|
109 | - else { |
|
108 | + } |
|
109 | + else { |
|
110 | 110 | return array('default'); |
111 | - } |
|
111 | + } |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * Drupal.settings.wysiwyg.configs.{editor} |
127 | 127 | */ |
128 | 128 | function wysiwyg_ckeditor_settings($editor, $config, $theme) { |
129 | - $settings = array( |
|
129 | + $settings = array( |
|
130 | 130 | 'baseHref' => $GLOBALS['base_url'] . '/', |
131 | 131 | 'width' => '100%', |
132 | 132 | // For better compatibility with smaller textareas. |
@@ -142,155 +142,155 @@ discard block |
||
142 | 142 | // @todo Check whether completely disabling ProcessHTMLEntities is an option. |
143 | 143 | 'entities_latin' => FALSE, |
144 | 144 | 'entities_greek' => FALSE, |
145 | - ); |
|
145 | + ); |
|
146 | 146 | |
147 | - // Add HTML block format settings; common block formats are already predefined |
|
148 | - // by CKEditor. |
|
149 | - if (isset($config['block_formats'])) { |
|
147 | + // Add HTML block format settings; common block formats are already predefined |
|
148 | + // by CKEditor. |
|
149 | + if (isset($config['block_formats'])) { |
|
150 | 150 | $block_formats = explode(',', drupal_strtolower($config['block_formats'])); |
151 | 151 | $predefined_formats = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'pre', 'address', 'div'); |
152 | 152 | foreach (array_diff($block_formats, $predefined_formats) as $tag) { |
153 | - $tag = trim($tag); |
|
154 | - $settings["format_$tag"] = array('element' => $tag); |
|
153 | + $tag = trim($tag); |
|
154 | + $settings["format_$tag"] = array('element' => $tag); |
|
155 | 155 | } |
156 | 156 | $settings['format_tags'] = implode(';', $block_formats); |
157 | - } |
|
157 | + } |
|
158 | 158 | |
159 | - if (isset($config['apply_source_formatting'])) { |
|
159 | + if (isset($config['apply_source_formatting'])) { |
|
160 | 160 | $settings['apply_source_formatting'] = $config['apply_source_formatting']; |
161 | - } |
|
161 | + } |
|
162 | 162 | |
163 | - if (isset($config['css_setting'])) { |
|
163 | + if (isset($config['css_setting'])) { |
|
164 | 164 | // Versions below 3.0.1 could only handle one stylesheet. |
165 | 165 | if (version_compare($editor['installed version'], '3.0.1.4391', '<')) { |
166 | - if ($config['css_setting'] == 'theme') { |
|
166 | + if ($config['css_setting'] == 'theme') { |
|
167 | 167 | $settings['contentsCss'] = reset(wysiwyg_get_css()); |
168 | - } |
|
169 | - elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
168 | + } |
|
169 | + elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
170 | 170 | $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
171 | - } |
|
171 | + } |
|
172 | 172 | } |
173 | 173 | else { |
174 | - if ($config['css_setting'] == 'theme') { |
|
174 | + if ($config['css_setting'] == 'theme') { |
|
175 | 175 | $settings['contentsCss'] = wysiwyg_get_css(); |
176 | - } |
|
177 | - elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
176 | + } |
|
177 | + elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
178 | 178 | $settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()))); |
179 | - } |
|
179 | + } |
|
180 | + } |
|
180 | 181 | } |
181 | - } |
|
182 | 182 | |
183 | - if (isset($config['language'])) { |
|
183 | + if (isset($config['language'])) { |
|
184 | 184 | $settings['language'] = $config['language']; |
185 | - } |
|
186 | - if (isset($config['resizing'])) { |
|
185 | + } |
|
186 | + if (isset($config['resizing'])) { |
|
187 | 187 | // CKEditor tests "!== false", so ensure it is a Boolean. |
188 | 188 | $settings['resize_enabled'] = (bool) $config['resizing']; |
189 | - } |
|
190 | - if (isset($config['toolbar_loc'])) { |
|
189 | + } |
|
190 | + if (isset($config['toolbar_loc'])) { |
|
191 | 191 | $settings['toolbarLocation'] = $config['toolbar_loc']; |
192 | - } |
|
192 | + } |
|
193 | 193 | |
194 | - $settings['toolbar'] = array(); |
|
195 | - if (!empty($config['buttons'])) { |
|
194 | + $settings['toolbar'] = array(); |
|
195 | + if (!empty($config['buttons'])) { |
|
196 | 196 | $extra_plugins = array(); |
197 | 197 | $plugins = wysiwyg_get_plugins($editor['name']); |
198 | 198 | foreach ($config['buttons'] as $plugin => $buttons) { |
199 | - foreach ($buttons as $button => $enabled) { |
|
199 | + foreach ($buttons as $button => $enabled) { |
|
200 | 200 | // Iterate separately over buttons and extensions properties. |
201 | 201 | foreach (array('buttons', 'extensions') as $type) { |
202 | - // Skip unavailable plugins. |
|
203 | - if (!isset($plugins[$plugin][$type][$button])) { |
|
202 | + // Skip unavailable plugins. |
|
203 | + if (!isset($plugins[$plugin][$type][$button])) { |
|
204 | 204 | continue; |
205 | - } |
|
206 | - // Add buttons. |
|
207 | - if ($type == 'buttons') { |
|
205 | + } |
|
206 | + // Add buttons. |
|
207 | + if ($type == 'buttons') { |
|
208 | 208 | $settings['toolbar'][] = $button; |
209 | - } |
|
210 | - // Add external Drupal plugins to the list of extensions. |
|
211 | - if ($type == 'buttons' && !empty($plugins[$plugin]['proxy'])) { |
|
209 | + } |
|
210 | + // Add external Drupal plugins to the list of extensions. |
|
211 | + if ($type == 'buttons' && !empty($plugins[$plugin]['proxy'])) { |
|
212 | 212 | $extra_plugins[] = $button; |
213 | - } |
|
214 | - // Add external plugins to the list of extensions. |
|
215 | - elseif ($type == 'buttons' && empty($plugins[$plugin]['internal'])) { |
|
213 | + } |
|
214 | + // Add external plugins to the list of extensions. |
|
215 | + elseif ($type == 'buttons' && empty($plugins[$plugin]['internal'])) { |
|
216 | 216 | $extra_plugins[] = $plugin; |
217 | - } |
|
218 | - // Add internal buttons that also need to be loaded as extension. |
|
219 | - elseif ($type == 'buttons' && !empty($plugins[$plugin]['load'])) { |
|
217 | + } |
|
218 | + // Add internal buttons that also need to be loaded as extension. |
|
219 | + elseif ($type == 'buttons' && !empty($plugins[$plugin]['load'])) { |
|
220 | 220 | $extra_plugins[] = $plugin; |
221 | - } |
|
222 | - // Add plain extensions. |
|
223 | - elseif ($type == 'extensions' && !empty($plugins[$plugin]['load'])) { |
|
221 | + } |
|
222 | + // Add plain extensions. |
|
223 | + elseif ($type == 'extensions' && !empty($plugins[$plugin]['load'])) { |
|
224 | 224 | $extra_plugins[] = $plugin; |
225 | - } |
|
226 | - // Allow plugins to add or override global configuration settings. |
|
227 | - if (!empty($plugins[$plugin]['options'])) { |
|
225 | + } |
|
226 | + // Allow plugins to add or override global configuration settings. |
|
227 | + if (!empty($plugins[$plugin]['options'])) { |
|
228 | 228 | $settings = array_merge($settings, $plugins[$plugin]['options']); |
229 | - } |
|
229 | + } |
|
230 | + } |
|
230 | 231 | } |
231 | - } |
|
232 | 232 | } |
233 | 233 | if (!empty($extra_plugins)) { |
234 | - $settings['extraPlugins'] = implode(',', $extra_plugins); |
|
234 | + $settings['extraPlugins'] = implode(',', $extra_plugins); |
|
235 | 235 | } |
236 | - } |
|
237 | - // For now, all buttons are placed into one row. |
|
238 | - $settings['toolbar'] = array($settings['toolbar']); |
|
236 | + } |
|
237 | + // For now, all buttons are placed into one row. |
|
238 | + $settings['toolbar'] = array($settings['toolbar']); |
|
239 | 239 | |
240 | - return $settings; |
|
240 | + return $settings; |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
244 | 244 | * Build a JS settings array of native external plugins that need to be loaded separately. |
245 | 245 | */ |
246 | 246 | function wysiwyg_ckeditor_plugin_settings($editor, $profile, $plugins) { |
247 | - $settings = array(); |
|
248 | - foreach ($plugins as $name => $plugin) { |
|
247 | + $settings = array(); |
|
248 | + foreach ($plugins as $name => $plugin) { |
|
249 | 249 | // Register all plugins that need to be loaded. |
250 | 250 | if (!empty($plugin['load'])) { |
251 | - $settings[$name] = array(); |
|
252 | - // Add path for native external plugins. |
|
253 | - if (empty($plugin['internal']) && isset($plugin['path'])) { |
|
251 | + $settings[$name] = array(); |
|
252 | + // Add path for native external plugins. |
|
253 | + if (empty($plugin['internal']) && isset($plugin['path'])) { |
|
254 | 254 | $settings[$name]['path'] = base_path() . $plugin['path'] . '/'; |
255 | - } |
|
256 | - // Force native internal plugins to use the standard path. |
|
257 | - else { |
|
255 | + } |
|
256 | + // Force native internal plugins to use the standard path. |
|
257 | + else { |
|
258 | 258 | $settings[$name]['path'] = base_path() . $editor['library path'] . '/plugins/' . $name . '/'; |
259 | - } |
|
260 | - // CKEditor defaults to 'plugin.js' on its own when filename is not set. |
|
261 | - if (!empty($plugin['filename'])) { |
|
259 | + } |
|
260 | + // CKEditor defaults to 'plugin.js' on its own when filename is not set. |
|
261 | + if (!empty($plugin['filename'])) { |
|
262 | 262 | $settings[$name]['fileName'] = $plugin['filename']; |
263 | - } |
|
263 | + } |
|
264 | 264 | } |
265 | - } |
|
266 | - return $settings; |
|
265 | + } |
|
266 | + return $settings; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
270 | 270 | * Build a JS settings array for Drupal plugins loaded via the proxy plugin. |
271 | 271 | */ |
272 | 272 | function wysiwyg_ckeditor_proxy_plugin_settings($editor, $profile, $plugins) { |
273 | - $settings = array(); |
|
274 | - foreach ($plugins as $name => $plugin) { |
|
273 | + $settings = array(); |
|
274 | + foreach ($plugins as $name => $plugin) { |
|
275 | 275 | // Populate required plugin settings. |
276 | 276 | $settings[$name] = $plugin['dialog settings'] + array( |
277 | - 'title' => $plugin['title'], |
|
278 | - 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
279 | - 'iconTitle' => $plugin['icon title'], |
|
280 | - // @todo These should only be set if the plugin defined them. |
|
281 | - 'css' => base_path() . $plugin['css path'] . '/' . $plugin['css file'], |
|
277 | + 'title' => $plugin['title'], |
|
278 | + 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
279 | + 'iconTitle' => $plugin['icon title'], |
|
280 | + // @todo These should only be set if the plugin defined them. |
|
281 | + 'css' => base_path() . $plugin['css path'] . '/' . $plugin['css file'], |
|
282 | 282 | ); |
283 | - } |
|
284 | - return $settings; |
|
283 | + } |
|
284 | + return $settings; |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
288 | 288 | * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
289 | 289 | */ |
290 | 290 | function wysiwyg_ckeditor_plugins($editor) { |
291 | - $plugins = array( |
|
291 | + $plugins = array( |
|
292 | 292 | 'default' => array( |
293 | - 'buttons' => array( |
|
293 | + 'buttons' => array( |
|
294 | 294 | 'Bold' => t('Bold'), 'Italic' => t('Italic'), 'Underline' => t('Underline'), |
295 | 295 | 'Strike' => t('Strike-through'), |
296 | 296 | 'JustifyLeft' => t('Align left'), 'JustifyCenter' => t('Align center'), 'JustifyRight' => t('Align right'), 'JustifyBlock' => t('Justify'), |
@@ -317,17 +317,17 @@ discard block |
||
317 | 317 | 'Maximize' => t('Maximize'), |
318 | 318 | 'SpellChecker' => t('Check spelling'), 'Scayt' => t('Check spelling as you type'), |
319 | 319 | 'About' => t('About'), |
320 | - ), |
|
321 | - 'internal' => TRUE, |
|
320 | + ), |
|
321 | + 'internal' => TRUE, |
|
322 | 322 | ), |
323 | - ); |
|
323 | + ); |
|
324 | 324 | |
325 | - if (version_compare($editor['installed version'], '3.1.0.4885', '<')) { |
|
325 | + if (version_compare($editor['installed version'], '3.1.0.4885', '<')) { |
|
326 | 326 | unset($plugins['default']['buttons']['CreateDiv']); |
327 | - } |
|
328 | - if (version_compare($editor['installed version'], '3.5.0.6260', '<')) { |
|
327 | + } |
|
328 | + if (version_compare($editor['installed version'], '3.5.0.6260', '<')) { |
|
329 | 329 | unset($plugins['default']['buttons']['Iframe']); |
330 | - } |
|
331 | - return $plugins; |
|
330 | + } |
|
331 | + return $plugins; |
|
332 | 332 | } |
333 | 333 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * The installed editor version. |
59 | 59 | */ |
60 | 60 | function wysiwyg_ckeditor_version($editor) { |
61 | - $library = $editor['library path'] . '/ckeditor.js'; |
|
61 | + $library = $editor['library path'].'/ckeditor.js'; |
|
62 | 62 | if (!file_exists($library)) { |
63 | 63 | return; |
64 | 64 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | fclose($library); |
73 | 73 | // Version numbers need to have three parts since 3.0.1. |
74 | 74 | $version[1] = preg_replace('/^(\d+)\.(\d+)$/', '${1}.${2}.0', $version[1]); |
75 | - return $version[1] . '.' . $version[2]; |
|
75 | + return $version[1].'.'.$version[2]; |
|
76 | 76 | } |
77 | 77 | $max_lines--; |
78 | 78 | } |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | */ |
94 | 94 | function wysiwyg_ckeditor_themes($editor, $profile) { |
95 | 95 | // @todo Skins are not themes but this will do for now. |
96 | - $path = $editor['library path'] . '/skins/'; |
|
96 | + $path = $editor['library path'].'/skins/'; |
|
97 | 97 | if (file_exists($path) && ($dir_handle = opendir($path))) { |
98 | 98 | $themes = array(); |
99 | 99 | while ($file = readdir($dir_handle)) { |
100 | - if (is_dir($path . $file) && substr($file, 0, 1) != '.' && $file != 'CVS') { |
|
100 | + if (is_dir($path.$file) && substr($file, 0, 1) != '.' && $file != 'CVS') { |
|
101 | 101 | $themes[] = $file; |
102 | 102 | } |
103 | 103 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | function wysiwyg_ckeditor_settings($editor, $config, $theme) { |
129 | 129 | $settings = array( |
130 | - 'baseHref' => $GLOBALS['base_url'] . '/', |
|
130 | + 'baseHref' => $GLOBALS['base_url'].'/', |
|
131 | 131 | 'width' => '100%', |
132 | 132 | // For better compatibility with smaller textareas. |
133 | 133 | 'resize_minWidth' => 450, |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | if (isset($config['resizing'])) { |
187 | 187 | // CKEditor tests "!== false", so ensure it is a Boolean. |
188 | - $settings['resize_enabled'] = (bool) $config['resizing']; |
|
188 | + $settings['resize_enabled'] = (bool)$config['resizing']; |
|
189 | 189 | } |
190 | 190 | if (isset($config['toolbar_loc'])) { |
191 | 191 | $settings['toolbarLocation'] = $config['toolbar_loc']; |
@@ -251,11 +251,11 @@ discard block |
||
251 | 251 | $settings[$name] = array(); |
252 | 252 | // Add path for native external plugins. |
253 | 253 | if (empty($plugin['internal']) && isset($plugin['path'])) { |
254 | - $settings[$name]['path'] = base_path() . $plugin['path'] . '/'; |
|
254 | + $settings[$name]['path'] = base_path().$plugin['path'].'/'; |
|
255 | 255 | } |
256 | 256 | // Force native internal plugins to use the standard path. |
257 | 257 | else { |
258 | - $settings[$name]['path'] = base_path() . $editor['library path'] . '/plugins/' . $name . '/'; |
|
258 | + $settings[$name]['path'] = base_path().$editor['library path'].'/plugins/'.$name.'/'; |
|
259 | 259 | } |
260 | 260 | // CKEditor defaults to 'plugin.js' on its own when filename is not set. |
261 | 261 | if (!empty($plugin['filename'])) { |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | // Populate required plugin settings. |
276 | 276 | $settings[$name] = $plugin['dialog settings'] + array( |
277 | 277 | 'title' => $plugin['title'], |
278 | - 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
278 | + 'icon' => base_path().$plugin['icon path'].'/'.$plugin['icon file'], |
|
279 | 279 | 'iconTitle' => $plugin['icon title'], |
280 | 280 | // @todo These should only be set if the plugin defined them. |
281 | - 'css' => base_path() . $plugin['css path'] . '/' . $plugin['css file'], |
|
281 | + 'css' => base_path().$plugin['css path'].'/'.$plugin['css file'], |
|
282 | 282 | ); |
283 | 283 | } |
284 | 284 | return $settings; |
@@ -105,8 +105,7 @@ discard block |
||
105 | 105 | natcasesort($themes); |
106 | 106 | $themes = array_values($themes); |
107 | 107 | return !empty($themes) ? $themes : array('default'); |
108 | - } |
|
109 | - else { |
|
108 | + } else { |
|
110 | 109 | return array('default'); |
111 | 110 | } |
112 | 111 | } |
@@ -165,16 +164,13 @@ discard block |
||
165 | 164 | if (version_compare($editor['installed version'], '3.0.1.4391', '<')) { |
166 | 165 | if ($config['css_setting'] == 'theme') { |
167 | 166 | $settings['contentsCss'] = reset(wysiwyg_get_css()); |
168 | - } |
|
169 | - elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
167 | + } elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
170 | 168 | $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
171 | 169 | } |
172 | - } |
|
173 | - else { |
|
170 | + } else { |
|
174 | 171 | if ($config['css_setting'] == 'theme') { |
175 | 172 | $settings['contentsCss'] = wysiwyg_get_css(); |
176 | - } |
|
177 | - elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
173 | + } elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
178 | 174 | $settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()))); |
179 | 175 | } |
180 | 176 | } |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | '' => array( |
18 | 18 | 'title' => 'Default', |
19 | 19 | 'files' => array( |
20 | - 'ckeditor.js' => array('preprocess' => FALSE), |
|
20 | + 'ckeditor.js' => array('preprocess' => false), |
|
21 | 21 | ), |
22 | 22 | ), |
23 | 23 | 'src' => array( |
24 | 24 | 'title' => 'Source', |
25 | 25 | 'files' => array( |
26 | - 'ckeditor_source.js' => array('preprocess' => FALSE), |
|
26 | + 'ckeditor_source.js' => array('preprocess' => false), |
|
27 | 27 | ), |
28 | 28 | ), |
29 | 29 | ), |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | 'plugin settings callback' => 'wysiwyg_ckeditor_plugin_settings', |
35 | 35 | 'proxy plugin' => array( |
36 | 36 | 'drupal' => array( |
37 | - 'load' => TRUE, |
|
38 | - 'proxy' => TRUE, |
|
37 | + 'load' => true, |
|
38 | + 'proxy' => true, |
|
39 | 39 | ), |
40 | 40 | ), |
41 | 41 | 'proxy plugin settings callback' => 'wysiwyg_ckeditor_proxy_plugin_settings', |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | // disable at least the additional character sets. CKEditor always converts |
141 | 141 | // XML default characters '&', '<', '>'. |
142 | 142 | // @todo Check whether completely disabling ProcessHTMLEntities is an option. |
143 | - 'entities_latin' => FALSE, |
|
144 | - 'entities_greek' => FALSE, |
|
143 | + 'entities_latin' => false, |
|
144 | + 'entities_greek' => false, |
|
145 | 145 | ); |
146 | 146 | |
147 | 147 | // Add HTML block format settings; common block formats are already predefined |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | 'SpellChecker' => t('Check spelling'), 'Scayt' => t('Check spelling as you type'), |
319 | 319 | 'About' => t('About'), |
320 | 320 | ), |
321 | - 'internal' => TRUE, |
|
321 | + 'internal' => true, |
|
322 | 322 | ), |
323 | 323 | ); |
324 | 324 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * An array containing editor properties as returned from hook_editor(). |
48 | 48 | * |
49 | 49 | * @return |
50 | - * The installed editor version. |
|
50 | + null|string The installed editor version. |
|
51 | 51 | */ |
52 | 52 | function wysiwyg_fckeditor_version($editor) { |
53 | 53 | $library = $editor['library path'] . '/fckeditor.js'; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * A wysiwyg editor profile. |
76 | 76 | * |
77 | 77 | * @return |
78 | - * An array of theme names. The first returned name should be the default |
|
78 | + string[] An array of theme names. The first returned name should be the default |
|
79 | 79 | * theme name. |
80 | 80 | */ |
81 | 81 | function wysiwyg_fckeditor_themes($editor, $profile) { |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | * Plugin implementation of hook_editor(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_fckeditor_editor() { |
12 | - $editor['fckeditor'] = array( |
|
12 | + $editor['fckeditor'] = array( |
|
13 | 13 | 'title' => 'FCKeditor', |
14 | 14 | 'vendor url' => 'http://www.fckeditor.net', |
15 | 15 | 'download url' => 'http://www.fckeditor.net/download', |
16 | 16 | 'libraries' => array( |
17 | - '' => array( |
|
17 | + '' => array( |
|
18 | 18 | 'title' => 'Default', |
19 | 19 | 'files' => array('fckeditor.js'), |
20 | - ), |
|
20 | + ), |
|
21 | 21 | ), |
22 | 22 | 'version callback' => 'wysiwyg_fckeditor_version', |
23 | 23 | 'themes callback' => 'wysiwyg_fckeditor_themes', |
@@ -25,19 +25,19 @@ discard block |
||
25 | 25 | 'plugin callback' => 'wysiwyg_fckeditor_plugins', |
26 | 26 | 'plugin settings callback' => 'wysiwyg_fckeditor_plugin_settings', |
27 | 27 | 'proxy plugin' => array( |
28 | - 'drupal' => array( |
|
28 | + 'drupal' => array( |
|
29 | 29 | 'load' => TRUE, |
30 | 30 | 'proxy' => TRUE, |
31 | - ), |
|
31 | + ), |
|
32 | 32 | ), |
33 | 33 | 'proxy plugin settings callback' => 'wysiwyg_fckeditor_proxy_plugin_settings', |
34 | 34 | 'versions' => array( |
35 | - '2.6' => array( |
|
35 | + '2.6' => array( |
|
36 | 36 | 'js files' => array('fckeditor-2.6.js'), |
37 | - ), |
|
37 | + ), |
|
38 | 38 | ), |
39 | - ); |
|
40 | - return $editor; |
|
39 | + ); |
|
40 | + return $editor; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -50,20 +50,20 @@ discard block |
||
50 | 50 | * The installed editor version. |
51 | 51 | */ |
52 | 52 | function wysiwyg_fckeditor_version($editor) { |
53 | - $library = $editor['library path'] . '/fckeditor.js'; |
|
54 | - if (!file_exists($library)) { |
|
53 | + $library = $editor['library path'] . '/fckeditor.js'; |
|
54 | + if (!file_exists($library)) { |
|
55 | 55 | return; |
56 | - } |
|
57 | - $library = fopen($library, 'r'); |
|
58 | - $max_lines = 100; |
|
59 | - while ($max_lines && $line = fgets($library, 60)) { |
|
56 | + } |
|
57 | + $library = fopen($library, 'r'); |
|
58 | + $max_lines = 100; |
|
59 | + while ($max_lines && $line = fgets($library, 60)) { |
|
60 | 60 | if (preg_match('@^FCKeditor.prototype.Version\s*= \'([\d\.]+)@', $line, $version)) { |
61 | - fclose($library); |
|
62 | - return $version[1]; |
|
61 | + fclose($library); |
|
62 | + return $version[1]; |
|
63 | 63 | } |
64 | 64 | $max_lines--; |
65 | - } |
|
66 | - fclose($library); |
|
65 | + } |
|
66 | + fclose($library); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * theme name. |
80 | 80 | */ |
81 | 81 | function wysiwyg_fckeditor_themes($editor, $profile) { |
82 | - return array('default', 'office2003', 'silver'); |
|
82 | + return array('default', 'office2003', 'silver'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * Drupal.settings.wysiwyg.configs.{editor} |
98 | 98 | */ |
99 | 99 | function wysiwyg_fckeditor_settings($editor, $config, $theme) { |
100 | - $settings = array( |
|
100 | + $settings = array( |
|
101 | 101 | 'EditorPath' => base_path() . $editor['library path'] . '/', |
102 | 102 | 'SkinPath' => base_path() . $editor['library path'] . '/editor/skins/' . $theme . '/', |
103 | 103 | 'CustomConfigurationsPath' => base_path() . drupal_get_path('module', 'wysiwyg') . '/editors/js/fckeditor.config.js', |
@@ -116,105 +116,105 @@ discard block |
||
116 | 116 | // @todo Check whether completely disabling ProcessHTMLEntities is an option. |
117 | 117 | 'IncludeLatinEntities' => FALSE, |
118 | 118 | 'IncludeGreekEntities' => FALSE, |
119 | - ); |
|
120 | - if (isset($config['block_formats'])) { |
|
119 | + ); |
|
120 | + if (isset($config['block_formats'])) { |
|
121 | 121 | $settings['FontFormats'] = strtr($config['block_formats'], array(',' => ';')); |
122 | - } |
|
123 | - if (isset($config['apply_source_formatting'])) { |
|
122 | + } |
|
123 | + if (isset($config['apply_source_formatting'])) { |
|
124 | 124 | $settings['FormatOutput'] = $settings['FormatSource'] = $config['apply_source_formatting']; |
125 | - } |
|
126 | - if (isset($config['paste_auto_cleanup_on_paste'])) { |
|
125 | + } |
|
126 | + if (isset($config['paste_auto_cleanup_on_paste'])) { |
|
127 | 127 | $settings['AutoDetectPasteFromWord'] = $config['paste_auto_cleanup_on_paste']; |
128 | - } |
|
128 | + } |
|
129 | 129 | |
130 | - if (isset($config['css_setting'])) { |
|
130 | + if (isset($config['css_setting'])) { |
|
131 | 131 | if ($config['css_setting'] == 'theme') { |
132 | - $settings['EditorAreaCSS'] = implode(',', wysiwyg_get_css()); |
|
132 | + $settings['EditorAreaCSS'] = implode(',', wysiwyg_get_css()); |
|
133 | 133 | } |
134 | 134 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
135 | - $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
135 | + $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
136 | + } |
|
136 | 137 | } |
137 | - } |
|
138 | 138 | |
139 | - // Use our custom toolbar set. |
|
140 | - $settings['ToolbarSet'] = 'Wysiwyg'; |
|
141 | - // Populate our custom toolbar set for fckeditor.config.js. |
|
142 | - $settings['buttons'] = array(); |
|
143 | - if (!empty($config['buttons'])) { |
|
139 | + // Use our custom toolbar set. |
|
140 | + $settings['ToolbarSet'] = 'Wysiwyg'; |
|
141 | + // Populate our custom toolbar set for fckeditor.config.js. |
|
142 | + $settings['buttons'] = array(); |
|
143 | + if (!empty($config['buttons'])) { |
|
144 | 144 | $plugins = wysiwyg_get_plugins($editor['name']); |
145 | 145 | foreach ($config['buttons'] as $plugin => $buttons) { |
146 | - foreach ($buttons as $button => $enabled) { |
|
146 | + foreach ($buttons as $button => $enabled) { |
|
147 | 147 | // Iterate separately over buttons and extensions properties. |
148 | 148 | foreach (array('buttons', 'extensions') as $type) { |
149 | - // Skip unavailable plugins. |
|
150 | - if (!isset($plugins[$plugin][$type][$button])) { |
|
149 | + // Skip unavailable plugins. |
|
150 | + if (!isset($plugins[$plugin][$type][$button])) { |
|
151 | 151 | continue; |
152 | - } |
|
153 | - // Add buttons. |
|
154 | - if ($type == 'buttons') { |
|
152 | + } |
|
153 | + // Add buttons. |
|
154 | + if ($type == 'buttons') { |
|
155 | 155 | $settings['buttons'][] = $button; |
156 | - } |
|
157 | - // Allow plugins to add or override global configuration settings. |
|
158 | - if (!empty($plugins[$plugin]['options'])) { |
|
156 | + } |
|
157 | + // Allow plugins to add or override global configuration settings. |
|
158 | + if (!empty($plugins[$plugin]['options'])) { |
|
159 | 159 | $settings = array_merge($settings, $plugins[$plugin]['options']); |
160 | - } |
|
160 | + } |
|
161 | 161 | } |
162 | - } |
|
162 | + } |
|
163 | + } |
|
163 | 164 | } |
164 | - } |
|
165 | - // For now, all buttons are placed into one row. |
|
166 | - $settings['buttons'] = array($settings['buttons']); |
|
165 | + // For now, all buttons are placed into one row. |
|
166 | + $settings['buttons'] = array($settings['buttons']); |
|
167 | 167 | |
168 | - return $settings; |
|
168 | + return $settings; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
172 | 172 | * Build a JS settings array of native external plugins that need to be loaded separately. |
173 | 173 | */ |
174 | 174 | function wysiwyg_fckeditor_plugin_settings($editor, $profile, $plugins) { |
175 | - $settings = array(); |
|
176 | - foreach ($plugins as $name => $plugin) { |
|
175 | + $settings = array(); |
|
176 | + foreach ($plugins as $name => $plugin) { |
|
177 | 177 | // Register all plugins that need to be loaded. |
178 | 178 | if (!empty($plugin['load'])) { |
179 | - $settings[$name] = array(); |
|
180 | - // Add path for native external plugins; internal ones do not need a path. |
|
181 | - if (empty($plugin['internal']) && isset($plugin['path'])) { |
|
179 | + $settings[$name] = array(); |
|
180 | + // Add path for native external plugins; internal ones do not need a path. |
|
181 | + if (empty($plugin['internal']) && isset($plugin['path'])) { |
|
182 | 182 | // All native FCKeditor plugins use the filename fckplugin.js. |
183 | 183 | $settings[$name]['path'] = base_path() . $plugin['path'] . '/'; |
184 | - } |
|
185 | - if (!empty($plugin['languages'])) { |
|
184 | + } |
|
185 | + if (!empty($plugin['languages'])) { |
|
186 | 186 | $settings[$name]['languages'] = $plugin['languages']; |
187 | - } |
|
187 | + } |
|
188 | + } |
|
188 | 189 | } |
189 | - } |
|
190 | - return $settings; |
|
190 | + return $settings; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
194 | 194 | * Build a JS settings array for Drupal plugins loaded via the proxy plugin. |
195 | 195 | */ |
196 | 196 | function wysiwyg_fckeditor_proxy_plugin_settings($editor, $profile, $plugins) { |
197 | - $settings = array(); |
|
198 | - foreach ($plugins as $name => $plugin) { |
|
197 | + $settings = array(); |
|
198 | + foreach ($plugins as $name => $plugin) { |
|
199 | 199 | // Populate required plugin settings. |
200 | 200 | $settings[$name] = $plugin['dialog settings'] + array( |
201 | - 'title' => $plugin['title'], |
|
202 | - 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
203 | - 'iconTitle' => $plugin['icon title'], |
|
204 | - // @todo These should only be set if the plugin defined them. |
|
205 | - 'css' => base_path() . $plugin['css path'] . '/' . $plugin['css file'], |
|
201 | + 'title' => $plugin['title'], |
|
202 | + 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
203 | + 'iconTitle' => $plugin['icon title'], |
|
204 | + // @todo These should only be set if the plugin defined them. |
|
205 | + 'css' => base_path() . $plugin['css path'] . '/' . $plugin['css file'], |
|
206 | 206 | ); |
207 | - } |
|
208 | - return $settings; |
|
207 | + } |
|
208 | + return $settings; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
212 | 212 | * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
213 | 213 | */ |
214 | 214 | function wysiwyg_fckeditor_plugins($editor) { |
215 | - $plugins = array( |
|
215 | + $plugins = array( |
|
216 | 216 | 'default' => array( |
217 | - 'buttons' => array( |
|
217 | + 'buttons' => array( |
|
218 | 218 | 'Bold' => t('Bold'), 'Italic' => t('Italic'), 'Underline' => t('Underline'), |
219 | 219 | 'StrikeThrough' => t('Strike-through'), |
220 | 220 | 'JustifyLeft' => t('Align left'), 'JustifyCenter' => t('Align center'), 'JustifyRight' => t('Align right'), 'JustifyFull' => t('Justify'), |
@@ -240,39 +240,39 @@ discard block |
||
240 | 240 | 'Flash' => t('Flash'), 'Smiley' => t('Smiley'), |
241 | 241 | 'FitWindow' => t('FitWindow'), |
242 | 242 | 'SpellCheck' => t('Check spelling'), |
243 | - ), |
|
244 | - 'internal' => TRUE, |
|
243 | + ), |
|
244 | + 'internal' => TRUE, |
|
245 | 245 | ), |
246 | 246 | 'autogrow' => array( |
247 | - 'path' => $editor['library path'] . '/editor/plugins', |
|
248 | - 'extensions' => array( |
|
247 | + 'path' => $editor['library path'] . '/editor/plugins', |
|
248 | + 'extensions' => array( |
|
249 | 249 | 'autogrow' => t('Autogrow'), |
250 | - ), |
|
251 | - 'options' => array( |
|
250 | + ), |
|
251 | + 'options' => array( |
|
252 | 252 | 'AutoGrowMax' => 800, |
253 | - ), |
|
254 | - 'internal' => TRUE, |
|
255 | - 'load' => TRUE, |
|
253 | + ), |
|
254 | + 'internal' => TRUE, |
|
255 | + 'load' => TRUE, |
|
256 | 256 | ), |
257 | 257 | 'bbcode' => array( |
258 | - 'path' => $editor['library path'] . '/editor/plugins', |
|
259 | - 'extensions' => array( |
|
258 | + 'path' => $editor['library path'] . '/editor/plugins', |
|
259 | + 'extensions' => array( |
|
260 | 260 | 'bbcode' => t('BBCode'), |
261 | - ), |
|
262 | - 'internal' => TRUE, |
|
263 | - 'load' => TRUE, |
|
261 | + ), |
|
262 | + 'internal' => TRUE, |
|
263 | + 'load' => TRUE, |
|
264 | 264 | ), |
265 | 265 | 'dragresizetable' => array( |
266 | - 'path' => $editor['library path'] . '/editor/plugins', |
|
267 | - 'extensions' => array( |
|
266 | + 'path' => $editor['library path'] . '/editor/plugins', |
|
267 | + 'extensions' => array( |
|
268 | 268 | 'dragresizetable' => t('Table drag/resize'), |
269 | - ), |
|
270 | - 'internal' => TRUE, |
|
271 | - 'load' => TRUE, |
|
269 | + ), |
|
270 | + 'internal' => TRUE, |
|
271 | + 'load' => TRUE, |
|
272 | 272 | ), |
273 | 273 | 'tablecommands' => array( |
274 | - 'path' => $editor['library path'] . '/editor/plugins', |
|
275 | - 'buttons' => array( |
|
274 | + 'path' => $editor['library path'] . '/editor/plugins', |
|
275 | + 'buttons' => array( |
|
276 | 276 | 'TableCellProp' => t('Table: Cell properties'), |
277 | 277 | 'TableInsertRowAfter' => t('Table: Insert row after'), |
278 | 278 | 'TableInsertColumnAfter' => t('Table: Insert column after'), |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | 'TableDeleteCells' => t('Table: Delete cells'), |
283 | 283 | 'TableMergeCells' => t('Table: Merge cells'), |
284 | 284 | 'TableHorizontalSplitCell' => t('Table: Horizontal split cell'), |
285 | - ), |
|
286 | - 'internal' => TRUE, |
|
287 | - 'load' => TRUE, |
|
285 | + ), |
|
286 | + 'internal' => TRUE, |
|
287 | + 'load' => TRUE, |
|
288 | 288 | ), |
289 | - ); |
|
290 | - return $plugins; |
|
289 | + ); |
|
290 | + return $plugins; |
|
291 | 291 | } |
292 | 292 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * The installed editor version. |
51 | 51 | */ |
52 | 52 | function wysiwyg_fckeditor_version($editor) { |
53 | - $library = $editor['library path'] . '/fckeditor.js'; |
|
53 | + $library = $editor['library path'].'/fckeditor.js'; |
|
54 | 54 | if (!file_exists($library)) { |
55 | 55 | return; |
56 | 56 | } |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | */ |
99 | 99 | function wysiwyg_fckeditor_settings($editor, $config, $theme) { |
100 | 100 | $settings = array( |
101 | - 'EditorPath' => base_path() . $editor['library path'] . '/', |
|
102 | - 'SkinPath' => base_path() . $editor['library path'] . '/editor/skins/' . $theme . '/', |
|
103 | - 'CustomConfigurationsPath' => base_path() . drupal_get_path('module', 'wysiwyg') . '/editors/js/fckeditor.config.js', |
|
101 | + 'EditorPath' => base_path().$editor['library path'].'/', |
|
102 | + 'SkinPath' => base_path().$editor['library path'].'/editor/skins/'.$theme.'/', |
|
103 | + 'CustomConfigurationsPath' => base_path().drupal_get_path('module', 'wysiwyg').'/editors/js/fckeditor.config.js', |
|
104 | 104 | 'Width' => '100%', |
105 | 105 | 'Height' => 420, |
106 | 106 | 'LinkBrowser' => FALSE, |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | // Add path for native external plugins; internal ones do not need a path. |
181 | 181 | if (empty($plugin['internal']) && isset($plugin['path'])) { |
182 | 182 | // All native FCKeditor plugins use the filename fckplugin.js. |
183 | - $settings[$name]['path'] = base_path() . $plugin['path'] . '/'; |
|
183 | + $settings[$name]['path'] = base_path().$plugin['path'].'/'; |
|
184 | 184 | } |
185 | 185 | if (!empty($plugin['languages'])) { |
186 | 186 | $settings[$name]['languages'] = $plugin['languages']; |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | // Populate required plugin settings. |
200 | 200 | $settings[$name] = $plugin['dialog settings'] + array( |
201 | 201 | 'title' => $plugin['title'], |
202 | - 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
202 | + 'icon' => base_path().$plugin['icon path'].'/'.$plugin['icon file'], |
|
203 | 203 | 'iconTitle' => $plugin['icon title'], |
204 | 204 | // @todo These should only be set if the plugin defined them. |
205 | - 'css' => base_path() . $plugin['css path'] . '/' . $plugin['css file'], |
|
205 | + 'css' => base_path().$plugin['css path'].'/'.$plugin['css file'], |
|
206 | 206 | ); |
207 | 207 | } |
208 | 208 | return $settings; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | 'internal' => TRUE, |
245 | 245 | ), |
246 | 246 | 'autogrow' => array( |
247 | - 'path' => $editor['library path'] . '/editor/plugins', |
|
247 | + 'path' => $editor['library path'].'/editor/plugins', |
|
248 | 248 | 'extensions' => array( |
249 | 249 | 'autogrow' => t('Autogrow'), |
250 | 250 | ), |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | 'load' => TRUE, |
256 | 256 | ), |
257 | 257 | 'bbcode' => array( |
258 | - 'path' => $editor['library path'] . '/editor/plugins', |
|
258 | + 'path' => $editor['library path'].'/editor/plugins', |
|
259 | 259 | 'extensions' => array( |
260 | 260 | 'bbcode' => t('BBCode'), |
261 | 261 | ), |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | 'load' => TRUE, |
264 | 264 | ), |
265 | 265 | 'dragresizetable' => array( |
266 | - 'path' => $editor['library path'] . '/editor/plugins', |
|
266 | + 'path' => $editor['library path'].'/editor/plugins', |
|
267 | 267 | 'extensions' => array( |
268 | 268 | 'dragresizetable' => t('Table drag/resize'), |
269 | 269 | ), |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | 'load' => TRUE, |
272 | 272 | ), |
273 | 273 | 'tablecommands' => array( |
274 | - 'path' => $editor['library path'] . '/editor/plugins', |
|
274 | + 'path' => $editor['library path'].'/editor/plugins', |
|
275 | 275 | 'buttons' => array( |
276 | 276 | 'TableCellProp' => t('Table: Cell properties'), |
277 | 277 | 'TableInsertRowAfter' => t('Table: Insert row after'), |
@@ -130,8 +130,7 @@ |
||
130 | 130 | if (isset($config['css_setting'])) { |
131 | 131 | if ($config['css_setting'] == 'theme') { |
132 | 132 | $settings['EditorAreaCSS'] = implode(',', wysiwyg_get_css()); |
133 | - } |
|
134 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
133 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
135 | 134 | $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
136 | 135 | } |
137 | 136 | } |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | 'plugin settings callback' => 'wysiwyg_fckeditor_plugin_settings', |
27 | 27 | 'proxy plugin' => array( |
28 | 28 | 'drupal' => array( |
29 | - 'load' => TRUE, |
|
30 | - 'proxy' => TRUE, |
|
29 | + 'load' => true, |
|
30 | + 'proxy' => true, |
|
31 | 31 | ), |
32 | 32 | ), |
33 | 33 | 'proxy plugin settings callback' => 'wysiwyg_fckeditor_proxy_plugin_settings', |
@@ -103,19 +103,19 @@ discard block |
||
103 | 103 | 'CustomConfigurationsPath' => base_path() . drupal_get_path('module', 'wysiwyg') . '/editors/js/fckeditor.config.js', |
104 | 104 | 'Width' => '100%', |
105 | 105 | 'Height' => 420, |
106 | - 'LinkBrowser' => FALSE, |
|
107 | - 'LinkUpload' => FALSE, |
|
108 | - 'ImageBrowser' => FALSE, |
|
109 | - 'ImageUpload' => FALSE, |
|
110 | - 'FlashBrowser' => FALSE, |
|
111 | - 'FlashUpload' => FALSE, |
|
106 | + 'LinkBrowser' => false, |
|
107 | + 'LinkUpload' => false, |
|
108 | + 'ImageBrowser' => false, |
|
109 | + 'ImageUpload' => false, |
|
110 | + 'FlashBrowser' => false, |
|
111 | + 'FlashUpload' => false, |
|
112 | 112 | // By default, FCKeditor converts most characters into HTML entities. Since |
113 | 113 | // it does not support a custom definition, but Drupal supports Unicode, we |
114 | 114 | // disable at least the additional character sets. FCKeditor always converts |
115 | 115 | // XML default characters '&', '<', '>'. |
116 | 116 | // @todo Check whether completely disabling ProcessHTMLEntities is an option. |
117 | - 'IncludeLatinEntities' => FALSE, |
|
118 | - 'IncludeGreekEntities' => FALSE, |
|
117 | + 'IncludeLatinEntities' => false, |
|
118 | + 'IncludeGreekEntities' => false, |
|
119 | 119 | ); |
120 | 120 | if (isset($config['block_formats'])) { |
121 | 121 | $settings['FontFormats'] = strtr($config['block_formats'], array(',' => ';')); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | 'FitWindow' => t('FitWindow'), |
242 | 242 | 'SpellCheck' => t('Check spelling'), |
243 | 243 | ), |
244 | - 'internal' => TRUE, |
|
244 | + 'internal' => true, |
|
245 | 245 | ), |
246 | 246 | 'autogrow' => array( |
247 | 247 | 'path' => $editor['library path'] . '/editor/plugins', |
@@ -251,24 +251,24 @@ discard block |
||
251 | 251 | 'options' => array( |
252 | 252 | 'AutoGrowMax' => 800, |
253 | 253 | ), |
254 | - 'internal' => TRUE, |
|
255 | - 'load' => TRUE, |
|
254 | + 'internal' => true, |
|
255 | + 'load' => true, |
|
256 | 256 | ), |
257 | 257 | 'bbcode' => array( |
258 | 258 | 'path' => $editor['library path'] . '/editor/plugins', |
259 | 259 | 'extensions' => array( |
260 | 260 | 'bbcode' => t('BBCode'), |
261 | 261 | ), |
262 | - 'internal' => TRUE, |
|
263 | - 'load' => TRUE, |
|
262 | + 'internal' => true, |
|
263 | + 'load' => true, |
|
264 | 264 | ), |
265 | 265 | 'dragresizetable' => array( |
266 | 266 | 'path' => $editor['library path'] . '/editor/plugins', |
267 | 267 | 'extensions' => array( |
268 | 268 | 'dragresizetable' => t('Table drag/resize'), |
269 | 269 | ), |
270 | - 'internal' => TRUE, |
|
271 | - 'load' => TRUE, |
|
270 | + 'internal' => true, |
|
271 | + 'load' => true, |
|
272 | 272 | ), |
273 | 273 | 'tablecommands' => array( |
274 | 274 | 'path' => $editor['library path'] . '/editor/plugins', |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | 'TableMergeCells' => t('Table: Merge cells'), |
284 | 284 | 'TableHorizontalSplitCell' => t('Table: Horizontal split cell'), |
285 | 285 | ), |
286 | - 'internal' => TRUE, |
|
287 | - 'load' => TRUE, |
|
286 | + 'internal' => true, |
|
287 | + 'load' => true, |
|
288 | 288 | ), |
289 | 289 | ); |
290 | 290 | return $plugins; |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * An array containing editor properties as returned from hook_editor(). |
44 | 44 | * |
45 | 45 | * @return |
46 | - * The installed editor version. |
|
46 | + null|string The installed editor version. |
|
47 | 47 | */ |
48 | 48 | function wysiwyg_jwysiwyg_version($editor) { |
49 | 49 | $script = $editor['library path'] . '/jquery.wysiwyg.js'; |
@@ -9,31 +9,31 @@ discard block |
||
9 | 9 | * Plugin implementation of hook_editor(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_jwysiwyg_editor() { |
12 | - $editor['jwysiwyg'] = array( |
|
12 | + $editor['jwysiwyg'] = array( |
|
13 | 13 | 'title' => 'jWYSIWYG', |
14 | 14 | 'vendor url' => 'http://code.google.com/p/jwysiwyg/', |
15 | 15 | 'download url' => 'http://code.google.com/p/jwysiwyg/downloads/list', |
16 | 16 | 'libraries' => array( |
17 | - '' => array( |
|
17 | + '' => array( |
|
18 | 18 | 'title' => 'Source', |
19 | 19 | 'files' => array('jquery.wysiwyg.js'), |
20 | - ), |
|
21 | - 'pack' => array( |
|
20 | + ), |
|
21 | + 'pack' => array( |
|
22 | 22 | 'title' => 'Packed', |
23 | 23 | 'files' => array('jquery.wysiwyg.pack.js'), |
24 | - ), |
|
24 | + ), |
|
25 | 25 | ), |
26 | 26 | 'version callback' => 'wysiwyg_jwysiwyg_version', |
27 | 27 | // @todo Wrong property; add separate properties for editor requisites. |
28 | 28 | 'css path' => wysiwyg_get_path('jwysiwyg'), |
29 | 29 | 'versions' => array( |
30 | - '0.5' => array( |
|
30 | + '0.5' => array( |
|
31 | 31 | 'js files' => array('jwysiwyg.js'), |
32 | 32 | 'css files' => array('jquery.wysiwyg.css'), |
33 | - ), |
|
33 | + ), |
|
34 | 34 | ), |
35 | - ); |
|
36 | - return $editor; |
|
35 | + ); |
|
36 | + return $editor; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | * The installed editor version. |
47 | 47 | */ |
48 | 48 | function wysiwyg_jwysiwyg_version($editor) { |
49 | - $script = $editor['library path'] . '/jquery.wysiwyg.js'; |
|
50 | - if (!file_exists($script)) { |
|
49 | + $script = $editor['library path'] . '/jquery.wysiwyg.js'; |
|
50 | + if (!file_exists($script)) { |
|
51 | 51 | return; |
52 | - } |
|
53 | - $script = fopen($script, 'r'); |
|
54 | - fgets($script); |
|
55 | - $line = fgets($script); |
|
56 | - if (preg_match('@([0-9\.]+)$@', $line, $version)) { |
|
52 | + } |
|
53 | + $script = fopen($script, 'r'); |
|
54 | + fgets($script); |
|
55 | + $line = fgets($script); |
|
56 | + if (preg_match('@([0-9\.]+)$@', $line, $version)) { |
|
57 | 57 | fclose($script); |
58 | 58 | return $version[1]; |
59 | - } |
|
60 | - fclose($script); |
|
59 | + } |
|
60 | + fclose($script); |
|
61 | 61 | } |
62 | 62 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | * The installed editor version. |
47 | 47 | */ |
48 | 48 | function wysiwyg_jwysiwyg_version($editor) { |
49 | - $script = $editor['library path'] . '/jquery.wysiwyg.js'; |
|
49 | + $script = $editor['library path'].'/jquery.wysiwyg.js'; |
|
50 | 50 | if (!file_exists($script)) { |
51 | 51 | return; |
52 | 52 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * An array containing editor properties as returned from hook_editor(). |
45 | 45 | * |
46 | 46 | * @return |
47 | - * The installed editor version. |
|
47 | + null|string The installed editor version. |
|
48 | 48 | */ |
49 | 49 | function wysiwyg_markitup_version($editor) { |
50 | 50 | // Changelog was in markitup/markitup/readme.txt <= 1.1.5. |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * A wysiwyg editor profile. |
75 | 75 | * |
76 | 76 | * @return |
77 | - * An array of theme names. The first returned name should be the default |
|
77 | + string[] An array of theme names. The first returned name should be the default |
|
78 | 78 | * theme name. |
79 | 79 | */ |
80 | 80 | function wysiwyg_markitup_themes($editor, $profile) { |
@@ -9,32 +9,32 @@ discard block |
||
9 | 9 | * Plugin implementation of hook_editor(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_markitup_editor() { |
12 | - $editor['markitup'] = array( |
|
12 | + $editor['markitup'] = array( |
|
13 | 13 | 'title' => 'markItUp', |
14 | 14 | 'vendor url' => 'http://markitup.jaysalvat.com', |
15 | 15 | 'download url' => 'http://markitup.jaysalvat.com/downloads', |
16 | 16 | 'library path' => wysiwyg_get_path('markitup'), |
17 | 17 | 'libraries' => array( |
18 | - '' => array( |
|
18 | + '' => array( |
|
19 | 19 | 'title' => 'Source', |
20 | 20 | 'files' => array('markitup/jquery.markitup.js'), |
21 | - ), |
|
22 | - 'pack' => array( |
|
21 | + ), |
|
22 | + 'pack' => array( |
|
23 | 23 | 'title' => 'Packed', |
24 | 24 | 'files' => array('markitup/jquery.markitup.pack.js'), |
25 | - ), |
|
25 | + ), |
|
26 | 26 | ), |
27 | 27 | 'version callback' => 'wysiwyg_markitup_version', |
28 | 28 | 'themes callback' => 'wysiwyg_markitup_themes', |
29 | 29 | 'settings callback' => 'wysiwyg_markitup_settings', |
30 | 30 | 'plugin callback' => 'wysiwyg_markitup_plugins', |
31 | 31 | 'versions' => array( |
32 | - '1.1.5' => array( |
|
32 | + '1.1.5' => array( |
|
33 | 33 | 'js files' => array('markitup.js'), |
34 | - ), |
|
34 | + ), |
|
35 | 35 | ), |
36 | - ); |
|
37 | - return $editor; |
|
36 | + ); |
|
37 | + return $editor; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,22 +47,22 @@ discard block |
||
47 | 47 | * The installed editor version. |
48 | 48 | */ |
49 | 49 | function wysiwyg_markitup_version($editor) { |
50 | - // Changelog was in markitup/markitup/readme.txt <= 1.1.5. |
|
51 | - $changelog = $editor['library path'] . '/markitup/readme.txt'; |
|
52 | - if (!file_exists($changelog)) { |
|
50 | + // Changelog was in markitup/markitup/readme.txt <= 1.1.5. |
|
51 | + $changelog = $editor['library path'] . '/markitup/readme.txt'; |
|
52 | + if (!file_exists($changelog)) { |
|
53 | 53 | // Changelog was moved up to markitup/CHANGELOG.md after 1.1.5. |
54 | 54 | $changelog = $editor['library path'] . '/CHANGELOG.md'; |
55 | 55 | if (!file_exists($changelog)) { |
56 | - return; |
|
56 | + return; |
|
57 | + } |
|
57 | 58 | } |
58 | - } |
|
59 | - $changelog = fopen($changelog, 'r'); |
|
60 | - $line = fgets($changelog); |
|
61 | - if (preg_match('@([0-9\.]+)@', $line, $version)) { |
|
59 | + $changelog = fopen($changelog, 'r'); |
|
60 | + $line = fgets($changelog); |
|
61 | + if (preg_match('@([0-9\.]+)@', $line, $version)) { |
|
62 | 62 | fclose($changelog); |
63 | 63 | return $version[1]; |
64 | - } |
|
65 | - fclose($changelog); |
|
64 | + } |
|
65 | + fclose($changelog); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * theme name. |
79 | 79 | */ |
80 | 80 | function wysiwyg_markitup_themes($editor, $profile) { |
81 | - return array('simple', 'markitup'); |
|
81 | + return array('simple', 'markitup'); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -96,91 +96,91 @@ discard block |
||
96 | 96 | * Drupal.settings.wysiwyg.configs.{editor} |
97 | 97 | */ |
98 | 98 | function wysiwyg_markitup_settings($editor, $config, $theme) { |
99 | - // Whoever is guilty for adding this horrible CSS-file-without-filepath |
|
100 | - // override "feature" to Drupal core... stand in the corner! |
|
101 | - drupal_add_css($editor['library path'] . '/markitup/skins/' . $theme . '/style.css', 'theme'); |
|
99 | + // Whoever is guilty for adding this horrible CSS-file-without-filepath |
|
100 | + // override "feature" to Drupal core... stand in the corner! |
|
101 | + drupal_add_css($editor['library path'] . '/markitup/skins/' . $theme . '/style.css', 'theme'); |
|
102 | 102 | |
103 | - $settings = array( |
|
103 | + $settings = array( |
|
104 | 104 | 'root' => base_path() . $editor['library path'] . '/markitup/', |
105 | 105 | 'nameSpace' => $theme, |
106 | 106 | 'markupSet' => array(), |
107 | - ); |
|
107 | + ); |
|
108 | 108 | |
109 | - // Add configured buttons or all available. |
|
110 | - $default_buttons = array( |
|
109 | + // Add configured buttons or all available. |
|
110 | + $default_buttons = array( |
|
111 | 111 | 'bold' => array( |
112 | - 'name' => t('Bold'), |
|
113 | - 'className' => 'markitup-bold', |
|
114 | - 'key' => 'B', |
|
115 | - 'openWith' => '(!(<strong>|!|<b>)!)', |
|
116 | - 'closeWith' => '(!(</strong>|!|</b>)!)', |
|
112 | + 'name' => t('Bold'), |
|
113 | + 'className' => 'markitup-bold', |
|
114 | + 'key' => 'B', |
|
115 | + 'openWith' => '(!(<strong>|!|<b>)!)', |
|
116 | + 'closeWith' => '(!(</strong>|!|</b>)!)', |
|
117 | 117 | ), |
118 | 118 | 'italic' => array( |
119 | - 'name' => t('Italic'), |
|
120 | - 'className' => 'markitup-italic', |
|
121 | - 'key' => 'I', |
|
122 | - 'openWith' => '(!(<em>|!|<i>)!)', |
|
123 | - 'closeWith' => '(!(</em>|!|</i>)!)', |
|
119 | + 'name' => t('Italic'), |
|
120 | + 'className' => 'markitup-italic', |
|
121 | + 'key' => 'I', |
|
122 | + 'openWith' => '(!(<em>|!|<i>)!)', |
|
123 | + 'closeWith' => '(!(</em>|!|</i>)!)', |
|
124 | 124 | ), |
125 | 125 | 'stroke' => array( |
126 | - 'name' => t('Strike-through'), |
|
127 | - 'className' => 'markitup-stroke', |
|
128 | - 'key' => 'S', |
|
129 | - 'openWith' => '<del>', |
|
130 | - 'closeWith' => '</del>', |
|
126 | + 'name' => t('Strike-through'), |
|
127 | + 'className' => 'markitup-stroke', |
|
128 | + 'key' => 'S', |
|
129 | + 'openWith' => '<del>', |
|
130 | + 'closeWith' => '</del>', |
|
131 | 131 | ), |
132 | 132 | 'image' => array( |
133 | - 'name' => t('Image'), |
|
134 | - 'className' => 'markitup-image', |
|
135 | - 'key' => 'P', |
|
136 | - 'replaceWith' => '<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />', |
|
133 | + 'name' => t('Image'), |
|
134 | + 'className' => 'markitup-image', |
|
135 | + 'key' => 'P', |
|
136 | + 'replaceWith' => '<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />', |
|
137 | 137 | ), |
138 | 138 | 'link' => array( |
139 | - 'name' => t('Link'), |
|
140 | - 'className' => 'markitup-link', |
|
141 | - 'key' => 'K', |
|
142 | - 'openWith' => '<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', |
|
143 | - 'closeWith' => '</a>', |
|
144 | - 'placeHolder' => 'Your text to link...', |
|
139 | + 'name' => t('Link'), |
|
140 | + 'className' => 'markitup-link', |
|
141 | + 'key' => 'K', |
|
142 | + 'openWith' => '<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', |
|
143 | + 'closeWith' => '</a>', |
|
144 | + 'placeHolder' => 'Your text to link...', |
|
145 | 145 | ), |
146 | 146 | // @todo |
147 | 147 | // 'cleanup' => array('name' => t('Clean-up'), 'className' => 'markitup-cleanup', 'replaceWith' => 'function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") }'), |
148 | 148 | 'preview' => array( |
149 | - 'name' => t('Preview'), |
|
150 | - 'className' => 'markitup-preview', |
|
151 | - 'call' => 'preview', |
|
149 | + 'name' => t('Preview'), |
|
150 | + 'className' => 'markitup-preview', |
|
151 | + 'call' => 'preview', |
|
152 | 152 | ), |
153 | - ); |
|
154 | - $settings['markupSet'] = array(); |
|
155 | - if (!empty($config['buttons'])) { |
|
153 | + ); |
|
154 | + $settings['markupSet'] = array(); |
|
155 | + if (!empty($config['buttons'])) { |
|
156 | 156 | foreach ($config['buttons'] as $plugin) { |
157 | - foreach ($plugin as $button => $enabled) { |
|
157 | + foreach ($plugin as $button => $enabled) { |
|
158 | 158 | if (isset($default_buttons[$button])) { |
159 | - $settings['markupSet'][$button] = $default_buttons[$button]; |
|
159 | + $settings['markupSet'][$button] = $default_buttons[$button]; |
|
160 | + } |
|
160 | 161 | } |
161 | - } |
|
162 | 162 | } |
163 | - } |
|
163 | + } |
|
164 | 164 | |
165 | - return $settings; |
|
165 | + return $settings; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
169 | 169 | * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
170 | 170 | */ |
171 | 171 | function wysiwyg_markitup_plugins($editor) { |
172 | - return array( |
|
172 | + return array( |
|
173 | 173 | 'default' => array( |
174 | - 'buttons' => array( |
|
174 | + 'buttons' => array( |
|
175 | 175 | 'bold' => t('Bold'), 'italic' => t('Italic'), |
176 | 176 | 'stroke' => t('Strike-through'), |
177 | 177 | 'link' => t('Link'), |
178 | 178 | 'image' => t('Image'), |
179 | 179 | // 'cleanup' => t('Clean-up'), |
180 | 180 | 'preview' => t('Preview'), |
181 | - ), |
|
182 | - 'internal' => TRUE, |
|
181 | + ), |
|
182 | + 'internal' => TRUE, |
|
183 | 183 | ), |
184 | - ); |
|
184 | + ); |
|
185 | 185 | } |
186 | 186 |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | */ |
49 | 49 | function wysiwyg_markitup_version($editor) { |
50 | 50 | // Changelog was in markitup/markitup/readme.txt <= 1.1.5. |
51 | - $changelog = $editor['library path'] . '/markitup/readme.txt'; |
|
51 | + $changelog = $editor['library path'].'/markitup/readme.txt'; |
|
52 | 52 | if (!file_exists($changelog)) { |
53 | 53 | // Changelog was moved up to markitup/CHANGELOG.md after 1.1.5. |
54 | - $changelog = $editor['library path'] . '/CHANGELOG.md'; |
|
54 | + $changelog = $editor['library path'].'/CHANGELOG.md'; |
|
55 | 55 | if (!file_exists($changelog)) { |
56 | 56 | return; |
57 | 57 | } |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | function wysiwyg_markitup_settings($editor, $config, $theme) { |
99 | 99 | // Whoever is guilty for adding this horrible CSS-file-without-filepath |
100 | 100 | // override "feature" to Drupal core... stand in the corner! |
101 | - drupal_add_css($editor['library path'] . '/markitup/skins/' . $theme . '/style.css', 'theme'); |
|
101 | + drupal_add_css($editor['library path'].'/markitup/skins/'.$theme.'/style.css', 'theme'); |
|
102 | 102 | |
103 | 103 | $settings = array( |
104 | - 'root' => base_path() . $editor['library path'] . '/markitup/', |
|
104 | + 'root' => base_path().$editor['library path'].'/markitup/', |
|
105 | 105 | 'nameSpace' => $theme, |
106 | 106 | 'markupSet' => array(), |
107 | 107 | ); |
@@ -179,7 +179,7 @@ |
||
179 | 179 | // 'cleanup' => t('Clean-up'), |
180 | 180 | 'preview' => t('Preview'), |
181 | 181 | ), |
182 | - 'internal' => TRUE, |
|
182 | + 'internal' => true, |
|
183 | 183 | ), |
184 | 184 | ); |
185 | 185 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * An array containing editor properties as returned from hook_editor(). |
39 | 39 | * |
40 | 40 | * @return |
41 | - * The installed editor version. |
|
41 | + string The installed editor version. |
|
42 | 42 | */ |
43 | 43 | function wysiwyg_nicedit_version($editor) { |
44 | 44 | // @see http://nicedit.com/forums/viewtopic.php?t=425 |
@@ -9,26 +9,26 @@ discard block |
||
9 | 9 | * Plugin implementation of hook_editor(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_nicedit_editor() { |
12 | - $editor['nicedit'] = array( |
|
12 | + $editor['nicedit'] = array( |
|
13 | 13 | 'title' => 'NicEdit', |
14 | 14 | 'vendor url' => 'http://nicedit.com', |
15 | 15 | 'download url' => 'http://nicedit.com/download.php', |
16 | 16 | 'libraries' => array( |
17 | - '' => array( |
|
17 | + '' => array( |
|
18 | 18 | 'title' => 'Source', |
19 | 19 | 'files' => array('nicEdit.js'), |
20 | - ), |
|
20 | + ), |
|
21 | 21 | ), |
22 | 22 | 'version callback' => 'wysiwyg_nicedit_version', |
23 | 23 | 'settings callback' => 'wysiwyg_nicedit_settings', |
24 | 24 | 'plugin callback' => 'wysiwyg_nicedit_plugins', |
25 | 25 | 'versions' => array( |
26 | - '0.9' => array( |
|
26 | + '0.9' => array( |
|
27 | 27 | 'js files' => array('nicedit.js'), |
28 | - ), |
|
28 | + ), |
|
29 | 29 | ), |
30 | - ); |
|
31 | - return $editor; |
|
30 | + ); |
|
31 | + return $editor; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * The installed editor version. |
42 | 42 | */ |
43 | 43 | function wysiwyg_nicedit_version($editor) { |
44 | - // @see http://nicedit.com/forums/viewtopic.php?t=425 |
|
45 | - return '0.9'; |
|
44 | + // @see http://nicedit.com/forums/viewtopic.php?t=425 |
|
45 | + return '0.9'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -60,43 +60,43 @@ discard block |
||
60 | 60 | * Drupal.settings.wysiwyg.configs.{editor} |
61 | 61 | */ |
62 | 62 | function wysiwyg_nicedit_settings($editor, $config, $theme) { |
63 | - $settings = array( |
|
63 | + $settings = array( |
|
64 | 64 | 'iconsPath' => base_path() . $editor['library path'] . '/nicEditorIcons.gif', |
65 | - ); |
|
65 | + ); |
|
66 | 66 | |
67 | - // Add configured buttons or all available. |
|
68 | - $settings['buttonList'] = array(); |
|
69 | - if (!empty($config['buttons'])) { |
|
67 | + // Add configured buttons or all available. |
|
68 | + $settings['buttonList'] = array(); |
|
69 | + if (!empty($config['buttons'])) { |
|
70 | 70 | $buttons = array(); |
71 | 71 | foreach ($config['buttons'] as $plugin) { |
72 | - $buttons = array_merge($buttons, $plugin); |
|
72 | + $buttons = array_merge($buttons, $plugin); |
|
73 | 73 | } |
74 | 74 | $settings['buttonList'] = array_keys($buttons); |
75 | - } |
|
75 | + } |
|
76 | 76 | |
77 | - // Add editor content stylesheet. |
|
78 | - if (isset($config['css_setting'])) { |
|
77 | + // Add editor content stylesheet. |
|
78 | + if (isset($config['css_setting'])) { |
|
79 | 79 | if ($config['css_setting'] == 'theme') { |
80 | - $css = path_to_theme() . '/style.css'; |
|
81 | - if (file_exists($css)) { |
|
80 | + $css = path_to_theme() . '/style.css'; |
|
81 | + if (file_exists($css)) { |
|
82 | 82 | $settings['externalCSS'] = base_path() . $css; |
83 | - } |
|
83 | + } |
|
84 | 84 | } |
85 | 85 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
86 | - $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
86 | + $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
87 | + } |
|
87 | 88 | } |
88 | - } |
|
89 | 89 | |
90 | - return $settings; |
|
90 | + return $settings; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | 94 | * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
95 | 95 | */ |
96 | 96 | function wysiwyg_nicedit_plugins($editor) { |
97 | - return array( |
|
97 | + return array( |
|
98 | 98 | 'default' => array( |
99 | - 'buttons' => array( |
|
99 | + 'buttons' => array( |
|
100 | 100 | 'bold' => t('Bold'), 'italic' => t('Italic'), 'underline' => t('Underline'), |
101 | 101 | 'strikethrough' => t('Strike-through'), |
102 | 102 | 'left' => t('Align left'), 'center' => t('Align center'), 'right' => t('Align right'), |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | 'link' => t('Link'), 'unlink' => t('Unlink'), |
112 | 112 | 'fontFormat' => t('HTML block format'), 'fontFamily' => t('Font'), 'fontSize' => t('Font size'), |
113 | 113 | 'xhtml' => t('Source code'), |
114 | - ), |
|
115 | - 'internal' => TRUE, |
|
114 | + ), |
|
115 | + 'internal' => TRUE, |
|
116 | 116 | ), |
117 | - ); |
|
117 | + ); |
|
118 | 118 | } |
119 | 119 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function wysiwyg_nicedit_settings($editor, $config, $theme) { |
63 | 63 | $settings = array( |
64 | - 'iconsPath' => base_path() . $editor['library path'] . '/nicEditorIcons.gif', |
|
64 | + 'iconsPath' => base_path().$editor['library path'].'/nicEditorIcons.gif', |
|
65 | 65 | ); |
66 | 66 | |
67 | 67 | // Add configured buttons or all available. |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | // Add editor content stylesheet. |
78 | 78 | if (isset($config['css_setting'])) { |
79 | 79 | if ($config['css_setting'] == 'theme') { |
80 | - $css = path_to_theme() . '/style.css'; |
|
80 | + $css = path_to_theme().'/style.css'; |
|
81 | 81 | if (file_exists($css)) { |
82 | - $settings['externalCSS'] = base_path() . $css; |
|
82 | + $settings['externalCSS'] = base_path().$css; |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
@@ -108,8 +108,7 @@ |
||
108 | 108 | if (file_exists($css)) { |
109 | 109 | $settings['externalCSS'] = base_path() . $css; |
110 | 110 | } |
111 | - } |
|
112 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
111 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
113 | 112 | $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
114 | 113 | } |
115 | 114 | } |
@@ -112,7 +112,7 @@ |
||
112 | 112 | 'fontFormat' => t('HTML block format'), 'fontFamily' => t('Font'), 'fontSize' => t('Font size'), |
113 | 113 | 'xhtml' => t('Source code'), |
114 | 114 | ), |
115 | - 'internal' => TRUE, |
|
115 | + 'internal' => true, |
|
116 | 116 | ), |
117 | 117 | ); |
118 | 118 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * An array containing editor properties as returned from hook_editor(). |
42 | 42 | * |
43 | 43 | * @return |
44 | - * The installed editor version. |
|
44 | + null|string The installed editor version. |
|
45 | 45 | */ |
46 | 46 | function wysiwyg_openwysiwyg_version($editor) { |
47 | 47 | // 'library path' has '/scripts' appended already. |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * A wysiwyg editor profile. |
68 | 68 | * |
69 | 69 | * @return |
70 | - * An array of theme names. The first returned name should be the default |
|
70 | + string[] An array of theme names. The first returned name should be the default |
|
71 | 71 | * theme name. |
72 | 72 | */ |
73 | 73 | function wysiwyg_openwysiwyg_themes($editor, $profile) { |
@@ -9,29 +9,29 @@ discard block |
||
9 | 9 | * Plugin implementation of hook_editor(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_openwysiwyg_editor() { |
12 | - $editor['openwysiwyg'] = array( |
|
12 | + $editor['openwysiwyg'] = array( |
|
13 | 13 | 'title' => 'openWYSIWYG', |
14 | 14 | 'vendor url' => 'http://www.openwebware.com', |
15 | 15 | 'download url' => 'http://www.openwebware.com/download.shtml', |
16 | 16 | 'library path' => wysiwyg_get_path('openwysiwyg') . '/scripts', |
17 | 17 | 'libraries' => array( |
18 | - 'src' => array( |
|
18 | + 'src' => array( |
|
19 | 19 | 'title' => 'Source', |
20 | 20 | 'files' => array('wysiwyg.js'), |
21 | - ), |
|
21 | + ), |
|
22 | 22 | ), |
23 | 23 | 'version callback' => 'wysiwyg_openwysiwyg_version', |
24 | 24 | 'themes callback' => 'wysiwyg_openwysiwyg_themes', |
25 | 25 | 'settings callback' => 'wysiwyg_openwysiwyg_settings', |
26 | 26 | 'plugin callback' => 'wysiwyg_openwysiwyg_plugins', |
27 | 27 | 'versions' => array( |
28 | - '1.4.7' => array( |
|
28 | + '1.4.7' => array( |
|
29 | 29 | 'js files' => array('openwysiwyg.js'), |
30 | 30 | 'css files' => array('openwysiwyg.css'), |
31 | - ), |
|
31 | + ), |
|
32 | 32 | ), |
33 | - ); |
|
34 | - return $editor; |
|
33 | + ); |
|
34 | + return $editor; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -44,18 +44,18 @@ discard block |
||
44 | 44 | * The installed editor version. |
45 | 45 | */ |
46 | 46 | function wysiwyg_openwysiwyg_version($editor) { |
47 | - // 'library path' has '/scripts' appended already. |
|
48 | - $changelog = $editor['editor path'] . '/changelog'; |
|
49 | - if (!file_exists($changelog)) { |
|
47 | + // 'library path' has '/scripts' appended already. |
|
48 | + $changelog = $editor['editor path'] . '/changelog'; |
|
49 | + if (!file_exists($changelog)) { |
|
50 | 50 | return; |
51 | - } |
|
52 | - $changelog = fopen($changelog, 'r'); |
|
53 | - $line = fgets($changelog, 20); |
|
54 | - if (preg_match('@v([\d\.]+)@', $line, $version)) { |
|
51 | + } |
|
52 | + $changelog = fopen($changelog, 'r'); |
|
53 | + $line = fgets($changelog, 20); |
|
54 | + if (preg_match('@v([\d\.]+)@', $line, $version)) { |
|
55 | 55 | fclose($changelog); |
56 | 56 | return $version[1]; |
57 | - } |
|
58 | - fclose($changelog); |
|
57 | + } |
|
58 | + fclose($changelog); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * theme name. |
72 | 72 | */ |
73 | 73 | function wysiwyg_openwysiwyg_themes($editor, $profile) { |
74 | - return array('default'); |
|
74 | + return array('default'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -89,58 +89,58 @@ discard block |
||
89 | 89 | * Drupal.settings.wysiwyg.configs.{editor} |
90 | 90 | */ |
91 | 91 | function wysiwyg_openwysiwyg_settings($editor, $config, $theme) { |
92 | - $settings = array( |
|
92 | + $settings = array( |
|
93 | 93 | 'path' => base_path() . $editor['editor path'] . '/', |
94 | 94 | 'Width' => '100%', |
95 | - ); |
|
95 | + ); |
|
96 | 96 | |
97 | - if (isset($config['path_loc']) && $config['path_loc'] == 'none') { |
|
97 | + if (isset($config['path_loc']) && $config['path_loc'] == 'none') { |
|
98 | 98 | $settings['StatusBarEnabled'] = FALSE; |
99 | - } |
|
99 | + } |
|
100 | 100 | |
101 | - if (isset($config['css_setting'])) { |
|
101 | + if (isset($config['css_setting'])) { |
|
102 | 102 | if ($config['css_setting'] == 'theme') { |
103 | - $settings['CSSFile'] = reset(wysiwyg_get_css()); |
|
103 | + $settings['CSSFile'] = reset(wysiwyg_get_css()); |
|
104 | 104 | } |
105 | 105 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
106 | - $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
106 | + $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
107 | + } |
|
107 | 108 | } |
108 | - } |
|
109 | 109 | |
110 | - $settings['Toolbar'] = array(); |
|
111 | - if (!empty($config['buttons'])) { |
|
110 | + $settings['Toolbar'] = array(); |
|
111 | + if (!empty($config['buttons'])) { |
|
112 | 112 | $plugins = wysiwyg_get_plugins($editor['name']); |
113 | 113 | foreach ($config['buttons'] as $plugin => $buttons) { |
114 | - foreach ($buttons as $button => $enabled) { |
|
114 | + foreach ($buttons as $button => $enabled) { |
|
115 | 115 | foreach (array('buttons', 'extensions') as $type) { |
116 | - // Skip unavailable plugins. |
|
117 | - if (!isset($plugins[$plugin][$type][$button])) { |
|
116 | + // Skip unavailable plugins. |
|
117 | + if (!isset($plugins[$plugin][$type][$button])) { |
|
118 | 118 | continue; |
119 | - } |
|
120 | - // Add buttons. |
|
121 | - if ($type == 'buttons') { |
|
119 | + } |
|
120 | + // Add buttons. |
|
121 | + if ($type == 'buttons') { |
|
122 | 122 | $settings['Toolbar'][0][] = $button; |
123 | - } |
|
123 | + } |
|
124 | + } |
|
124 | 125 | } |
125 | - } |
|
126 | 126 | } |
127 | - } |
|
127 | + } |
|
128 | 128 | |
129 | - // @todo |
|
129 | + // @todo |
|
130 | 130 | // if (isset($config['block_formats'])) { |
131 | 131 | // $settings['DropDowns']['headings']['elements'] = explode(',', $config['block_formats']); |
132 | 132 | // } |
133 | 133 | |
134 | - return $settings; |
|
134 | + return $settings; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
138 | 138 | * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
139 | 139 | */ |
140 | 140 | function wysiwyg_openwysiwyg_plugins($editor) { |
141 | - $plugins = array( |
|
141 | + $plugins = array( |
|
142 | 142 | 'default' => array( |
143 | - 'buttons' => array( |
|
143 | + 'buttons' => array( |
|
144 | 144 | 'bold' => t('Bold'), 'italic' => t('Italic'), 'underline' => t('Underline'), |
145 | 145 | 'strikethrough' => t('Strike-through'), |
146 | 146 | 'justifyleft' => t('Align left'), 'justifycenter' => t('Align center'), 'justifyright' => t('Align right'), 'justifyfull' => t('Justify'), |
@@ -164,10 +164,10 @@ discard block |
||
164 | 164 | 'print' => t('Print'), |
165 | 165 | 'inserttable' => t('Table'), |
166 | 166 | 'help' => t('Help'), |
167 | - ), |
|
168 | - 'internal' => TRUE, |
|
167 | + ), |
|
168 | + 'internal' => TRUE, |
|
169 | 169 | ), |
170 | - ); |
|
171 | - return $plugins; |
|
170 | + ); |
|
171 | + return $plugins; |
|
172 | 172 | } |
173 | 173 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | 'title' => 'openWYSIWYG', |
14 | 14 | 'vendor url' => 'http://www.openwebware.com', |
15 | 15 | 'download url' => 'http://www.openwebware.com/download.shtml', |
16 | - 'library path' => wysiwyg_get_path('openwysiwyg') . '/scripts', |
|
16 | + 'library path' => wysiwyg_get_path('openwysiwyg').'/scripts', |
|
17 | 17 | 'libraries' => array( |
18 | 18 | 'src' => array( |
19 | 19 | 'title' => 'Source', |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | function wysiwyg_openwysiwyg_version($editor) { |
47 | 47 | // 'library path' has '/scripts' appended already. |
48 | - $changelog = $editor['editor path'] . '/changelog'; |
|
48 | + $changelog = $editor['editor path'].'/changelog'; |
|
49 | 49 | if (!file_exists($changelog)) { |
50 | 50 | return; |
51 | 51 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | function wysiwyg_openwysiwyg_settings($editor, $config, $theme) { |
92 | 92 | $settings = array( |
93 | - 'path' => base_path() . $editor['editor path'] . '/', |
|
93 | + 'path' => base_path().$editor['editor path'].'/', |
|
94 | 94 | 'Width' => '100%', |
95 | 95 | ); |
96 | 96 |
@@ -101,8 +101,7 @@ |
||
101 | 101 | if (isset($config['css_setting'])) { |
102 | 102 | if ($config['css_setting'] == 'theme') { |
103 | 103 | $settings['CSSFile'] = reset(wysiwyg_get_css()); |
104 | - } |
|
105 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
104 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
106 | 105 | $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
107 | 106 | } |
108 | 107 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ); |
96 | 96 | |
97 | 97 | if (isset($config['path_loc']) && $config['path_loc'] == 'none') { |
98 | - $settings['StatusBarEnabled'] = FALSE; |
|
98 | + $settings['StatusBarEnabled'] = false; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | if (isset($config['css_setting'])) { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | 'inserttable' => t('Table'), |
166 | 166 | 'help' => t('Help'), |
167 | 167 | ), |
168 | - 'internal' => TRUE, |
|
168 | + 'internal' => true, |
|
169 | 169 | ), |
170 | 170 | ); |
171 | 171 | return $plugins; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * An array containing editor properties as returned from hook_editor(). |
78 | 78 | * |
79 | 79 | * @return |
80 | - * The installed editor version. |
|
80 | + null|string The installed editor version. |
|
81 | 81 | */ |
82 | 82 | function wysiwyg_tinymce_version($editor) { |
83 | 83 | $script = $editor['library path'] . '/tiny_mce.js'; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * A wysiwyg editor profile. |
105 | 105 | * |
106 | 106 | * @return |
107 | - * An array of theme names. The first returned name should be the default |
|
107 | + string[] An array of theme names. The first returned name should be the default |
|
108 | 108 | * theme name. |
109 | 109 | */ |
110 | 110 | function wysiwyg_tinymce_themes($editor, $profile) { |
@@ -11,20 +11,20 @@ discard block |
||
11 | 11 | * @todo wysiwyg_<editor>_alter() to add/inject optional libraries like gzip. |
12 | 12 | */ |
13 | 13 | function wysiwyg_tinymce_editor() { |
14 | - $editor['tinymce'] = array( |
|
14 | + $editor['tinymce'] = array( |
|
15 | 15 | 'title' => 'TinyMCE', |
16 | 16 | 'vendor url' => 'http://tinymce.moxiecode.com', |
17 | 17 | 'download url' => 'http://tinymce.moxiecode.com/download.php', |
18 | 18 | 'library path' => wysiwyg_get_path('tinymce') . '/jscripts/tiny_mce', |
19 | 19 | 'libraries' => array( |
20 | - '' => array( |
|
20 | + '' => array( |
|
21 | 21 | 'title' => 'Minified', |
22 | 22 | 'files' => array('tiny_mce.js'), |
23 | - ), |
|
24 | - 'src' => array( |
|
23 | + ), |
|
24 | + 'src' => array( |
|
25 | 25 | 'title' => 'Source', |
26 | 26 | 'files' => array('tiny_mce_src.js'), |
27 | - ), |
|
27 | + ), |
|
28 | 28 | ), |
29 | 29 | 'version callback' => 'wysiwyg_tinymce_version', |
30 | 30 | 'themes callback' => 'wysiwyg_tinymce_themes', |
@@ -32,42 +32,42 @@ discard block |
||
32 | 32 | 'plugin callback' => 'wysiwyg_tinymce_plugins', |
33 | 33 | 'plugin settings callback' => 'wysiwyg_tinymce_plugin_settings', |
34 | 34 | 'proxy plugin' => array( |
35 | - 'drupal' => array( |
|
35 | + 'drupal' => array( |
|
36 | 36 | 'load' => TRUE, |
37 | 37 | 'proxy' => TRUE, |
38 | - ), |
|
38 | + ), |
|
39 | 39 | ), |
40 | 40 | 'proxy plugin settings callback' => 'wysiwyg_tinymce_proxy_plugin_settings', |
41 | 41 | 'versions' => array( |
42 | - '2.1' => array( |
|
42 | + '2.1' => array( |
|
43 | 43 | 'js files' => array('tinymce-2.js'), |
44 | 44 | 'css files' => array('tinymce-2.css'), |
45 | 45 | 'download url' => 'http://sourceforge.net/project/showfiles.php?group_id=103281&package_id=111430&release_id=557383', |
46 | - ), |
|
47 | - // @todo Starting from 3.3, tiny_mce.js may support JS aggregation. |
|
48 | - '3.1' => array( |
|
46 | + ), |
|
47 | + // @todo Starting from 3.3, tiny_mce.js may support JS aggregation. |
|
48 | + '3.1' => array( |
|
49 | 49 | 'js files' => array('tinymce-3.js'), |
50 | 50 | 'css files' => array('tinymce-3.css'), |
51 | 51 | 'libraries' => array( |
52 | - '' => array( |
|
52 | + '' => array( |
|
53 | 53 | 'title' => 'Minified', |
54 | 54 | 'files' => array( |
55 | - 'tiny_mce.js' => array('preprocess' => FALSE), |
|
55 | + 'tiny_mce.js' => array('preprocess' => FALSE), |
|
56 | 56 | ), |
57 | - ), |
|
58 | - 'jquery' => array( |
|
57 | + ), |
|
58 | + 'jquery' => array( |
|
59 | 59 | 'title' => 'jQuery', |
60 | 60 | 'files' => array('tiny_mce_jquery.js'), |
61 | - ), |
|
62 | - 'src' => array( |
|
61 | + ), |
|
62 | + 'src' => array( |
|
63 | 63 | 'title' => 'Source', |
64 | 64 | 'files' => array('tiny_mce_src.js'), |
65 | - ), |
|
65 | + ), |
|
66 | + ), |
|
66 | 67 | ), |
67 | - ), |
|
68 | 68 | ), |
69 | - ); |
|
70 | - return $editor; |
|
69 | + ); |
|
70 | + return $editor; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | * The installed editor version. |
81 | 81 | */ |
82 | 82 | function wysiwyg_tinymce_version($editor) { |
83 | - $script = $editor['library path'] . '/tiny_mce.js'; |
|
84 | - if (!file_exists($script)) { |
|
83 | + $script = $editor['library path'] . '/tiny_mce.js'; |
|
84 | + if (!file_exists($script)) { |
|
85 | 85 | return; |
86 | - } |
|
87 | - $script = fopen($script, 'r'); |
|
88 | - // Version is contained in the first 200 chars. |
|
89 | - $line = fgets($script, 200); |
|
90 | - fclose($script); |
|
91 | - // 2.x: this.majorVersion="2";this.minorVersion="1.3" |
|
92 | - // 3.x: majorVersion:'3',minorVersion:'2.0.1' |
|
93 | - if (preg_match('@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@', $line, $version)) { |
|
86 | + } |
|
87 | + $script = fopen($script, 'r'); |
|
88 | + // Version is contained in the first 200 chars. |
|
89 | + $line = fgets($script, 200); |
|
90 | + fclose($script); |
|
91 | + // 2.x: this.majorVersion="2";this.minorVersion="1.3" |
|
92 | + // 3.x: majorVersion:'3',minorVersion:'2.0.1' |
|
93 | + if (preg_match('@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@', $line, $version)) { |
|
94 | 94 | return $version[1] . '.' . $version[2]; |
95 | - } |
|
95 | + } |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * theme name. |
109 | 109 | */ |
110 | 110 | function wysiwyg_tinymce_themes($editor, $profile) { |
111 | - /* |
|
111 | + /* |
|
112 | 112 | $themes = array(); |
113 | 113 | $dir = $editor['library path'] . '/themes/'; |
114 | 114 | if (is_dir($dir) && $dh = opendir($dir)) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | return $themes; |
124 | 124 | */ |
125 | - return array('advanced', 'simple'); |
|
125 | + return array('advanced', 'simple'); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * Drupal.settings.wysiwyg.configs.{editor} |
141 | 141 | */ |
142 | 142 | function wysiwyg_tinymce_settings($editor, $config, $theme) { |
143 | - $settings = array( |
|
143 | + $settings = array( |
|
144 | 144 | 'button_tile_map' => TRUE, // @todo Add a setting for this. |
145 | 145 | 'document_base_url' => base_path(), |
146 | 146 | 'mode' => 'none', |
@@ -158,49 +158,49 @@ discard block |
||
158 | 158 | // HTML control characters and invisible characters. TinyMCE always converts |
159 | 159 | // XML default characters '&', '<', '>'. |
160 | 160 | 'entities' => '160,nbsp,173,shy,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm', |
161 | - ); |
|
162 | - if (isset($config['apply_source_formatting'])) { |
|
161 | + ); |
|
162 | + if (isset($config['apply_source_formatting'])) { |
|
163 | 163 | $settings['apply_source_formatting'] = $config['apply_source_formatting']; |
164 | - } |
|
165 | - if (isset($config['convert_fonts_to_spans'])) { |
|
164 | + } |
|
165 | + if (isset($config['convert_fonts_to_spans'])) { |
|
166 | 166 | $settings['convert_fonts_to_spans'] = $config['convert_fonts_to_spans']; |
167 | - } |
|
168 | - if (isset($config['language'])) { |
|
167 | + } |
|
168 | + if (isset($config['language'])) { |
|
169 | 169 | $settings['language'] = $config['language']; |
170 | - } |
|
171 | - if (isset($config['paste_auto_cleanup_on_paste'])) { |
|
170 | + } |
|
171 | + if (isset($config['paste_auto_cleanup_on_paste'])) { |
|
172 | 172 | $settings['paste_auto_cleanup_on_paste'] = $config['paste_auto_cleanup_on_paste']; |
173 | - } |
|
174 | - if (isset($config['preformatted'])) { |
|
173 | + } |
|
174 | + if (isset($config['preformatted'])) { |
|
175 | 175 | $settings['preformatted'] = $config['preformatted']; |
176 | - } |
|
177 | - if (isset($config['remove_linebreaks'])) { |
|
176 | + } |
|
177 | + if (isset($config['remove_linebreaks'])) { |
|
178 | 178 | $settings['remove_linebreaks'] = $config['remove_linebreaks']; |
179 | - } |
|
180 | - if (isset($config['verify_html'])) { |
|
179 | + } |
|
180 | + if (isset($config['verify_html'])) { |
|
181 | 181 | $settings['verify_html'] = (bool) $config['verify_html']; |
182 | - } |
|
182 | + } |
|
183 | 183 | |
184 | - if (!empty($config['css_classes'])) { |
|
184 | + if (!empty($config['css_classes'])) { |
|
185 | 185 | $settings['theme_advanced_styles'] = implode(';', array_filter(explode("\n", str_replace("\r", '', $config['css_classes'])))); |
186 | - } |
|
186 | + } |
|
187 | 187 | |
188 | - if (isset($config['css_setting'])) { |
|
188 | + if (isset($config['css_setting'])) { |
|
189 | 189 | if ($config['css_setting'] == 'theme') { |
190 | - $settings['content_css'] = implode(',', wysiwyg_get_css()); |
|
190 | + $settings['content_css'] = implode(',', wysiwyg_get_css()); |
|
191 | 191 | } |
192 | 192 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
193 | - $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
193 | + $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
194 | + } |
|
194 | 195 | } |
195 | - } |
|
196 | 196 | |
197 | - // Find the enabled buttons and the button row they belong on. |
|
198 | - // Also map the plugin metadata for each button. |
|
199 | - // @todo What follows is a pain; needs a rewrite. |
|
200 | - // $settings['buttons'] are stacked into $settings['theme_advanced_buttons1'] |
|
201 | - // later. |
|
202 | - $settings['buttons'] = array(); |
|
203 | - if (!empty($config['buttons']) && is_array($config['buttons'])) { |
|
197 | + // Find the enabled buttons and the button row they belong on. |
|
198 | + // Also map the plugin metadata for each button. |
|
199 | + // @todo What follows is a pain; needs a rewrite. |
|
200 | + // $settings['buttons'] are stacked into $settings['theme_advanced_buttons1'] |
|
201 | + // later. |
|
202 | + $settings['buttons'] = array(); |
|
203 | + if (!empty($config['buttons']) && is_array($config['buttons'])) { |
|
204 | 204 | // Only array keys in $settings['extensions'] matter; added to |
205 | 205 | // $settings['plugins'] later. |
206 | 206 | $settings['extensions'] = array(); |
@@ -213,54 +213,54 @@ discard block |
||
213 | 213 | |
214 | 214 | $plugins = wysiwyg_get_plugins($editor['name']); |
215 | 215 | foreach ($config['buttons'] as $plugin => $buttons) { |
216 | - foreach ($buttons as $button => $enabled) { |
|
216 | + foreach ($buttons as $button => $enabled) { |
|
217 | 217 | // Iterate separately over buttons and extensions properties. |
218 | 218 | foreach (array('buttons', 'extensions') as $type) { |
219 | - // Skip unavailable plugins. |
|
220 | - if (!isset($plugins[$plugin][$type][$button])) { |
|
219 | + // Skip unavailable plugins. |
|
220 | + if (!isset($plugins[$plugin][$type][$button])) { |
|
221 | 221 | continue; |
222 | - } |
|
223 | - // Add buttons. |
|
224 | - if ($type == 'buttons') { |
|
222 | + } |
|
223 | + // Add buttons. |
|
224 | + if ($type == 'buttons') { |
|
225 | 225 | $settings['buttons'][] = $button; |
226 | - } |
|
227 | - // Add external Drupal plugins to the list of extensions. |
|
228 | - if ($type == 'buttons' && !empty($plugins[$plugin]['proxy'])) { |
|
226 | + } |
|
227 | + // Add external Drupal plugins to the list of extensions. |
|
228 | + if ($type == 'buttons' && !empty($plugins[$plugin]['proxy'])) { |
|
229 | 229 | $settings['extensions'][_wysiwyg_tinymce_plugin_name('add', $button)] = 1; |
230 | - } |
|
231 | - // Add external plugins to the list of extensions. |
|
232 | - else if ($type == 'buttons' && empty($plugins[$plugin]['internal'])) { |
|
230 | + } |
|
231 | + // Add external plugins to the list of extensions. |
|
232 | + else if ($type == 'buttons' && empty($plugins[$plugin]['internal'])) { |
|
233 | 233 | $settings['extensions'][_wysiwyg_tinymce_plugin_name('add', $plugin)] = 1; |
234 | - } |
|
235 | - // Add internal buttons that also need to be loaded as extension. |
|
236 | - else if ($type == 'buttons' && !empty($plugins[$plugin]['load'])) { |
|
234 | + } |
|
235 | + // Add internal buttons that also need to be loaded as extension. |
|
236 | + else if ($type == 'buttons' && !empty($plugins[$plugin]['load'])) { |
|
237 | 237 | $settings['extensions'][$plugin] = 1; |
238 | - } |
|
239 | - // Add plain extensions. |
|
240 | - else if ($type == 'extensions' && !empty($plugins[$plugin]['load'])) { |
|
238 | + } |
|
239 | + // Add plain extensions. |
|
240 | + else if ($type == 'extensions' && !empty($plugins[$plugin]['load'])) { |
|
241 | 241 | $settings['extensions'][$plugin] = 1; |
242 | - } |
|
243 | - // Allow plugins to add valid HTML elements. |
|
244 | - if (!empty($plugins[$plugin]['extended_valid_elements'])) { |
|
242 | + } |
|
243 | + // Allow plugins to add valid HTML elements. |
|
244 | + if (!empty($plugins[$plugin]['extended_valid_elements'])) { |
|
245 | 245 | $settings['extended_valid_elements'] = array_merge($settings['extended_valid_elements'], $plugins[$plugin]['extended_valid_elements']); |
246 | - } |
|
247 | - // Allow plugins to add or override global configuration settings. |
|
248 | - if (!empty($plugins[$plugin]['options'])) { |
|
246 | + } |
|
247 | + // Allow plugins to add or override global configuration settings. |
|
248 | + if (!empty($plugins[$plugin]['options'])) { |
|
249 | 249 | $settings = array_merge($settings, $plugins[$plugin]['options']); |
250 | - } |
|
250 | + } |
|
251 | + } |
|
251 | 252 | } |
252 | - } |
|
253 | 253 | } |
254 | 254 | // Clean-up. |
255 | 255 | $settings['extended_valid_elements'] = array_unique($settings['extended_valid_elements']); |
256 | 256 | if ($settings['extensions']) { |
257 | - $settings['plugins'] = array_keys($settings['extensions']); |
|
257 | + $settings['plugins'] = array_keys($settings['extensions']); |
|
258 | 258 | } |
259 | 259 | unset($settings['extensions']); |
260 | - } |
|
260 | + } |
|
261 | 261 | |
262 | - // Add theme-specific settings. |
|
263 | - switch ($theme) { |
|
262 | + // Add theme-specific settings. |
|
263 | + switch ($theme) { |
|
264 | 264 | case 'advanced': |
265 | 265 | $settings += array( |
266 | 266 | 'theme_advanced_resize_horizontal' => FALSE, |
@@ -269,36 +269,36 @@ discard block |
||
269 | 269 | 'theme_advanced_resizing' => isset($config['resizing']) ? $config['resizing'] : 1, |
270 | 270 | 'theme_advanced_toolbar_location' => isset($config['toolbar_loc']) ? $config['toolbar_loc'] : 'top', |
271 | 271 | 'theme_advanced_toolbar_align' => isset($config['toolbar_align']) ? $config['toolbar_align'] : 'left', |
272 | - ); |
|
273 | - if (isset($config['block_formats'])) { |
|
272 | + ); |
|
273 | + if (isset($config['block_formats'])) { |
|
274 | 274 | $settings['theme_advanced_blockformats'] = $config['block_formats']; |
275 | - } |
|
276 | - if (isset($settings['buttons'])) { |
|
275 | + } |
|
276 | + if (isset($settings['buttons'])) { |
|
277 | 277 | // These rows explicitly need to be set to be empty, otherwise TinyMCE |
278 | 278 | // loads its default buttons of the advanced theme for each row. |
279 | 279 | $settings += array( |
280 | - 'theme_advanced_buttons1' => array(), |
|
281 | - 'theme_advanced_buttons2' => array(), |
|
282 | - 'theme_advanced_buttons3' => array(), |
|
280 | + 'theme_advanced_buttons1' => array(), |
|
281 | + 'theme_advanced_buttons2' => array(), |
|
282 | + 'theme_advanced_buttons3' => array(), |
|
283 | 283 | ); |
284 | 284 | // @todo Allow to sort/arrange editor buttons. |
285 | 285 | for ($i = 0; $i < count($settings['buttons']); $i++) { |
286 | - $settings['theme_advanced_buttons1'][] = $settings['buttons'][$i]; |
|
286 | + $settings['theme_advanced_buttons1'][] = $settings['buttons'][$i]; |
|
287 | 287 | } |
288 | - } |
|
289 | - break; |
|
290 | - } |
|
291 | - unset($settings['buttons']); |
|
288 | + } |
|
289 | + break; |
|
290 | + } |
|
291 | + unset($settings['buttons']); |
|
292 | 292 | |
293 | - // Convert the config values into the form expected by TinyMCE. |
|
294 | - $csv_settings = array('plugins', 'extended_valid_elements', 'theme_advanced_buttons1', 'theme_advanced_buttons2', 'theme_advanced_buttons3'); |
|
295 | - foreach ($csv_settings as $key) { |
|
293 | + // Convert the config values into the form expected by TinyMCE. |
|
294 | + $csv_settings = array('plugins', 'extended_valid_elements', 'theme_advanced_buttons1', 'theme_advanced_buttons2', 'theme_advanced_buttons3'); |
|
295 | + foreach ($csv_settings as $key) { |
|
296 | 296 | if (isset($settings[$key]) && is_array($settings[$key])) { |
297 | - $settings[$key] = implode(',', $settings[$key]); |
|
297 | + $settings[$key] = implode(',', $settings[$key]); |
|
298 | + } |
|
298 | 299 | } |
299 | - } |
|
300 | 300 | |
301 | - return $settings; |
|
301 | + return $settings; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
@@ -308,46 +308,46 @@ discard block |
||
308 | 308 | * directory) are loaded (once) upon initializing the editor. |
309 | 309 | */ |
310 | 310 | function wysiwyg_tinymce_plugin_settings($editor, $profile, $plugins) { |
311 | - $settings = array(); |
|
312 | - foreach ($plugins as $name => $plugin) { |
|
311 | + $settings = array(); |
|
312 | + foreach ($plugins as $name => $plugin) { |
|
313 | 313 | if (!empty($plugin['load'])) { |
314 | - // Add path for native external plugins; internal ones are loaded |
|
315 | - // automatically. |
|
316 | - if (empty($plugin['internal']) && isset($plugin['path'])) { |
|
314 | + // Add path for native external plugins; internal ones are loaded |
|
315 | + // automatically. |
|
316 | + if (empty($plugin['internal']) && isset($plugin['path'])) { |
|
317 | 317 | // TinyMCE plugins commonly use the filename editor_plugin.js, but there |
318 | 318 | // is no default. Previously, Wysiwyg's API documentation suggested to |
319 | 319 | // have the 'path' contain the 'filename' property, so if 'filename' is |
320 | 320 | // not defined, automatically extract it from 'path' for backwards |
321 | 321 | // compatibility. |
322 | 322 | if (!isset($plugin['filename'])) { |
323 | - $parts = explode('/', $plugin['path']); |
|
324 | - $plugin['filename'] = array_pop($parts); |
|
325 | - $plugin['path'] = implode('/', $parts); |
|
323 | + $parts = explode('/', $plugin['path']); |
|
324 | + $plugin['filename'] = array_pop($parts); |
|
325 | + $plugin['path'] = implode('/', $parts); |
|
326 | 326 | } |
327 | 327 | $settings[$name] = base_path() . $plugin['path'] . '/' . $plugin['filename']; |
328 | - } |
|
328 | + } |
|
329 | 329 | } |
330 | - } |
|
331 | - return $settings; |
|
330 | + } |
|
331 | + return $settings; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
335 | 335 | * Build a JS settings array for Drupal plugins loaded via the proxy plugin. |
336 | 336 | */ |
337 | 337 | function wysiwyg_tinymce_proxy_plugin_settings($editor, $profile, $plugins) { |
338 | - $settings = array(); |
|
339 | - foreach ($plugins as $name => $plugin) { |
|
338 | + $settings = array(); |
|
339 | + foreach ($plugins as $name => $plugin) { |
|
340 | 340 | // Populate required plugin settings. |
341 | 341 | $settings[$name] = $plugin['dialog settings'] + array( |
342 | - 'title' => $plugin['title'], |
|
343 | - 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
344 | - 'iconTitle' => $plugin['icon title'], |
|
342 | + 'title' => $plugin['title'], |
|
343 | + 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
344 | + 'iconTitle' => $plugin['icon title'], |
|
345 | 345 | ); |
346 | 346 | if (isset($plugin['css file'])) { |
347 | - $settings[$name]['css'] = base_path() . $plugin['css path'] . '/' . $plugin['css file']; |
|
347 | + $settings[$name]['css'] = base_path() . $plugin['css path'] . '/' . $plugin['css file']; |
|
348 | 348 | } |
349 | - } |
|
350 | - return $settings; |
|
349 | + } |
|
350 | + return $settings; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -362,28 +362,28 @@ discard block |
||
362 | 362 | * A plugin name. |
363 | 363 | */ |
364 | 364 | function _wysiwyg_tinymce_plugin_name($op, $name) { |
365 | - if ($op == 'add') { |
|
365 | + if ($op == 'add') { |
|
366 | 366 | if (strpos($name, '-') !== 0) { |
367 | - return '-' . $name; |
|
367 | + return '-' . $name; |
|
368 | 368 | } |
369 | 369 | return $name; |
370 | - } |
|
371 | - else if ($op == 'remove') { |
|
370 | + } |
|
371 | + else if ($op == 'remove') { |
|
372 | 372 | if (strpos($name, '-') === 0) { |
373 | - return substr($name, 1); |
|
373 | + return substr($name, 1); |
|
374 | 374 | } |
375 | 375 | return $name; |
376 | - } |
|
376 | + } |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | /** |
380 | 380 | * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
381 | 381 | */ |
382 | 382 | function wysiwyg_tinymce_plugins($editor) { |
383 | - $plugins = array( |
|
383 | + $plugins = array( |
|
384 | 384 | 'default' => array( |
385 | - 'path' => $editor['library path'] . '/themes/advanced', |
|
386 | - 'buttons' => array( |
|
385 | + 'path' => $editor['library path'] . '/themes/advanced', |
|
386 | + 'buttons' => array( |
|
387 | 387 | 'bold' => t('Bold'), 'italic' => t('Italic'), 'underline' => t('Underline'), |
388 | 388 | 'strikethrough' => t('Strike-through'), |
389 | 389 | 'justifyleft' => t('Align left'), 'justifycenter' => t('Align center'), 'justifyright' => t('Align right'), 'justifyfull' => t('Justify'), |
@@ -402,217 +402,217 @@ discard block |
||
402 | 402 | 'removeformat' => t('Remove format'), |
403 | 403 | 'charmap' => t('Character map'), |
404 | 404 | 'help' => t('Help'), |
405 | - ), |
|
406 | - 'internal' => TRUE, |
|
405 | + ), |
|
406 | + 'internal' => TRUE, |
|
407 | 407 | ), |
408 | 408 | 'advhr' => array( |
409 | - 'path' => $editor['library path'] . '/plugins/advhr', |
|
410 | - 'buttons' => array('advhr' => t('Advanced horizontal rule')), |
|
411 | - 'extended_valid_elements' => array('hr[class|width|size|noshade]'), |
|
412 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', |
|
413 | - 'internal' => TRUE, |
|
414 | - 'load' => TRUE, |
|
409 | + 'path' => $editor['library path'] . '/plugins/advhr', |
|
410 | + 'buttons' => array('advhr' => t('Advanced horizontal rule')), |
|
411 | + 'extended_valid_elements' => array('hr[class|width|size|noshade]'), |
|
412 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', |
|
413 | + 'internal' => TRUE, |
|
414 | + 'load' => TRUE, |
|
415 | 415 | ), |
416 | 416 | 'advimage' => array( |
417 | - 'path' => $editor['library path'] . '/plugins/advimage', |
|
418 | - 'extensions' => array('advimage' => t('Advanced image')), |
|
419 | - 'extended_valid_elements' => array('img[src|alt|title|align|width|height|usemap|hspace|vspace|border|style|class|onmouseover|onmouseout|id|name]'), |
|
420 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', |
|
421 | - 'internal' => TRUE, |
|
422 | - 'load' => TRUE, |
|
417 | + 'path' => $editor['library path'] . '/plugins/advimage', |
|
418 | + 'extensions' => array('advimage' => t('Advanced image')), |
|
419 | + 'extended_valid_elements' => array('img[src|alt|title|align|width|height|usemap|hspace|vspace|border|style|class|onmouseover|onmouseout|id|name]'), |
|
420 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', |
|
421 | + 'internal' => TRUE, |
|
422 | + 'load' => TRUE, |
|
423 | 423 | ), |
424 | 424 | 'advlink' => array( |
425 | - 'path' => $editor['library path'] . '/plugins/advlink', |
|
426 | - 'extensions' => array('advlink' => t('Advanced link')), |
|
427 | - 'extended_valid_elements' => array('a[name|href|target|title|class|onfocus|onblur|onclick|ondlbclick|onmousedown|onmouseup|onmouseover|onmouseout|onkeypress|onkeydown|onkeyup|id|style|rel]'), |
|
428 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', |
|
429 | - 'internal' => TRUE, |
|
430 | - 'load' => TRUE, |
|
425 | + 'path' => $editor['library path'] . '/plugins/advlink', |
|
426 | + 'extensions' => array('advlink' => t('Advanced link')), |
|
427 | + 'extended_valid_elements' => array('a[name|href|target|title|class|onfocus|onblur|onclick|ondlbclick|onmousedown|onmouseup|onmouseover|onmouseout|onkeypress|onkeydown|onkeyup|id|style|rel]'), |
|
428 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', |
|
429 | + 'internal' => TRUE, |
|
430 | + 'load' => TRUE, |
|
431 | 431 | ), |
432 | 432 | 'autosave' => array( |
433 | - 'path' => $editor['library path'] . '/plugins/autosave', |
|
434 | - 'extensions' => array('autosave' => t('Auto save')), |
|
435 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', |
|
436 | - 'internal' => TRUE, |
|
437 | - 'load' => TRUE, |
|
433 | + 'path' => $editor['library path'] . '/plugins/autosave', |
|
434 | + 'extensions' => array('autosave' => t('Auto save')), |
|
435 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', |
|
436 | + 'internal' => TRUE, |
|
437 | + 'load' => TRUE, |
|
438 | 438 | ), |
439 | 439 | 'contextmenu' => array( |
440 | - 'path' => $editor['library path'] . '/plugins/contextmenu', |
|
441 | - 'extensions' => array('contextmenu' => t('Context menu')), |
|
442 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', |
|
443 | - 'internal' => TRUE, |
|
444 | - 'load' => TRUE, |
|
440 | + 'path' => $editor['library path'] . '/plugins/contextmenu', |
|
441 | + 'extensions' => array('contextmenu' => t('Context menu')), |
|
442 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', |
|
443 | + 'internal' => TRUE, |
|
444 | + 'load' => TRUE, |
|
445 | 445 | ), |
446 | 446 | 'directionality' => array( |
447 | - 'path' => $editor['library path'] . '/plugins/directionality', |
|
448 | - 'buttons' => array('ltr' => t('Left-to-right'), 'rtl' => t('Right-to-left')), |
|
449 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', |
|
450 | - 'internal' => TRUE, |
|
451 | - 'load' => TRUE, |
|
447 | + 'path' => $editor['library path'] . '/plugins/directionality', |
|
448 | + 'buttons' => array('ltr' => t('Left-to-right'), 'rtl' => t('Right-to-left')), |
|
449 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', |
|
450 | + 'internal' => TRUE, |
|
451 | + 'load' => TRUE, |
|
452 | 452 | ), |
453 | 453 | 'emotions' => array( |
454 | - 'path' => $editor['library path'] . '/plugins/emotions', |
|
455 | - 'buttons' => array('emotions' => t('Emotions')), |
|
456 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', |
|
457 | - 'internal' => TRUE, |
|
458 | - 'load' => TRUE, |
|
454 | + 'path' => $editor['library path'] . '/plugins/emotions', |
|
455 | + 'buttons' => array('emotions' => t('Emotions')), |
|
456 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', |
|
457 | + 'internal' => TRUE, |
|
458 | + 'load' => TRUE, |
|
459 | 459 | ), |
460 | 460 | 'font' => array( |
461 | - 'path' => $editor['library path'] . '/plugins/font', |
|
462 | - 'buttons' => array('formatselect' => t('HTML block format'), 'fontselect' => t('Font'), 'fontsizeselect' => t('Font size'), 'styleselect' => t('Font style')), |
|
463 | - 'extended_valid_elements' => array('font[face|size|color|style],span[class|align|style]'), |
|
464 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/font', |
|
465 | - 'internal' => TRUE, |
|
461 | + 'path' => $editor['library path'] . '/plugins/font', |
|
462 | + 'buttons' => array('formatselect' => t('HTML block format'), 'fontselect' => t('Font'), 'fontsizeselect' => t('Font size'), 'styleselect' => t('Font style')), |
|
463 | + 'extended_valid_elements' => array('font[face|size|color|style],span[class|align|style]'), |
|
464 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/font', |
|
465 | + 'internal' => TRUE, |
|
466 | 466 | ), |
467 | 467 | 'fullscreen' => array( |
468 | - 'path' => $editor['library path'] . '/plugins/fullscreen', |
|
469 | - 'buttons' => array('fullscreen' => t('Fullscreen')), |
|
470 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', |
|
471 | - 'internal' => TRUE, |
|
472 | - 'load' => TRUE, |
|
468 | + 'path' => $editor['library path'] . '/plugins/fullscreen', |
|
469 | + 'buttons' => array('fullscreen' => t('Fullscreen')), |
|
470 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', |
|
471 | + 'internal' => TRUE, |
|
472 | + 'load' => TRUE, |
|
473 | 473 | ), |
474 | 474 | 'inlinepopups' => array( |
475 | - 'path' => $editor['library path'] . '/plugins/inlinepopups', |
|
476 | - 'extensions' => array('inlinepopups' => t('Inline popups')), |
|
477 | - 'options' => array( |
|
475 | + 'path' => $editor['library path'] . '/plugins/inlinepopups', |
|
476 | + 'extensions' => array('inlinepopups' => t('Inline popups')), |
|
477 | + 'options' => array( |
|
478 | 478 | 'dialog_type' => array('modal'), |
479 | - ), |
|
480 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', |
|
481 | - 'internal' => TRUE, |
|
482 | - 'load' => TRUE, |
|
479 | + ), |
|
480 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', |
|
481 | + 'internal' => TRUE, |
|
482 | + 'load' => TRUE, |
|
483 | 483 | ), |
484 | 484 | 'insertdatetime' => array( |
485 | - 'path' => $editor['library path'] . '/plugins/insertdatetime', |
|
486 | - 'buttons' => array('insertdate' => t('Insert date'), 'inserttime' => t('Insert time')), |
|
487 | - 'options' => array( |
|
485 | + 'path' => $editor['library path'] . '/plugins/insertdatetime', |
|
486 | + 'buttons' => array('insertdate' => t('Insert date'), 'inserttime' => t('Insert time')), |
|
487 | + 'options' => array( |
|
488 | 488 | 'plugin_insertdate_dateFormat' => '%Y-%m-%d', |
489 | 489 | 'plugin_insertdate_timeFormat' => '%H:%M:%S', |
490 | - ), |
|
491 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', |
|
492 | - 'internal' => TRUE, |
|
493 | - 'load' => TRUE, |
|
490 | + ), |
|
491 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', |
|
492 | + 'internal' => TRUE, |
|
493 | + 'load' => TRUE, |
|
494 | 494 | ), |
495 | 495 | 'layer' => array( |
496 | - 'path' => $editor['library path'] . '/plugins/layer', |
|
497 | - 'buttons' => array('insertlayer' => t('Insert layer'), 'moveforward' => t('Move forward'), 'movebackward' => t('Move backward'), 'absolute' => t('Absolute')), |
|
498 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', |
|
499 | - 'internal' => TRUE, |
|
500 | - 'load' => TRUE, |
|
496 | + 'path' => $editor['library path'] . '/plugins/layer', |
|
497 | + 'buttons' => array('insertlayer' => t('Insert layer'), 'moveforward' => t('Move forward'), 'movebackward' => t('Move backward'), 'absolute' => t('Absolute')), |
|
498 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', |
|
499 | + 'internal' => TRUE, |
|
500 | + 'load' => TRUE, |
|
501 | 501 | ), |
502 | 502 | 'paste' => array( |
503 | - 'path' => $editor['library path'] . '/plugins/paste', |
|
504 | - 'buttons' => array('pastetext' => t('Paste text'), 'pasteword' => t('Paste from Word'), 'selectall' => t('Select all')), |
|
505 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', |
|
506 | - 'internal' => TRUE, |
|
507 | - 'load' => TRUE, |
|
503 | + 'path' => $editor['library path'] . '/plugins/paste', |
|
504 | + 'buttons' => array('pastetext' => t('Paste text'), 'pasteword' => t('Paste from Word'), 'selectall' => t('Select all')), |
|
505 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', |
|
506 | + 'internal' => TRUE, |
|
507 | + 'load' => TRUE, |
|
508 | 508 | ), |
509 | 509 | 'preview' => array( |
510 | - 'path' => $editor['library path'] . '/plugins/preview', |
|
511 | - 'buttons' => array('preview' => t('Preview')), |
|
512 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', |
|
513 | - 'internal' => TRUE, |
|
514 | - 'load' => TRUE, |
|
510 | + 'path' => $editor['library path'] . '/plugins/preview', |
|
511 | + 'buttons' => array('preview' => t('Preview')), |
|
512 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', |
|
513 | + 'internal' => TRUE, |
|
514 | + 'load' => TRUE, |
|
515 | 515 | ), |
516 | 516 | 'print' => array( |
517 | - 'path' => $editor['library path'] . '/plugins/print', |
|
518 | - 'buttons' => array('print' => t('Print')), |
|
519 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', |
|
520 | - 'internal' => TRUE, |
|
521 | - 'load' => TRUE, |
|
517 | + 'path' => $editor['library path'] . '/plugins/print', |
|
518 | + 'buttons' => array('print' => t('Print')), |
|
519 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', |
|
520 | + 'internal' => TRUE, |
|
521 | + 'load' => TRUE, |
|
522 | 522 | ), |
523 | 523 | 'searchreplace' => array( |
524 | - 'path' => $editor['library path'] . '/plugins/searchreplace', |
|
525 | - 'buttons' => array('search' => t('Search'), 'replace' => t('Replace')), |
|
526 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', |
|
527 | - 'internal' => TRUE, |
|
528 | - 'load' => TRUE, |
|
524 | + 'path' => $editor['library path'] . '/plugins/searchreplace', |
|
525 | + 'buttons' => array('search' => t('Search'), 'replace' => t('Replace')), |
|
526 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', |
|
527 | + 'internal' => TRUE, |
|
528 | + 'load' => TRUE, |
|
529 | 529 | ), |
530 | 530 | 'style' => array( |
531 | - 'path' => $editor['library path'] . '/plugins/style', |
|
532 | - 'buttons' => array('styleprops' => t('Style properties')), |
|
533 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', |
|
534 | - 'internal' => TRUE, |
|
535 | - 'load' => TRUE, |
|
531 | + 'path' => $editor['library path'] . '/plugins/style', |
|
532 | + 'buttons' => array('styleprops' => t('Style properties')), |
|
533 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', |
|
534 | + 'internal' => TRUE, |
|
535 | + 'load' => TRUE, |
|
536 | 536 | ), |
537 | 537 | 'table' => array( |
538 | - 'path' => $editor['library path'] . '/plugins/table', |
|
539 | - 'buttons' => array('tablecontrols' => t('Table')), |
|
540 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', |
|
541 | - 'internal' => TRUE, |
|
542 | - 'load' => TRUE, |
|
538 | + 'path' => $editor['library path'] . '/plugins/table', |
|
539 | + 'buttons' => array('tablecontrols' => t('Table')), |
|
540 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', |
|
541 | + 'internal' => TRUE, |
|
542 | + 'load' => TRUE, |
|
543 | 543 | ), |
544 | - ); |
|
545 | - if (version_compare($editor['installed version'], '3', '<')) { |
|
544 | + ); |
|
545 | + if (version_compare($editor['installed version'], '3', '<')) { |
|
546 | 546 | $plugins['flash'] = array( |
547 | - 'path' => $editor['library path'] . '/plugins/flash', |
|
548 | - 'buttons' => array('flash' => t('Flash')), |
|
549 | - 'extended_valid_elements' => array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|obj|param|embed]'), |
|
550 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash', |
|
551 | - 'internal' => TRUE, |
|
552 | - 'load' => TRUE, |
|
547 | + 'path' => $editor['library path'] . '/plugins/flash', |
|
548 | + 'buttons' => array('flash' => t('Flash')), |
|
549 | + 'extended_valid_elements' => array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|obj|param|embed]'), |
|
550 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash', |
|
551 | + 'internal' => TRUE, |
|
552 | + 'load' => TRUE, |
|
553 | 553 | ); |
554 | - } |
|
555 | - if (version_compare($editor['installed version'], '2.0.6', '>')) { |
|
554 | + } |
|
555 | + if (version_compare($editor['installed version'], '2.0.6', '>')) { |
|
556 | 556 | $plugins['media'] = array( |
557 | - 'path' => $editor['library path'] . '/plugins/media', |
|
558 | - 'buttons' => array('media' => t('Media')), |
|
559 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', |
|
560 | - 'internal' => TRUE, |
|
561 | - 'load' => TRUE, |
|
557 | + 'path' => $editor['library path'] . '/plugins/media', |
|
558 | + 'buttons' => array('media' => t('Media')), |
|
559 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', |
|
560 | + 'internal' => TRUE, |
|
561 | + 'load' => TRUE, |
|
562 | 562 | ); |
563 | 563 | $plugins['xhtmlxtras'] = array( |
564 | - 'path' => $editor['library path'] . '/plugins/xhtmlxtras', |
|
565 | - 'buttons' => array('cite' => t('Citation'), 'del' => t('Deleted'), 'abbr' => t('Abbreviation'), 'acronym' => t('Acronym'), 'ins' => t('Inserted'), 'attribs' => t('HTML attributes')), |
|
566 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', |
|
567 | - 'internal' => TRUE, |
|
568 | - 'load' => TRUE, |
|
564 | + 'path' => $editor['library path'] . '/plugins/xhtmlxtras', |
|
565 | + 'buttons' => array('cite' => t('Citation'), 'del' => t('Deleted'), 'abbr' => t('Abbreviation'), 'acronym' => t('Acronym'), 'ins' => t('Inserted'), 'attribs' => t('HTML attributes')), |
|
566 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', |
|
567 | + 'internal' => TRUE, |
|
568 | + 'load' => TRUE, |
|
569 | 569 | ); |
570 | - } |
|
571 | - if (version_compare($editor['installed version'], '3', '>')) { |
|
570 | + } |
|
571 | + if (version_compare($editor['installed version'], '3', '>')) { |
|
572 | 572 | $plugins['bbcode'] = array( |
573 | - 'path' => $editor['library path'] . '/plugins/bbcode', |
|
574 | - 'extensions' => array('bbcode' => t('BBCode')), |
|
575 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', |
|
576 | - 'internal' => TRUE, |
|
577 | - 'load' => TRUE, |
|
573 | + 'path' => $editor['library path'] . '/plugins/bbcode', |
|
574 | + 'extensions' => array('bbcode' => t('BBCode')), |
|
575 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', |
|
576 | + 'internal' => TRUE, |
|
577 | + 'load' => TRUE, |
|
578 | 578 | ); |
579 | 579 | if (version_compare($editor['installed version'], '3.3', '<')) { |
580 | - $plugins['safari'] = array( |
|
580 | + $plugins['safari'] = array( |
|
581 | 581 | 'path' => $editor['library path'] . '/plugins/safari', |
582 | 582 | 'extensions' => array('safari' => t('Safari compatibility')), |
583 | 583 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', |
584 | 584 | 'internal' => TRUE, |
585 | 585 | 'load' => TRUE, |
586 | - ); |
|
586 | + ); |
|
587 | 587 | } |
588 | - } |
|
589 | - if (version_compare($editor['installed version'], '3.2.5', '>=')) { |
|
588 | + } |
|
589 | + if (version_compare($editor['installed version'], '3.2.5', '>=')) { |
|
590 | 590 | $plugins['autoresize'] = array( |
591 | - 'path' => $editor['library path'] . '/plugins/autoresize', |
|
592 | - 'extensions' => array('autoresize' => t('Auto resize')), |
|
593 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', |
|
594 | - 'internal' => TRUE, |
|
595 | - 'load' => TRUE, |
|
591 | + 'path' => $editor['library path'] . '/plugins/autoresize', |
|
592 | + 'extensions' => array('autoresize' => t('Auto resize')), |
|
593 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', |
|
594 | + 'internal' => TRUE, |
|
595 | + 'load' => TRUE, |
|
596 | 596 | ); |
597 | - } |
|
598 | - if (version_compare($editor['installed version'], '3.3', '>=')) { |
|
597 | + } |
|
598 | + if (version_compare($editor['installed version'], '3.3', '>=')) { |
|
599 | 599 | $plugins['advlist'] = array( |
600 | - 'path' => $editor['library path'] . '/plugins/advlist', |
|
601 | - 'extensions' => array('advlist' => t('Advanced list')), |
|
602 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', |
|
603 | - 'internal' => TRUE, |
|
604 | - 'load' => TRUE, |
|
600 | + 'path' => $editor['library path'] . '/plugins/advlist', |
|
601 | + 'extensions' => array('advlist' => t('Advanced list')), |
|
602 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', |
|
603 | + 'internal' => TRUE, |
|
604 | + 'load' => TRUE, |
|
605 | 605 | ); |
606 | - } |
|
607 | - if (version_compare($editor['installed version'], '3.2.6', '>=')) { |
|
606 | + } |
|
607 | + if (version_compare($editor['installed version'], '3.2.6', '>=')) { |
|
608 | 608 | $plugins['wordcount'] = array( |
609 | - 'path' => $editor['library path'] . '/plugins/wordcount', |
|
610 | - 'extensions' => array('wordcount' => t('Word count')), |
|
611 | - 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', |
|
612 | - 'internal' => TRUE, |
|
613 | - 'load' => TRUE, |
|
609 | + 'path' => $editor['library path'] . '/plugins/wordcount', |
|
610 | + 'extensions' => array('wordcount' => t('Word count')), |
|
611 | + 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', |
|
612 | + 'internal' => TRUE, |
|
613 | + 'load' => TRUE, |
|
614 | 614 | ); |
615 | - } |
|
616 | - return $plugins; |
|
615 | + } |
|
616 | + return $plugins; |
|
617 | 617 | } |
618 | 618 |
@@ -261,32 +261,32 @@ |
||
261 | 261 | |
262 | 262 | // Add theme-specific settings. |
263 | 263 | switch ($theme) { |
264 | - case 'advanced': |
|
264 | + case 'advanced': |
|
265 | + $settings += array( |
|
266 | + 'theme_advanced_resize_horizontal' => FALSE, |
|
267 | + 'theme_advanced_resizing_use_cookie' => FALSE, |
|
268 | + 'theme_advanced_path_location' => isset($config['path_loc']) ? $config['path_loc'] : 'bottom', |
|
269 | + 'theme_advanced_resizing' => isset($config['resizing']) ? $config['resizing'] : 1, |
|
270 | + 'theme_advanced_toolbar_location' => isset($config['toolbar_loc']) ? $config['toolbar_loc'] : 'top', |
|
271 | + 'theme_advanced_toolbar_align' => isset($config['toolbar_align']) ? $config['toolbar_align'] : 'left', |
|
272 | + ); |
|
273 | + if (isset($config['block_formats'])) { |
|
274 | + $settings['theme_advanced_blockformats'] = $config['block_formats']; |
|
275 | + } |
|
276 | + if (isset($settings['buttons'])) { |
|
277 | + // These rows explicitly need to be set to be empty, otherwise TinyMCE |
|
278 | + // loads its default buttons of the advanced theme for each row. |
|
265 | 279 | $settings += array( |
266 | - 'theme_advanced_resize_horizontal' => FALSE, |
|
267 | - 'theme_advanced_resizing_use_cookie' => FALSE, |
|
268 | - 'theme_advanced_path_location' => isset($config['path_loc']) ? $config['path_loc'] : 'bottom', |
|
269 | - 'theme_advanced_resizing' => isset($config['resizing']) ? $config['resizing'] : 1, |
|
270 | - 'theme_advanced_toolbar_location' => isset($config['toolbar_loc']) ? $config['toolbar_loc'] : 'top', |
|
271 | - 'theme_advanced_toolbar_align' => isset($config['toolbar_align']) ? $config['toolbar_align'] : 'left', |
|
280 | + 'theme_advanced_buttons1' => array(), |
|
281 | + 'theme_advanced_buttons2' => array(), |
|
282 | + 'theme_advanced_buttons3' => array(), |
|
272 | 283 | ); |
273 | - if (isset($config['block_formats'])) { |
|
274 | - $settings['theme_advanced_blockformats'] = $config['block_formats']; |
|
284 | + // @todo Allow to sort/arrange editor buttons. |
|
285 | + for ($i = 0; $i < count($settings['buttons']); $i++) { |
|
286 | + $settings['theme_advanced_buttons1'][] = $settings['buttons'][$i]; |
|
275 | 287 | } |
276 | - if (isset($settings['buttons'])) { |
|
277 | - // These rows explicitly need to be set to be empty, otherwise TinyMCE |
|
278 | - // loads its default buttons of the advanced theme for each row. |
|
279 | - $settings += array( |
|
280 | - 'theme_advanced_buttons1' => array(), |
|
281 | - 'theme_advanced_buttons2' => array(), |
|
282 | - 'theme_advanced_buttons3' => array(), |
|
283 | - ); |
|
284 | - // @todo Allow to sort/arrange editor buttons. |
|
285 | - for ($i = 0; $i < count($settings['buttons']); $i++) { |
|
286 | - $settings['theme_advanced_buttons1'][] = $settings['buttons'][$i]; |
|
287 | - } |
|
288 | - } |
|
289 | - break; |
|
288 | + } |
|
289 | + break; |
|
290 | 290 | } |
291 | 291 | unset($settings['buttons']); |
292 | 292 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | 'title' => 'TinyMCE', |
16 | 16 | 'vendor url' => 'http://tinymce.moxiecode.com', |
17 | 17 | 'download url' => 'http://tinymce.moxiecode.com/download.php', |
18 | - 'library path' => wysiwyg_get_path('tinymce') . '/jscripts/tiny_mce', |
|
18 | + 'library path' => wysiwyg_get_path('tinymce').'/jscripts/tiny_mce', |
|
19 | 19 | 'libraries' => array( |
20 | 20 | '' => array( |
21 | 21 | 'title' => 'Minified', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * The installed editor version. |
81 | 81 | */ |
82 | 82 | function wysiwyg_tinymce_version($editor) { |
83 | - $script = $editor['library path'] . '/tiny_mce.js'; |
|
83 | + $script = $editor['library path'].'/tiny_mce.js'; |
|
84 | 84 | if (!file_exists($script)) { |
85 | 85 | return; |
86 | 86 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | // 2.x: this.majorVersion="2";this.minorVersion="1.3" |
92 | 92 | // 3.x: majorVersion:'3',minorVersion:'2.0.1' |
93 | 93 | if (preg_match('@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@', $line, $version)) { |
94 | - return $version[1] . '.' . $version[2]; |
|
94 | + return $version[1].'.'.$version[2]; |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $settings['remove_linebreaks'] = $config['remove_linebreaks']; |
179 | 179 | } |
180 | 180 | if (isset($config['verify_html'])) { |
181 | - $settings['verify_html'] = (bool) $config['verify_html']; |
|
181 | + $settings['verify_html'] = (bool)$config['verify_html']; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | if (!empty($config['css_classes'])) { |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $plugin['filename'] = array_pop($parts); |
325 | 325 | $plugin['path'] = implode('/', $parts); |
326 | 326 | } |
327 | - $settings[$name] = base_path() . $plugin['path'] . '/' . $plugin['filename']; |
|
327 | + $settings[$name] = base_path().$plugin['path'].'/'.$plugin['filename']; |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | } |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | // Populate required plugin settings. |
341 | 341 | $settings[$name] = $plugin['dialog settings'] + array( |
342 | 342 | 'title' => $plugin['title'], |
343 | - 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
343 | + 'icon' => base_path().$plugin['icon path'].'/'.$plugin['icon file'], |
|
344 | 344 | 'iconTitle' => $plugin['icon title'], |
345 | 345 | ); |
346 | 346 | if (isset($plugin['css file'])) { |
347 | - $settings[$name]['css'] = base_path() . $plugin['css path'] . '/' . $plugin['css file']; |
|
347 | + $settings[$name]['css'] = base_path().$plugin['css path'].'/'.$plugin['css file']; |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | return $settings; |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | function _wysiwyg_tinymce_plugin_name($op, $name) { |
365 | 365 | if ($op == 'add') { |
366 | 366 | if (strpos($name, '-') !== 0) { |
367 | - return '-' . $name; |
|
367 | + return '-'.$name; |
|
368 | 368 | } |
369 | 369 | return $name; |
370 | 370 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | function wysiwyg_tinymce_plugins($editor) { |
383 | 383 | $plugins = array( |
384 | 384 | 'default' => array( |
385 | - 'path' => $editor['library path'] . '/themes/advanced', |
|
385 | + 'path' => $editor['library path'].'/themes/advanced', |
|
386 | 386 | 'buttons' => array( |
387 | 387 | 'bold' => t('Bold'), 'italic' => t('Italic'), 'underline' => t('Underline'), |
388 | 388 | 'strikethrough' => t('Strike-through'), |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | 'internal' => TRUE, |
407 | 407 | ), |
408 | 408 | 'advhr' => array( |
409 | - 'path' => $editor['library path'] . '/plugins/advhr', |
|
409 | + 'path' => $editor['library path'].'/plugins/advhr', |
|
410 | 410 | 'buttons' => array('advhr' => t('Advanced horizontal rule')), |
411 | 411 | 'extended_valid_elements' => array('hr[class|width|size|noshade]'), |
412 | 412 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | 'load' => TRUE, |
415 | 415 | ), |
416 | 416 | 'advimage' => array( |
417 | - 'path' => $editor['library path'] . '/plugins/advimage', |
|
417 | + 'path' => $editor['library path'].'/plugins/advimage', |
|
418 | 418 | 'extensions' => array('advimage' => t('Advanced image')), |
419 | 419 | 'extended_valid_elements' => array('img[src|alt|title|align|width|height|usemap|hspace|vspace|border|style|class|onmouseover|onmouseout|id|name]'), |
420 | 420 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | 'load' => TRUE, |
423 | 423 | ), |
424 | 424 | 'advlink' => array( |
425 | - 'path' => $editor['library path'] . '/plugins/advlink', |
|
425 | + 'path' => $editor['library path'].'/plugins/advlink', |
|
426 | 426 | 'extensions' => array('advlink' => t('Advanced link')), |
427 | 427 | 'extended_valid_elements' => array('a[name|href|target|title|class|onfocus|onblur|onclick|ondlbclick|onmousedown|onmouseup|onmouseover|onmouseout|onkeypress|onkeydown|onkeyup|id|style|rel]'), |
428 | 428 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', |
@@ -430,49 +430,49 @@ discard block |
||
430 | 430 | 'load' => TRUE, |
431 | 431 | ), |
432 | 432 | 'autosave' => array( |
433 | - 'path' => $editor['library path'] . '/plugins/autosave', |
|
433 | + 'path' => $editor['library path'].'/plugins/autosave', |
|
434 | 434 | 'extensions' => array('autosave' => t('Auto save')), |
435 | 435 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', |
436 | 436 | 'internal' => TRUE, |
437 | 437 | 'load' => TRUE, |
438 | 438 | ), |
439 | 439 | 'contextmenu' => array( |
440 | - 'path' => $editor['library path'] . '/plugins/contextmenu', |
|
440 | + 'path' => $editor['library path'].'/plugins/contextmenu', |
|
441 | 441 | 'extensions' => array('contextmenu' => t('Context menu')), |
442 | 442 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', |
443 | 443 | 'internal' => TRUE, |
444 | 444 | 'load' => TRUE, |
445 | 445 | ), |
446 | 446 | 'directionality' => array( |
447 | - 'path' => $editor['library path'] . '/plugins/directionality', |
|
447 | + 'path' => $editor['library path'].'/plugins/directionality', |
|
448 | 448 | 'buttons' => array('ltr' => t('Left-to-right'), 'rtl' => t('Right-to-left')), |
449 | 449 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', |
450 | 450 | 'internal' => TRUE, |
451 | 451 | 'load' => TRUE, |
452 | 452 | ), |
453 | 453 | 'emotions' => array( |
454 | - 'path' => $editor['library path'] . '/plugins/emotions', |
|
454 | + 'path' => $editor['library path'].'/plugins/emotions', |
|
455 | 455 | 'buttons' => array('emotions' => t('Emotions')), |
456 | 456 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', |
457 | 457 | 'internal' => TRUE, |
458 | 458 | 'load' => TRUE, |
459 | 459 | ), |
460 | 460 | 'font' => array( |
461 | - 'path' => $editor['library path'] . '/plugins/font', |
|
461 | + 'path' => $editor['library path'].'/plugins/font', |
|
462 | 462 | 'buttons' => array('formatselect' => t('HTML block format'), 'fontselect' => t('Font'), 'fontsizeselect' => t('Font size'), 'styleselect' => t('Font style')), |
463 | 463 | 'extended_valid_elements' => array('font[face|size|color|style],span[class|align|style]'), |
464 | 464 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/font', |
465 | 465 | 'internal' => TRUE, |
466 | 466 | ), |
467 | 467 | 'fullscreen' => array( |
468 | - 'path' => $editor['library path'] . '/plugins/fullscreen', |
|
468 | + 'path' => $editor['library path'].'/plugins/fullscreen', |
|
469 | 469 | 'buttons' => array('fullscreen' => t('Fullscreen')), |
470 | 470 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', |
471 | 471 | 'internal' => TRUE, |
472 | 472 | 'load' => TRUE, |
473 | 473 | ), |
474 | 474 | 'inlinepopups' => array( |
475 | - 'path' => $editor['library path'] . '/plugins/inlinepopups', |
|
475 | + 'path' => $editor['library path'].'/plugins/inlinepopups', |
|
476 | 476 | 'extensions' => array('inlinepopups' => t('Inline popups')), |
477 | 477 | 'options' => array( |
478 | 478 | 'dialog_type' => array('modal'), |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | 'load' => TRUE, |
483 | 483 | ), |
484 | 484 | 'insertdatetime' => array( |
485 | - 'path' => $editor['library path'] . '/plugins/insertdatetime', |
|
485 | + 'path' => $editor['library path'].'/plugins/insertdatetime', |
|
486 | 486 | 'buttons' => array('insertdate' => t('Insert date'), 'inserttime' => t('Insert time')), |
487 | 487 | 'options' => array( |
488 | 488 | 'plugin_insertdate_dateFormat' => '%Y-%m-%d', |
@@ -493,49 +493,49 @@ discard block |
||
493 | 493 | 'load' => TRUE, |
494 | 494 | ), |
495 | 495 | 'layer' => array( |
496 | - 'path' => $editor['library path'] . '/plugins/layer', |
|
496 | + 'path' => $editor['library path'].'/plugins/layer', |
|
497 | 497 | 'buttons' => array('insertlayer' => t('Insert layer'), 'moveforward' => t('Move forward'), 'movebackward' => t('Move backward'), 'absolute' => t('Absolute')), |
498 | 498 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', |
499 | 499 | 'internal' => TRUE, |
500 | 500 | 'load' => TRUE, |
501 | 501 | ), |
502 | 502 | 'paste' => array( |
503 | - 'path' => $editor['library path'] . '/plugins/paste', |
|
503 | + 'path' => $editor['library path'].'/plugins/paste', |
|
504 | 504 | 'buttons' => array('pastetext' => t('Paste text'), 'pasteword' => t('Paste from Word'), 'selectall' => t('Select all')), |
505 | 505 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', |
506 | 506 | 'internal' => TRUE, |
507 | 507 | 'load' => TRUE, |
508 | 508 | ), |
509 | 509 | 'preview' => array( |
510 | - 'path' => $editor['library path'] . '/plugins/preview', |
|
510 | + 'path' => $editor['library path'].'/plugins/preview', |
|
511 | 511 | 'buttons' => array('preview' => t('Preview')), |
512 | 512 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', |
513 | 513 | 'internal' => TRUE, |
514 | 514 | 'load' => TRUE, |
515 | 515 | ), |
516 | 516 | 'print' => array( |
517 | - 'path' => $editor['library path'] . '/plugins/print', |
|
517 | + 'path' => $editor['library path'].'/plugins/print', |
|
518 | 518 | 'buttons' => array('print' => t('Print')), |
519 | 519 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', |
520 | 520 | 'internal' => TRUE, |
521 | 521 | 'load' => TRUE, |
522 | 522 | ), |
523 | 523 | 'searchreplace' => array( |
524 | - 'path' => $editor['library path'] . '/plugins/searchreplace', |
|
524 | + 'path' => $editor['library path'].'/plugins/searchreplace', |
|
525 | 525 | 'buttons' => array('search' => t('Search'), 'replace' => t('Replace')), |
526 | 526 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', |
527 | 527 | 'internal' => TRUE, |
528 | 528 | 'load' => TRUE, |
529 | 529 | ), |
530 | 530 | 'style' => array( |
531 | - 'path' => $editor['library path'] . '/plugins/style', |
|
531 | + 'path' => $editor['library path'].'/plugins/style', |
|
532 | 532 | 'buttons' => array('styleprops' => t('Style properties')), |
533 | 533 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', |
534 | 534 | 'internal' => TRUE, |
535 | 535 | 'load' => TRUE, |
536 | 536 | ), |
537 | 537 | 'table' => array( |
538 | - 'path' => $editor['library path'] . '/plugins/table', |
|
538 | + 'path' => $editor['library path'].'/plugins/table', |
|
539 | 539 | 'buttons' => array('tablecontrols' => t('Table')), |
540 | 540 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', |
541 | 541 | 'internal' => TRUE, |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | ); |
545 | 545 | if (version_compare($editor['installed version'], '3', '<')) { |
546 | 546 | $plugins['flash'] = array( |
547 | - 'path' => $editor['library path'] . '/plugins/flash', |
|
547 | + 'path' => $editor['library path'].'/plugins/flash', |
|
548 | 548 | 'buttons' => array('flash' => t('Flash')), |
549 | 549 | 'extended_valid_elements' => array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|obj|param|embed]'), |
550 | 550 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash', |
@@ -554,14 +554,14 @@ discard block |
||
554 | 554 | } |
555 | 555 | if (version_compare($editor['installed version'], '2.0.6', '>')) { |
556 | 556 | $plugins['media'] = array( |
557 | - 'path' => $editor['library path'] . '/plugins/media', |
|
557 | + 'path' => $editor['library path'].'/plugins/media', |
|
558 | 558 | 'buttons' => array('media' => t('Media')), |
559 | 559 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', |
560 | 560 | 'internal' => TRUE, |
561 | 561 | 'load' => TRUE, |
562 | 562 | ); |
563 | 563 | $plugins['xhtmlxtras'] = array( |
564 | - 'path' => $editor['library path'] . '/plugins/xhtmlxtras', |
|
564 | + 'path' => $editor['library path'].'/plugins/xhtmlxtras', |
|
565 | 565 | 'buttons' => array('cite' => t('Citation'), 'del' => t('Deleted'), 'abbr' => t('Abbreviation'), 'acronym' => t('Acronym'), 'ins' => t('Inserted'), 'attribs' => t('HTML attributes')), |
566 | 566 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', |
567 | 567 | 'internal' => TRUE, |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | } |
571 | 571 | if (version_compare($editor['installed version'], '3', '>')) { |
572 | 572 | $plugins['bbcode'] = array( |
573 | - 'path' => $editor['library path'] . '/plugins/bbcode', |
|
573 | + 'path' => $editor['library path'].'/plugins/bbcode', |
|
574 | 574 | 'extensions' => array('bbcode' => t('BBCode')), |
575 | 575 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', |
576 | 576 | 'internal' => TRUE, |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | ); |
579 | 579 | if (version_compare($editor['installed version'], '3.3', '<')) { |
580 | 580 | $plugins['safari'] = array( |
581 | - 'path' => $editor['library path'] . '/plugins/safari', |
|
581 | + 'path' => $editor['library path'].'/plugins/safari', |
|
582 | 582 | 'extensions' => array('safari' => t('Safari compatibility')), |
583 | 583 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', |
584 | 584 | 'internal' => TRUE, |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | } |
589 | 589 | if (version_compare($editor['installed version'], '3.2.5', '>=')) { |
590 | 590 | $plugins['autoresize'] = array( |
591 | - 'path' => $editor['library path'] . '/plugins/autoresize', |
|
591 | + 'path' => $editor['library path'].'/plugins/autoresize', |
|
592 | 592 | 'extensions' => array('autoresize' => t('Auto resize')), |
593 | 593 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', |
594 | 594 | 'internal' => TRUE, |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | } |
598 | 598 | if (version_compare($editor['installed version'], '3.3', '>=')) { |
599 | 599 | $plugins['advlist'] = array( |
600 | - 'path' => $editor['library path'] . '/plugins/advlist', |
|
600 | + 'path' => $editor['library path'].'/plugins/advlist', |
|
601 | 601 | 'extensions' => array('advlist' => t('Advanced list')), |
602 | 602 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', |
603 | 603 | 'internal' => TRUE, |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | } |
607 | 607 | if (version_compare($editor['installed version'], '3.2.6', '>=')) { |
608 | 608 | $plugins['wordcount'] = array( |
609 | - 'path' => $editor['library path'] . '/plugins/wordcount', |
|
609 | + 'path' => $editor['library path'].'/plugins/wordcount', |
|
610 | 610 | 'extensions' => array('wordcount' => t('Word count')), |
611 | 611 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', |
612 | 612 | 'internal' => TRUE, |
@@ -188,8 +188,7 @@ discard block |
||
188 | 188 | if (isset($config['css_setting'])) { |
189 | 189 | if ($config['css_setting'] == 'theme') { |
190 | 190 | $settings['content_css'] = implode(',', wysiwyg_get_css()); |
191 | - } |
|
192 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
191 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
193 | 192 | $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
194 | 193 | } |
195 | 194 | } |
@@ -367,8 +366,7 @@ discard block |
||
367 | 366 | return '-' . $name; |
368 | 367 | } |
369 | 368 | return $name; |
370 | - } |
|
371 | - else if ($op == 'remove') { |
|
369 | + } else if ($op == 'remove') { |
|
372 | 370 | if (strpos($name, '-') === 0) { |
373 | 371 | return substr($name, 1); |
374 | 372 | } |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | 'plugin settings callback' => 'wysiwyg_tinymce_plugin_settings', |
34 | 34 | 'proxy plugin' => array( |
35 | 35 | 'drupal' => array( |
36 | - 'load' => TRUE, |
|
37 | - 'proxy' => TRUE, |
|
36 | + 'load' => true, |
|
37 | + 'proxy' => true, |
|
38 | 38 | ), |
39 | 39 | ), |
40 | 40 | 'proxy plugin settings callback' => 'wysiwyg_tinymce_proxy_plugin_settings', |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | '' => array( |
53 | 53 | 'title' => 'Minified', |
54 | 54 | 'files' => array( |
55 | - 'tiny_mce.js' => array('preprocess' => FALSE), |
|
55 | + 'tiny_mce.js' => array('preprocess' => false), |
|
56 | 56 | ), |
57 | 57 | ), |
58 | 58 | 'jquery' => array( |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | function wysiwyg_tinymce_settings($editor, $config, $theme) { |
143 | 143 | $settings = array( |
144 | - 'button_tile_map' => TRUE, // @todo Add a setting for this. |
|
144 | + 'button_tile_map' => true, // @todo Add a setting for this. |
|
145 | 145 | 'document_base_url' => base_path(), |
146 | 146 | 'mode' => 'none', |
147 | 147 | 'plugins' => array(), |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | 'width' => '100%', |
150 | 150 | // Strict loading mode must be enabled; otherwise TinyMCE would use |
151 | 151 | // document.write() in IE and Chrome. |
152 | - 'strict_loading_mode' => TRUE, |
|
152 | + 'strict_loading_mode' => true, |
|
153 | 153 | // TinyMCE's URL conversion magic breaks Drupal modules that use a special |
154 | 154 | // syntax for paths. This makes 'relative_urls' obsolete. |
155 | - 'convert_urls' => FALSE, |
|
155 | + 'convert_urls' => false, |
|
156 | 156 | // The default entity_encoding ('named') converts too many characters in |
157 | 157 | // languages (like Greek). Since Drupal supports Unicode, we only convert |
158 | 158 | // HTML control characters and invisible characters. TinyMCE always converts |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | switch ($theme) { |
264 | 264 | case 'advanced': |
265 | 265 | $settings += array( |
266 | - 'theme_advanced_resize_horizontal' => FALSE, |
|
267 | - 'theme_advanced_resizing_use_cookie' => FALSE, |
|
266 | + 'theme_advanced_resize_horizontal' => false, |
|
267 | + 'theme_advanced_resizing_use_cookie' => false, |
|
268 | 268 | 'theme_advanced_path_location' => isset($config['path_loc']) ? $config['path_loc'] : 'bottom', |
269 | 269 | 'theme_advanced_resizing' => isset($config['resizing']) ? $config['resizing'] : 1, |
270 | 270 | 'theme_advanced_toolbar_location' => isset($config['toolbar_loc']) ? $config['toolbar_loc'] : 'top', |
@@ -403,73 +403,73 @@ discard block |
||
403 | 403 | 'charmap' => t('Character map'), |
404 | 404 | 'help' => t('Help'), |
405 | 405 | ), |
406 | - 'internal' => TRUE, |
|
406 | + 'internal' => true, |
|
407 | 407 | ), |
408 | 408 | 'advhr' => array( |
409 | 409 | 'path' => $editor['library path'] . '/plugins/advhr', |
410 | 410 | 'buttons' => array('advhr' => t('Advanced horizontal rule')), |
411 | 411 | 'extended_valid_elements' => array('hr[class|width|size|noshade]'), |
412 | 412 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', |
413 | - 'internal' => TRUE, |
|
414 | - 'load' => TRUE, |
|
413 | + 'internal' => true, |
|
414 | + 'load' => true, |
|
415 | 415 | ), |
416 | 416 | 'advimage' => array( |
417 | 417 | 'path' => $editor['library path'] . '/plugins/advimage', |
418 | 418 | 'extensions' => array('advimage' => t('Advanced image')), |
419 | 419 | 'extended_valid_elements' => array('img[src|alt|title|align|width|height|usemap|hspace|vspace|border|style|class|onmouseover|onmouseout|id|name]'), |
420 | 420 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', |
421 | - 'internal' => TRUE, |
|
422 | - 'load' => TRUE, |
|
421 | + 'internal' => true, |
|
422 | + 'load' => true, |
|
423 | 423 | ), |
424 | 424 | 'advlink' => array( |
425 | 425 | 'path' => $editor['library path'] . '/plugins/advlink', |
426 | 426 | 'extensions' => array('advlink' => t('Advanced link')), |
427 | 427 | 'extended_valid_elements' => array('a[name|href|target|title|class|onfocus|onblur|onclick|ondlbclick|onmousedown|onmouseup|onmouseover|onmouseout|onkeypress|onkeydown|onkeyup|id|style|rel]'), |
428 | 428 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', |
429 | - 'internal' => TRUE, |
|
430 | - 'load' => TRUE, |
|
429 | + 'internal' => true, |
|
430 | + 'load' => true, |
|
431 | 431 | ), |
432 | 432 | 'autosave' => array( |
433 | 433 | 'path' => $editor['library path'] . '/plugins/autosave', |
434 | 434 | 'extensions' => array('autosave' => t('Auto save')), |
435 | 435 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', |
436 | - 'internal' => TRUE, |
|
437 | - 'load' => TRUE, |
|
436 | + 'internal' => true, |
|
437 | + 'load' => true, |
|
438 | 438 | ), |
439 | 439 | 'contextmenu' => array( |
440 | 440 | 'path' => $editor['library path'] . '/plugins/contextmenu', |
441 | 441 | 'extensions' => array('contextmenu' => t('Context menu')), |
442 | 442 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', |
443 | - 'internal' => TRUE, |
|
444 | - 'load' => TRUE, |
|
443 | + 'internal' => true, |
|
444 | + 'load' => true, |
|
445 | 445 | ), |
446 | 446 | 'directionality' => array( |
447 | 447 | 'path' => $editor['library path'] . '/plugins/directionality', |
448 | 448 | 'buttons' => array('ltr' => t('Left-to-right'), 'rtl' => t('Right-to-left')), |
449 | 449 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', |
450 | - 'internal' => TRUE, |
|
451 | - 'load' => TRUE, |
|
450 | + 'internal' => true, |
|
451 | + 'load' => true, |
|
452 | 452 | ), |
453 | 453 | 'emotions' => array( |
454 | 454 | 'path' => $editor['library path'] . '/plugins/emotions', |
455 | 455 | 'buttons' => array('emotions' => t('Emotions')), |
456 | 456 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', |
457 | - 'internal' => TRUE, |
|
458 | - 'load' => TRUE, |
|
457 | + 'internal' => true, |
|
458 | + 'load' => true, |
|
459 | 459 | ), |
460 | 460 | 'font' => array( |
461 | 461 | 'path' => $editor['library path'] . '/plugins/font', |
462 | 462 | 'buttons' => array('formatselect' => t('HTML block format'), 'fontselect' => t('Font'), 'fontsizeselect' => t('Font size'), 'styleselect' => t('Font style')), |
463 | 463 | 'extended_valid_elements' => array('font[face|size|color|style],span[class|align|style]'), |
464 | 464 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/font', |
465 | - 'internal' => TRUE, |
|
465 | + 'internal' => true, |
|
466 | 466 | ), |
467 | 467 | 'fullscreen' => array( |
468 | 468 | 'path' => $editor['library path'] . '/plugins/fullscreen', |
469 | 469 | 'buttons' => array('fullscreen' => t('Fullscreen')), |
470 | 470 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', |
471 | - 'internal' => TRUE, |
|
472 | - 'load' => TRUE, |
|
471 | + 'internal' => true, |
|
472 | + 'load' => true, |
|
473 | 473 | ), |
474 | 474 | 'inlinepopups' => array( |
475 | 475 | 'path' => $editor['library path'] . '/plugins/inlinepopups', |
@@ -478,8 +478,8 @@ discard block |
||
478 | 478 | 'dialog_type' => array('modal'), |
479 | 479 | ), |
480 | 480 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', |
481 | - 'internal' => TRUE, |
|
482 | - 'load' => TRUE, |
|
481 | + 'internal' => true, |
|
482 | + 'load' => true, |
|
483 | 483 | ), |
484 | 484 | 'insertdatetime' => array( |
485 | 485 | 'path' => $editor['library path'] . '/plugins/insertdatetime', |
@@ -489,57 +489,57 @@ discard block |
||
489 | 489 | 'plugin_insertdate_timeFormat' => '%H:%M:%S', |
490 | 490 | ), |
491 | 491 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', |
492 | - 'internal' => TRUE, |
|
493 | - 'load' => TRUE, |
|
492 | + 'internal' => true, |
|
493 | + 'load' => true, |
|
494 | 494 | ), |
495 | 495 | 'layer' => array( |
496 | 496 | 'path' => $editor['library path'] . '/plugins/layer', |
497 | 497 | 'buttons' => array('insertlayer' => t('Insert layer'), 'moveforward' => t('Move forward'), 'movebackward' => t('Move backward'), 'absolute' => t('Absolute')), |
498 | 498 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', |
499 | - 'internal' => TRUE, |
|
500 | - 'load' => TRUE, |
|
499 | + 'internal' => true, |
|
500 | + 'load' => true, |
|
501 | 501 | ), |
502 | 502 | 'paste' => array( |
503 | 503 | 'path' => $editor['library path'] . '/plugins/paste', |
504 | 504 | 'buttons' => array('pastetext' => t('Paste text'), 'pasteword' => t('Paste from Word'), 'selectall' => t('Select all')), |
505 | 505 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', |
506 | - 'internal' => TRUE, |
|
507 | - 'load' => TRUE, |
|
506 | + 'internal' => true, |
|
507 | + 'load' => true, |
|
508 | 508 | ), |
509 | 509 | 'preview' => array( |
510 | 510 | 'path' => $editor['library path'] . '/plugins/preview', |
511 | 511 | 'buttons' => array('preview' => t('Preview')), |
512 | 512 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', |
513 | - 'internal' => TRUE, |
|
514 | - 'load' => TRUE, |
|
513 | + 'internal' => true, |
|
514 | + 'load' => true, |
|
515 | 515 | ), |
516 | 516 | 'print' => array( |
517 | 517 | 'path' => $editor['library path'] . '/plugins/print', |
518 | 518 | 'buttons' => array('print' => t('Print')), |
519 | 519 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', |
520 | - 'internal' => TRUE, |
|
521 | - 'load' => TRUE, |
|
520 | + 'internal' => true, |
|
521 | + 'load' => true, |
|
522 | 522 | ), |
523 | 523 | 'searchreplace' => array( |
524 | 524 | 'path' => $editor['library path'] . '/plugins/searchreplace', |
525 | 525 | 'buttons' => array('search' => t('Search'), 'replace' => t('Replace')), |
526 | 526 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', |
527 | - 'internal' => TRUE, |
|
528 | - 'load' => TRUE, |
|
527 | + 'internal' => true, |
|
528 | + 'load' => true, |
|
529 | 529 | ), |
530 | 530 | 'style' => array( |
531 | 531 | 'path' => $editor['library path'] . '/plugins/style', |
532 | 532 | 'buttons' => array('styleprops' => t('Style properties')), |
533 | 533 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', |
534 | - 'internal' => TRUE, |
|
535 | - 'load' => TRUE, |
|
534 | + 'internal' => true, |
|
535 | + 'load' => true, |
|
536 | 536 | ), |
537 | 537 | 'table' => array( |
538 | 538 | 'path' => $editor['library path'] . '/plugins/table', |
539 | 539 | 'buttons' => array('tablecontrols' => t('Table')), |
540 | 540 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', |
541 | - 'internal' => TRUE, |
|
542 | - 'load' => TRUE, |
|
541 | + 'internal' => true, |
|
542 | + 'load' => true, |
|
543 | 543 | ), |
544 | 544 | ); |
545 | 545 | if (version_compare($editor['installed version'], '3', '<')) { |
@@ -548,8 +548,8 @@ discard block |
||
548 | 548 | 'buttons' => array('flash' => t('Flash')), |
549 | 549 | 'extended_valid_elements' => array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|obj|param|embed]'), |
550 | 550 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash', |
551 | - 'internal' => TRUE, |
|
552 | - 'load' => TRUE, |
|
551 | + 'internal' => true, |
|
552 | + 'load' => true, |
|
553 | 553 | ); |
554 | 554 | } |
555 | 555 | if (version_compare($editor['installed version'], '2.0.6', '>')) { |
@@ -557,15 +557,15 @@ discard block |
||
557 | 557 | 'path' => $editor['library path'] . '/plugins/media', |
558 | 558 | 'buttons' => array('media' => t('Media')), |
559 | 559 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', |
560 | - 'internal' => TRUE, |
|
561 | - 'load' => TRUE, |
|
560 | + 'internal' => true, |
|
561 | + 'load' => true, |
|
562 | 562 | ); |
563 | 563 | $plugins['xhtmlxtras'] = array( |
564 | 564 | 'path' => $editor['library path'] . '/plugins/xhtmlxtras', |
565 | 565 | 'buttons' => array('cite' => t('Citation'), 'del' => t('Deleted'), 'abbr' => t('Abbreviation'), 'acronym' => t('Acronym'), 'ins' => t('Inserted'), 'attribs' => t('HTML attributes')), |
566 | 566 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', |
567 | - 'internal' => TRUE, |
|
568 | - 'load' => TRUE, |
|
567 | + 'internal' => true, |
|
568 | + 'load' => true, |
|
569 | 569 | ); |
570 | 570 | } |
571 | 571 | if (version_compare($editor['installed version'], '3', '>')) { |
@@ -573,16 +573,16 @@ discard block |
||
573 | 573 | 'path' => $editor['library path'] . '/plugins/bbcode', |
574 | 574 | 'extensions' => array('bbcode' => t('BBCode')), |
575 | 575 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', |
576 | - 'internal' => TRUE, |
|
577 | - 'load' => TRUE, |
|
576 | + 'internal' => true, |
|
577 | + 'load' => true, |
|
578 | 578 | ); |
579 | 579 | if (version_compare($editor['installed version'], '3.3', '<')) { |
580 | 580 | $plugins['safari'] = array( |
581 | 581 | 'path' => $editor['library path'] . '/plugins/safari', |
582 | 582 | 'extensions' => array('safari' => t('Safari compatibility')), |
583 | 583 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', |
584 | - 'internal' => TRUE, |
|
585 | - 'load' => TRUE, |
|
584 | + 'internal' => true, |
|
585 | + 'load' => true, |
|
586 | 586 | ); |
587 | 587 | } |
588 | 588 | } |
@@ -591,8 +591,8 @@ discard block |
||
591 | 591 | 'path' => $editor['library path'] . '/plugins/autoresize', |
592 | 592 | 'extensions' => array('autoresize' => t('Auto resize')), |
593 | 593 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', |
594 | - 'internal' => TRUE, |
|
595 | - 'load' => TRUE, |
|
594 | + 'internal' => true, |
|
595 | + 'load' => true, |
|
596 | 596 | ); |
597 | 597 | } |
598 | 598 | if (version_compare($editor['installed version'], '3.3', '>=')) { |
@@ -600,8 +600,8 @@ discard block |
||
600 | 600 | 'path' => $editor['library path'] . '/plugins/advlist', |
601 | 601 | 'extensions' => array('advlist' => t('Advanced list')), |
602 | 602 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', |
603 | - 'internal' => TRUE, |
|
604 | - 'load' => TRUE, |
|
603 | + 'internal' => true, |
|
604 | + 'load' => true, |
|
605 | 605 | ); |
606 | 606 | } |
607 | 607 | if (version_compare($editor['installed version'], '3.2.6', '>=')) { |
@@ -609,8 +609,8 @@ discard block |
||
609 | 609 | 'path' => $editor['library path'] . '/plugins/wordcount', |
610 | 610 | 'extensions' => array('wordcount' => t('Word count')), |
611 | 611 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', |
612 | - 'internal' => TRUE, |
|
613 | - 'load' => TRUE, |
|
612 | + 'internal' => true, |
|
613 | + 'load' => true, |
|
614 | 614 | ); |
615 | 615 | } |
616 | 616 | return $plugins; |
@@ -44,7 +44,7 @@ |
||
44 | 44 | * An array containing editor properties as returned from hook_editor(). |
45 | 45 | * |
46 | 46 | * @return |
47 | - * The installed editor version. |
|
47 | + null|string The installed editor version. |
|
48 | 48 | */ |
49 | 49 | function wysiwyg_whizzywig_version($editor) { |
50 | 50 | $script = $editor['library path'] . '/whizzywig.js'; |
@@ -9,32 +9,32 @@ discard block |
||
9 | 9 | * Plugin implementation of hook_editor(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_whizzywig_editor() { |
12 | - $editor['whizzywig'] = array( |
|
12 | + $editor['whizzywig'] = array( |
|
13 | 13 | 'title' => 'Whizzywig', |
14 | 14 | 'vendor url' => 'http://www.unverse.net', |
15 | 15 | 'download url' => 'http://www.unverse.net/whizzywig-download.html', |
16 | 16 | 'libraries' => array( |
17 | - '' => array( |
|
17 | + '' => array( |
|
18 | 18 | 'title' => 'Default', |
19 | 19 | 'files' => array('whizzywig.js', 'xhtml.js'), |
20 | - ), |
|
20 | + ), |
|
21 | 21 | ), |
22 | 22 | 'version callback' => 'wysiwyg_whizzywig_version', |
23 | 23 | 'settings callback' => 'wysiwyg_whizzywig_settings', |
24 | 24 | 'plugin callback' => 'wysiwyg_whizzywig_plugins', |
25 | 25 | 'versions' => array( |
26 | - '55' => array( |
|
26 | + '55' => array( |
|
27 | 27 | 'js files' => array('whizzywig.js'), |
28 | - ), |
|
29 | - '56' => array( |
|
28 | + ), |
|
29 | + '56' => array( |
|
30 | 30 | 'js files' => array('whizzywig-56.js'), |
31 | - ), |
|
32 | - '60' => array( |
|
31 | + ), |
|
32 | + '60' => array( |
|
33 | 33 | 'js files' => array('whizzywig-60.js'), |
34 | - ), |
|
34 | + ), |
|
35 | 35 | ), |
36 | - ); |
|
37 | - return $editor; |
|
36 | + ); |
|
37 | + return $editor; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,19 +47,19 @@ discard block |
||
47 | 47 | * The installed editor version. |
48 | 48 | */ |
49 | 49 | function wysiwyg_whizzywig_version($editor) { |
50 | - $script = $editor['library path'] . '/whizzywig.js'; |
|
51 | - if (!file_exists($script)) { |
|
50 | + $script = $editor['library path'] . '/whizzywig.js'; |
|
51 | + if (!file_exists($script)) { |
|
52 | 52 | return; |
53 | - } |
|
54 | - $script = fopen($script, 'r'); |
|
55 | - $line = fgets($script, 43); |
|
56 | - // 55: Whizzywig v55i |
|
57 | - // 60: Whizzywig 60 |
|
58 | - if (preg_match('@Whizzywig v?([0-9]+)@', $line, $version)) { |
|
53 | + } |
|
54 | + $script = fopen($script, 'r'); |
|
55 | + $line = fgets($script, 43); |
|
56 | + // 55: Whizzywig v55i |
|
57 | + // 60: Whizzywig 60 |
|
58 | + if (preg_match('@Whizzywig v?([0-9]+)@', $line, $version)) { |
|
59 | 59 | fclose($script); |
60 | 60 | return $version[1]; |
61 | - } |
|
62 | - fclose($script); |
|
61 | + } |
|
62 | + fclose($script); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -77,53 +77,53 @@ discard block |
||
77 | 77 | * Drupal.settings.wysiwyg.configs.{editor} |
78 | 78 | */ |
79 | 79 | function wysiwyg_whizzywig_settings($editor, $config, $theme) { |
80 | - $settings = array(); |
|
80 | + $settings = array(); |
|
81 | 81 | |
82 | - // Add path to button images, if available. |
|
83 | - if (is_dir($editor['library path'] . '/btn')) { |
|
82 | + // Add path to button images, if available. |
|
83 | + if (is_dir($editor['library path'] . '/btn')) { |
|
84 | 84 | $settings['buttonPath'] = base_path() . $editor['library path'] . '/btn/'; |
85 | - } |
|
86 | - if (file_exists($editor['library path'] . '/WhizzywigToolbar.png')) { |
|
85 | + } |
|
86 | + if (file_exists($editor['library path'] . '/WhizzywigToolbar.png')) { |
|
87 | 87 | $settings['toolbarImagePath'] = base_path() . $editor['library path'] . '/WhizzywigToolbar.png'; |
88 | - } |
|
89 | - // Filename changed in version 60. |
|
90 | - elseif (file_exists($editor['library path'] . '/icons.png')) { |
|
88 | + } |
|
89 | + // Filename changed in version 60. |
|
90 | + elseif (file_exists($editor['library path'] . '/icons.png')) { |
|
91 | 91 | $settings['toolbarImagePath'] = base_path() . $editor['library path'] . '/icons.png'; |
92 | - } |
|
92 | + } |
|
93 | 93 | |
94 | - // Add configured buttons or all available. |
|
95 | - $settings['buttons'] = array(); |
|
96 | - if (!empty($config['buttons'])) { |
|
94 | + // Add configured buttons or all available. |
|
95 | + $settings['buttons'] = array(); |
|
96 | + if (!empty($config['buttons'])) { |
|
97 | 97 | $buttons = array(); |
98 | 98 | foreach ($config['buttons'] as $plugin) { |
99 | - $buttons = array_merge($buttons, $plugin); |
|
99 | + $buttons = array_merge($buttons, $plugin); |
|
100 | 100 | } |
101 | 101 | $settings['buttons'] = implode(' ', array_keys($buttons)); |
102 | - } |
|
102 | + } |
|
103 | 103 | |
104 | - // Add editor content stylesheet. |
|
105 | - if (isset($config['css_setting'])) { |
|
104 | + // Add editor content stylesheet. |
|
105 | + if (isset($config['css_setting'])) { |
|
106 | 106 | if ($config['css_setting'] == 'theme') { |
107 | - $css = path_to_theme() . '/style.css'; |
|
108 | - if (file_exists($css)) { |
|
107 | + $css = path_to_theme() . '/style.css'; |
|
108 | + if (file_exists($css)) { |
|
109 | 109 | $settings['externalCSS'] = base_path() . $css; |
110 | - } |
|
110 | + } |
|
111 | 111 | } |
112 | 112 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
113 | - $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
113 | + $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
114 | + } |
|
114 | 115 | } |
115 | - } |
|
116 | 116 | |
117 | - return $settings; |
|
117 | + return $settings; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | 121 | * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
122 | 122 | */ |
123 | 123 | function wysiwyg_whizzywig_plugins($editor) { |
124 | - return array( |
|
124 | + return array( |
|
125 | 125 | 'default' => array( |
126 | - 'buttons' => array( |
|
126 | + 'buttons' => array( |
|
127 | 127 | 'formatblock' => t('HTML block format'), 'fontname' => t('Font'), 'fontsize' => t('Font size'), |
128 | 128 | 'bold' => t('Bold'), 'italic' => t('Italic'), 'underline' => t('Underline'), |
129 | 129 | 'left' => t('Align left'), 'center' => t('Align center'), 'right' => t('Align right'), |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | 'clean' => t('Clean-up'), |
140 | 140 | 'html' => t('Source code'), |
141 | 141 | 'spellcheck' => t('Spell check'), |
142 | - ), |
|
143 | - 'internal' => TRUE, |
|
142 | + ), |
|
143 | + 'internal' => TRUE, |
|
144 | 144 | ), |
145 | - ); |
|
145 | + ); |
|
146 | 146 | } |
147 | 147 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * The installed editor version. |
48 | 48 | */ |
49 | 49 | function wysiwyg_whizzywig_version($editor) { |
50 | - $script = $editor['library path'] . '/whizzywig.js'; |
|
50 | + $script = $editor['library path'].'/whizzywig.js'; |
|
51 | 51 | if (!file_exists($script)) { |
52 | 52 | return; |
53 | 53 | } |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | $settings = array(); |
81 | 81 | |
82 | 82 | // Add path to button images, if available. |
83 | - if (is_dir($editor['library path'] . '/btn')) { |
|
84 | - $settings['buttonPath'] = base_path() . $editor['library path'] . '/btn/'; |
|
83 | + if (is_dir($editor['library path'].'/btn')) { |
|
84 | + $settings['buttonPath'] = base_path().$editor['library path'].'/btn/'; |
|
85 | 85 | } |
86 | - if (file_exists($editor['library path'] . '/WhizzywigToolbar.png')) { |
|
87 | - $settings['toolbarImagePath'] = base_path() . $editor['library path'] . '/WhizzywigToolbar.png'; |
|
86 | + if (file_exists($editor['library path'].'/WhizzywigToolbar.png')) { |
|
87 | + $settings['toolbarImagePath'] = base_path().$editor['library path'].'/WhizzywigToolbar.png'; |
|
88 | 88 | } |
89 | 89 | // Filename changed in version 60. |
90 | - elseif (file_exists($editor['library path'] . '/icons.png')) { |
|
91 | - $settings['toolbarImagePath'] = base_path() . $editor['library path'] . '/icons.png'; |
|
90 | + elseif (file_exists($editor['library path'].'/icons.png')) { |
|
91 | + $settings['toolbarImagePath'] = base_path().$editor['library path'].'/icons.png'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | // Add configured buttons or all available. |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | // Add editor content stylesheet. |
105 | 105 | if (isset($config['css_setting'])) { |
106 | 106 | if ($config['css_setting'] == 'theme') { |
107 | - $css = path_to_theme() . '/style.css'; |
|
107 | + $css = path_to_theme().'/style.css'; |
|
108 | 108 | if (file_exists($css)) { |
109 | - $settings['externalCSS'] = base_path() . $css; |
|
109 | + $settings['externalCSS'] = base_path().$css; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
@@ -108,8 +108,7 @@ |
||
108 | 108 | if (file_exists($css)) { |
109 | 109 | $settings['externalCSS'] = base_path() . $css; |
110 | 110 | } |
111 | - } |
|
112 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
111 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
113 | 112 | $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
114 | 113 | } |
115 | 114 | } |
@@ -140,7 +140,7 @@ |
||
140 | 140 | 'html' => t('Source code'), |
141 | 141 | 'spellcheck' => t('Spell check'), |
142 | 142 | ), |
143 | - 'internal' => TRUE, |
|
143 | + 'internal' => true, |
|
144 | 144 | ), |
145 | 145 | ); |
146 | 146 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * An array containing editor properties as returned from hook_editor(). |
49 | 49 | * |
50 | 50 | * @return |
51 | - * The installed editor version. |
|
51 | + null|string The installed editor version. |
|
52 | 52 | */ |
53 | 53 | function wysiwyg_wymeditor_version($editor) { |
54 | 54 | $script = $editor['library path'] . '/jquery.wymeditor.js'; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * A wysiwyg editor profile. |
75 | 75 | * |
76 | 76 | * @return |
77 | - * An array of theme names. The first returned name should be the default |
|
77 | + string[] An array of theme names. The first returned name should be the default |
|
78 | 78 | * theme name. |
79 | 79 | */ |
80 | 80 | function wysiwyg_wymeditor_themes($editor, $profile) { |
@@ -9,36 +9,36 @@ discard block |
||
9 | 9 | * Plugin implementation of hook_editor(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_wymeditor_editor() { |
12 | - $editor['wymeditor'] = array( |
|
12 | + $editor['wymeditor'] = array( |
|
13 | 13 | 'title' => 'WYMeditor', |
14 | 14 | 'vendor url' => 'http://www.wymeditor.org/', |
15 | 15 | 'download url' => 'http://www.wymeditor.org/download/', |
16 | 16 | 'library path' => wysiwyg_get_path('wymeditor') . '/wymeditor', |
17 | 17 | 'libraries' => array( |
18 | - 'min' => array( |
|
18 | + 'min' => array( |
|
19 | 19 | 'title' => 'Minified', |
20 | 20 | 'files' => array('jquery.wymeditor.min.js'), |
21 | - ), |
|
22 | - 'pack' => array( |
|
21 | + ), |
|
22 | + 'pack' => array( |
|
23 | 23 | 'title' => 'Packed', |
24 | 24 | 'files' => array('jquery.wymeditor.pack.js'), |
25 | - ), |
|
26 | - 'src' => array( |
|
25 | + ), |
|
26 | + 'src' => array( |
|
27 | 27 | 'title' => 'Source', |
28 | 28 | 'files' => array('jquery.wymeditor.js'), |
29 | - ), |
|
29 | + ), |
|
30 | 30 | ), |
31 | 31 | 'version callback' => 'wysiwyg_wymeditor_version', |
32 | 32 | 'themes callback' => 'wysiwyg_wymeditor_themes', |
33 | 33 | 'settings callback' => 'wysiwyg_wymeditor_settings', |
34 | 34 | 'plugin callback' => 'wysiwyg_wymeditor_plugins', |
35 | 35 | 'versions' => array( |
36 | - '0.5-rc1' => array( |
|
36 | + '0.5-rc1' => array( |
|
37 | 37 | 'js files' => array('wymeditor.js'), |
38 | - ), |
|
38 | + ), |
|
39 | 39 | ), |
40 | - ); |
|
41 | - return $editor; |
|
40 | + ); |
|
41 | + return $editor; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -51,18 +51,18 @@ discard block |
||
51 | 51 | * The installed editor version. |
52 | 52 | */ |
53 | 53 | function wysiwyg_wymeditor_version($editor) { |
54 | - $script = $editor['library path'] . '/jquery.wymeditor.js'; |
|
55 | - if (!file_exists($script)) { |
|
54 | + $script = $editor['library path'] . '/jquery.wymeditor.js'; |
|
55 | + if (!file_exists($script)) { |
|
56 | 56 | return; |
57 | - } |
|
58 | - $script = fopen($script, 'r'); |
|
59 | - fgets($script); |
|
60 | - $line = fgets($script); |
|
61 | - if (preg_match('@version\s+([0-9a-z\.-]+)@', $line, $version)) { |
|
57 | + } |
|
58 | + $script = fopen($script, 'r'); |
|
59 | + fgets($script); |
|
60 | + $line = fgets($script); |
|
61 | + if (preg_match('@version\s+([0-9a-z\.-]+)@', $line, $version)) { |
|
62 | 62 | fclose($script); |
63 | 63 | return $version[1]; |
64 | - } |
|
65 | - fclose($script); |
|
64 | + } |
|
65 | + fclose($script); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * theme name. |
79 | 79 | */ |
80 | 80 | function wysiwyg_wymeditor_themes($editor, $profile) { |
81 | - return array('compact', 'default', 'minimal', 'silver', 'twopanels'); |
|
81 | + return array('compact', 'default', 'minimal', 'silver', 'twopanels'); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -96,99 +96,99 @@ discard block |
||
96 | 96 | * Drupal.settings.wysiwyg.configs.{editor} |
97 | 97 | */ |
98 | 98 | function wysiwyg_wymeditor_settings($editor, $config, $theme) { |
99 | - // @todo Setup $library in wysiwyg_load_editor() already. |
|
100 | - $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries'])); |
|
101 | - $settings = array( |
|
99 | + // @todo Setup $library in wysiwyg_load_editor() already. |
|
100 | + $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries'])); |
|
101 | + $settings = array( |
|
102 | 102 | 'basePath' => base_path() . $editor['library path'] . '/', |
103 | 103 | 'wymPath' => $editor['libraries'][$library]['files'][0], |
104 | 104 | // @todo Does not work in Drupal; jQuery can live anywhere. |
105 | 105 | 'jQueryPath' => base_path() . 'misc/jquery.js', |
106 | 106 | 'updateSelector' => '.form-submit', |
107 | 107 | 'skin' => $theme, |
108 | - ); |
|
108 | + ); |
|
109 | 109 | |
110 | - if (isset($config['language'])) { |
|
110 | + if (isset($config['language'])) { |
|
111 | 111 | $settings['lang'] = $config['language']; |
112 | - } |
|
112 | + } |
|
113 | 113 | |
114 | - // Add configured buttons. |
|
115 | - $settings['toolsItems'] = array(); |
|
116 | - if (!empty($config['buttons'])) { |
|
114 | + // Add configured buttons. |
|
115 | + $settings['toolsItems'] = array(); |
|
116 | + if (!empty($config['buttons'])) { |
|
117 | 117 | $buttoninfo = _wysiwyg_wymeditor_button_info(); |
118 | 118 | $plugins = wysiwyg_get_plugins($editor['name']); |
119 | 119 | foreach ($config['buttons'] as $plugin => $buttons) { |
120 | - foreach ($buttons as $button => $enabled) { |
|
120 | + foreach ($buttons as $button => $enabled) { |
|
121 | 121 | // Iterate separately over buttons and extensions properties. |
122 | 122 | foreach (array('buttons', 'extensions') as $type) { |
123 | - // Skip unavailable plugins. |
|
124 | - if (!isset($plugins[$plugin][$type][$button])) { |
|
123 | + // Skip unavailable plugins. |
|
124 | + if (!isset($plugins[$plugin][$type][$button])) { |
|
125 | 125 | continue; |
126 | - } |
|
127 | - // Add buttons. |
|
128 | - if ($type == 'buttons') { |
|
126 | + } |
|
127 | + // Add buttons. |
|
128 | + if ($type == 'buttons') { |
|
129 | 129 | // Merge meta-data for internal default buttons. |
130 | 130 | if (isset($buttoninfo[$button])) { |
131 | - $buttoninfo[$button] += array('name' => $button); |
|
132 | - $settings['toolsItems'][] = $buttoninfo[$button]; |
|
131 | + $buttoninfo[$button] += array('name' => $button); |
|
132 | + $settings['toolsItems'][] = $buttoninfo[$button]; |
|
133 | 133 | } |
134 | 134 | // For custom buttons, try to provide a valid button definition. |
135 | 135 | else { |
136 | - $settings['toolsItems'][] = array( |
|
136 | + $settings['toolsItems'][] = array( |
|
137 | 137 | 'name' => $button, |
138 | 138 | 'title' => $plugins[$plugin][$type][$button], |
139 | 139 | 'css' => 'wym_tools_' . $button, |
140 | - ); |
|
140 | + ); |
|
141 | + } |
|
141 | 142 | } |
142 | - } |
|
143 | 143 | } |
144 | - } |
|
144 | + } |
|
145 | + } |
|
145 | 146 | } |
146 | - } |
|
147 | 147 | |
148 | - if (!empty($config['block_formats'])) { |
|
148 | + if (!empty($config['block_formats'])) { |
|
149 | 149 | $containers = array( |
150 | - 'p' => 'Paragraph', |
|
151 | - 'h1' => 'Heading_1', |
|
152 | - 'h2' => 'Heading_2', |
|
153 | - 'h3' => 'Heading_3', |
|
154 | - 'h4' => 'Heading_4', |
|
155 | - 'h5' => 'Heading_5', |
|
156 | - 'h6' => 'Heading_6', |
|
157 | - 'pre' => 'Preformatted', |
|
158 | - 'blockquote' => 'Blockquote', |
|
159 | - 'th' => 'Table_Header', |
|
150 | + 'p' => 'Paragraph', |
|
151 | + 'h1' => 'Heading_1', |
|
152 | + 'h2' => 'Heading_2', |
|
153 | + 'h3' => 'Heading_3', |
|
154 | + 'h4' => 'Heading_4', |
|
155 | + 'h5' => 'Heading_5', |
|
156 | + 'h6' => 'Heading_6', |
|
157 | + 'pre' => 'Preformatted', |
|
158 | + 'blockquote' => 'Blockquote', |
|
159 | + 'th' => 'Table_Header', |
|
160 | 160 | ); |
161 | 161 | foreach (explode(',', $config['block_formats']) as $tag) { |
162 | - if (isset($containers[$tag])) { |
|
162 | + if (isset($containers[$tag])) { |
|
163 | 163 | $settings['containersItems'][] = array( |
164 | - 'name' => strtoupper($tag), |
|
165 | - 'title' => $containers[$tag], |
|
166 | - 'css' => 'wym_containers_' . $tag, |
|
164 | + 'name' => strtoupper($tag), |
|
165 | + 'title' => $containers[$tag], |
|
166 | + 'css' => 'wym_containers_' . $tag, |
|
167 | 167 | ); |
168 | - } |
|
168 | + } |
|
169 | + } |
|
169 | 170 | } |
170 | - } |
|
171 | 171 | |
172 | - if (isset($config['css_setting'])) { |
|
172 | + if (isset($config['css_setting'])) { |
|
173 | 173 | if ($config['css_setting'] == 'theme') { |
174 | - // WYMeditor only supports one CSS file currently. |
|
175 | - $settings['stylesheet'] = reset(wysiwyg_get_css()); |
|
174 | + // WYMeditor only supports one CSS file currently. |
|
175 | + $settings['stylesheet'] = reset(wysiwyg_get_css()); |
|
176 | 176 | } |
177 | 177 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
178 | - $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
178 | + $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
|
179 | + } |
|
179 | 180 | } |
180 | - } |
|
181 | 181 | |
182 | - return $settings; |
|
182 | + return $settings; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
186 | 186 | * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). |
187 | 187 | */ |
188 | 188 | function wysiwyg_wymeditor_plugins($editor) { |
189 | - $plugins = array( |
|
189 | + $plugins = array( |
|
190 | 190 | 'default' => array( |
191 | - 'buttons' => array( |
|
191 | + 'buttons' => array( |
|
192 | 192 | 'Bold' => t('Bold'), 'Italic' => t('Italic'), |
193 | 193 | 'InsertOrderedList' => t('Bullet list'), 'InsertUnorderedList' => t('Numbered list'), |
194 | 194 | 'Outdent' => t('Outdent'), 'Indent' => t('Indent'), |
@@ -200,18 +200,18 @@ discard block |
||
200 | 200 | 'Paste' => t('Paste'), |
201 | 201 | 'InsertTable' => t('Table'), |
202 | 202 | 'Preview' => t('Preview'), |
203 | - ), |
|
204 | - 'internal' => TRUE, |
|
203 | + ), |
|
204 | + 'internal' => TRUE, |
|
205 | 205 | ), |
206 | - ); |
|
207 | - return $plugins; |
|
206 | + ); |
|
207 | + return $plugins; |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
211 | 211 | * Helper function to provide additional meta-data for internal default buttons. |
212 | 212 | */ |
213 | 213 | function _wysiwyg_wymeditor_button_info() { |
214 | - return array( |
|
214 | + return array( |
|
215 | 215 | 'Bold' => array('title'=> 'Strong', 'css'=> 'wym_tools_strong'), |
216 | 216 | 'Italic' => array('title'=> 'Emphasis', 'css'=> 'wym_tools_emphasis'), |
217 | 217 | 'Superscript' => array('title'=> 'Superscript', 'css'=> 'wym_tools_superscript'), |
@@ -229,5 +229,5 @@ discard block |
||
229 | 229 | 'Paste' => array('title'=> 'Paste_From_Word', 'css'=> 'wym_tools_paste'), |
230 | 230 | 'ToggleHtml' => array('title'=> 'HTML', 'css'=> 'wym_tools_html'), |
231 | 231 | 'Preview' => array('title'=> 'Preview', 'css'=> 'wym_tools_preview'), |
232 | - ); |
|
232 | + ); |
|
233 | 233 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | 'title' => 'WYMeditor', |
14 | 14 | 'vendor url' => 'http://www.wymeditor.org/', |
15 | 15 | 'download url' => 'http://www.wymeditor.org/download/', |
16 | - 'library path' => wysiwyg_get_path('wymeditor') . '/wymeditor', |
|
16 | + 'library path' => wysiwyg_get_path('wymeditor').'/wymeditor', |
|
17 | 17 | 'libraries' => array( |
18 | 18 | 'min' => array( |
19 | 19 | 'title' => 'Minified', |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * The installed editor version. |
52 | 52 | */ |
53 | 53 | function wysiwyg_wymeditor_version($editor) { |
54 | - $script = $editor['library path'] . '/jquery.wymeditor.js'; |
|
54 | + $script = $editor['library path'].'/jquery.wymeditor.js'; |
|
55 | 55 | if (!file_exists($script)) { |
56 | 56 | return; |
57 | 57 | } |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | // @todo Setup $library in wysiwyg_load_editor() already. |
100 | 100 | $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries'])); |
101 | 101 | $settings = array( |
102 | - 'basePath' => base_path() . $editor['library path'] . '/', |
|
102 | + 'basePath' => base_path().$editor['library path'].'/', |
|
103 | 103 | 'wymPath' => $editor['libraries'][$library]['files'][0], |
104 | 104 | // @todo Does not work in Drupal; jQuery can live anywhere. |
105 | - 'jQueryPath' => base_path() . 'misc/jquery.js', |
|
105 | + 'jQueryPath' => base_path().'misc/jquery.js', |
|
106 | 106 | 'updateSelector' => '.form-submit', |
107 | 107 | 'skin' => $theme, |
108 | 108 | ); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $settings['toolsItems'][] = array( |
137 | 137 | 'name' => $button, |
138 | 138 | 'title' => $plugins[$plugin][$type][$button], |
139 | - 'css' => 'wym_tools_' . $button, |
|
139 | + 'css' => 'wym_tools_'.$button, |
|
140 | 140 | ); |
141 | 141 | } |
142 | 142 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $settings['containersItems'][] = array( |
164 | 164 | 'name' => strtoupper($tag), |
165 | 165 | 'title' => $containers[$tag], |
166 | - 'css' => 'wym_containers_' . $tag, |
|
166 | + 'css' => 'wym_containers_'.$tag, |
|
167 | 167 | ); |
168 | 168 | } |
169 | 169 | } |
@@ -173,8 +173,7 @@ |
||
173 | 173 | if ($config['css_setting'] == 'theme') { |
174 | 174 | // WYMeditor only supports one CSS file currently. |
175 | 175 | $settings['stylesheet'] = reset(wysiwyg_get_css()); |
176 | - } |
|
177 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
176 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
178 | 177 | $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
179 | 178 | } |
180 | 179 | } |
@@ -201,7 +201,7 @@ |
||
201 | 201 | 'InsertTable' => t('Table'), |
202 | 202 | 'Preview' => t('Preview'), |
203 | 203 | ), |
204 | - 'internal' => TRUE, |
|
204 | + 'internal' => true, |
|
205 | 205 | ), |
206 | 206 | ); |
207 | 207 | return $plugins; |