@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | class content_negotiation_filter_handler extends views_handler_filter { |
4 | - function query() { |
|
4 | + function query() { |
|
5 | 5 | $this->ensure_my_table(); |
6 | 6 | $where = i18n_db_rewrite_where($this->table_alias, 'node'); |
7 | 7 | if (!empty($where)) { |
8 | - $this->query->add_where($this->options['group'], $where); |
|
8 | + $this->query->add_where($this->options['group'], $where); |
|
9 | + } |
|
9 | 10 | } |
10 | - } |
|
11 | 11 | |
12 | - function option_definition() { |
|
12 | + function option_definition() { |
|
13 | 13 | $options = parent::option_definition(); |
14 | 14 | $options['operator']['default'] = ''; |
15 | 15 | $options['value']['default'] = ''; |
16 | 16 | return $options; |
17 | - } |
|
17 | + } |
|
18 | 18 | } |
@@ -9,16 +9,16 @@ discard block |
||
9 | 9 | * Form builder for Wysiwyg profile form. |
10 | 10 | */ |
11 | 11 | function wysiwyg_profile_form($form_state, $profile) { |
12 | - // Merge in defaults. |
|
13 | - $profile = (array) $profile; |
|
14 | - $profile += array( |
|
12 | + // Merge in defaults. |
|
13 | + $profile = (array) $profile; |
|
14 | + $profile += array( |
|
15 | 15 | 'format' => 0, |
16 | 16 | 'editor' => '', |
17 | - ); |
|
18 | - if (empty($profile['settings'])) { |
|
17 | + ); |
|
18 | + if (empty($profile['settings'])) { |
|
19 | 19 | $profile['settings'] = array(); |
20 | - } |
|
21 | - $profile['settings'] += array( |
|
20 | + } |
|
21 | + $profile['settings'] += array( |
|
22 | 22 | 'default' => TRUE, |
23 | 23 | 'user_choose' => FALSE, |
24 | 24 | 'show_toggle' => TRUE, |
@@ -42,264 +42,264 @@ discard block |
||
42 | 42 | 'css_setting' => 'theme', |
43 | 43 | 'css_path' => NULL, |
44 | 44 | 'css_classes' => NULL, |
45 | - ); |
|
46 | - $profile = (object) $profile; |
|
45 | + ); |
|
46 | + $profile = (object) $profile; |
|
47 | 47 | |
48 | - $formats = filter_formats(); |
|
49 | - $editor = wysiwyg_get_editor($profile->editor); |
|
50 | - drupal_set_title(t('%editor profile for %format', array('%editor' => $editor['title'], '%format' => $formats[$profile->format]->name))); |
|
48 | + $formats = filter_formats(); |
|
49 | + $editor = wysiwyg_get_editor($profile->editor); |
|
50 | + drupal_set_title(t('%editor profile for %format', array('%editor' => $editor['title'], '%format' => $formats[$profile->format]->name))); |
|
51 | 51 | |
52 | - $form['format'] = array('#type' => 'value', '#value' => $profile->format); |
|
53 | - $form['input_format'] = array('#type' => 'value', '#value' => $formats[$profile->format]->name); |
|
54 | - $form['editor'] = array('#type' => 'value', '#value' => $profile->editor); |
|
52 | + $form['format'] = array('#type' => 'value', '#value' => $profile->format); |
|
53 | + $form['input_format'] = array('#type' => 'value', '#value' => $formats[$profile->format]->name); |
|
54 | + $form['editor'] = array('#type' => 'value', '#value' => $profile->editor); |
|
55 | 55 | |
56 | - $form['basic'] = array( |
|
56 | + $form['basic'] = array( |
|
57 | 57 | '#type' => 'fieldset', |
58 | 58 | '#title' => t('Basic setup'), |
59 | 59 | '#collapsible' => TRUE, |
60 | 60 | '#collapsed' => TRUE, |
61 | - ); |
|
61 | + ); |
|
62 | 62 | |
63 | - $form['basic']['default'] = array( |
|
63 | + $form['basic']['default'] = array( |
|
64 | 64 | '#type' => 'checkbox', |
65 | 65 | '#title' => t('Enabled by default'), |
66 | 66 | '#default_value' => $profile->settings['default'], |
67 | 67 | '#return_value' => 1, |
68 | 68 | '#description' => t('The default editor state for users having access to this profile. Users are able to override this state if the next option is enabled.'), |
69 | - ); |
|
69 | + ); |
|
70 | 70 | |
71 | - $form['basic']['user_choose'] = array( |
|
71 | + $form['basic']['user_choose'] = array( |
|
72 | 72 | '#type' => 'checkbox', |
73 | 73 | '#title' => t('Allow users to choose default'), |
74 | 74 | '#default_value' => $profile->settings['user_choose'], |
75 | 75 | '#return_value' => 1, |
76 | 76 | '#description' => t('If allowed, users will be able to choose their own editor default state in their user account settings.'), |
77 | - ); |
|
77 | + ); |
|
78 | 78 | |
79 | - $form['basic']['show_toggle'] = array( |
|
79 | + $form['basic']['show_toggle'] = array( |
|
80 | 80 | '#type' => 'checkbox', |
81 | 81 | '#title' => t('Show <em>enable/disable rich text</em> toggle link'), |
82 | 82 | '#default_value' => $profile->settings['show_toggle'], |
83 | 83 | '#return_value' => 1, |
84 | 84 | '#description' => t('Whether or not to show the <em>enable/disable rich text</em> toggle link below a textarea. If disabled, the user setting or global default is used (see above).'), |
85 | - ); |
|
85 | + ); |
|
86 | 86 | |
87 | - $form['basic']['theme'] = array( |
|
87 | + $form['basic']['theme'] = array( |
|
88 | 88 | '#type' => 'hidden', |
89 | 89 | '#value' => $profile->settings['theme'], |
90 | - ); |
|
90 | + ); |
|
91 | 91 | |
92 | - $form['basic']['language'] = array( |
|
92 | + $form['basic']['language'] = array( |
|
93 | 93 | '#type' => 'select', |
94 | 94 | '#title' => t('Interface language'), |
95 | 95 | '#default_value' => $profile->settings['language'], |
96 | - ); |
|
97 | - // @see _locale_prepare_predefined_list() |
|
98 | - require_once './includes/locale.inc'; |
|
99 | - $predefined = _locale_get_predefined_list(); |
|
100 | - foreach ($predefined as $key => $value) { |
|
96 | + ); |
|
97 | + // @see _locale_prepare_predefined_list() |
|
98 | + require_once './includes/locale.inc'; |
|
99 | + $predefined = _locale_get_predefined_list(); |
|
100 | + foreach ($predefined as $key => $value) { |
|
101 | 101 | // Include native name in output, if possible |
102 | 102 | if (count($value) > 1) { |
103 | - $tname = t($value[0]); |
|
104 | - $predefined[$key] = ($tname == $value[1]) ? $tname : "$tname ($value[1])"; |
|
103 | + $tname = t($value[0]); |
|
104 | + $predefined[$key] = ($tname == $value[1]) ? $tname : "$tname ($value[1])"; |
|
105 | 105 | } |
106 | 106 | else { |
107 | - $predefined[$key] = t($value[0]); |
|
107 | + $predefined[$key] = t($value[0]); |
|
108 | + } |
|
108 | 109 | } |
109 | - } |
|
110 | - asort($predefined); |
|
111 | - $form['basic']['language']['#options'] = $predefined; |
|
110 | + asort($predefined); |
|
111 | + $form['basic']['language']['#options'] = $predefined; |
|
112 | 112 | |
113 | - $form['buttons'] = array( |
|
113 | + $form['buttons'] = array( |
|
114 | 114 | '#type' => 'fieldset', |
115 | 115 | '#title' => t('Buttons and plugins'), |
116 | 116 | '#collapsible' => TRUE, |
117 | 117 | '#collapsed' => TRUE, |
118 | 118 | '#tree' => TRUE, |
119 | 119 | '#theme' => 'wysiwyg_admin_button_table', |
120 | - ); |
|
120 | + ); |
|
121 | 121 | |
122 | - $plugins = wysiwyg_get_plugins($profile->editor); |
|
123 | - // Generate the button list. |
|
124 | - foreach ($plugins as $name => $meta) { |
|
122 | + $plugins = wysiwyg_get_plugins($profile->editor); |
|
123 | + // Generate the button list. |
|
124 | + foreach ($plugins as $name => $meta) { |
|
125 | 125 | if (isset($meta['buttons']) && is_array($meta['buttons'])) { |
126 | - foreach ($meta['buttons'] as $button => $title) { |
|
126 | + foreach ($meta['buttons'] as $button => $title) { |
|
127 | 127 | $icon = ''; |
128 | 128 | if (!empty($meta['path'])) { |
129 | - // @todo Button icon locations are different in editors, editor versions, |
|
130 | - // and contrib/custom plugins (like Image Assist, f.e.). |
|
131 | - $img_src = $meta['path'] . "/images/$name.gif"; |
|
132 | - // Handle plugins that have more than one button. |
|
133 | - if (!file_exists($img_src)) { |
|
129 | + // @todo Button icon locations are different in editors, editor versions, |
|
130 | + // and contrib/custom plugins (like Image Assist, f.e.). |
|
131 | + $img_src = $meta['path'] . "/images/$name.gif"; |
|
132 | + // Handle plugins that have more than one button. |
|
133 | + if (!file_exists($img_src)) { |
|
134 | 134 | $img_src = $meta['path'] . "/images/$button.gif"; |
135 | - } |
|
136 | - $icon = file_exists($img_src) ? '<img src="' . base_path() . $img_src . '" title="' . $button . '" style="border: 1px solid grey; vertical-align: middle;" />' : ''; |
|
135 | + } |
|
136 | + $icon = file_exists($img_src) ? '<img src="' . base_path() . $img_src . '" title="' . $button . '" style="border: 1px solid grey; vertical-align: middle;" />' : ''; |
|
137 | 137 | } |
138 | 138 | $title = (isset($meta['url']) ? l($title, $meta['url'], array('target' => '_blank')) : $title); |
139 | 139 | $title = (!empty($icon) ? $icon . ' ' . $title : $title); |
140 | 140 | $form['buttons'][$name][$button] = array( |
141 | - '#type' => 'checkbox', |
|
142 | - '#title' => $title, |
|
143 | - '#default_value' => !empty($profile->settings['buttons'][$name][$button]) ? $profile->settings['buttons'][$name][$button] : FALSE, |
|
141 | + '#type' => 'checkbox', |
|
142 | + '#title' => $title, |
|
143 | + '#default_value' => !empty($profile->settings['buttons'][$name][$button]) ? $profile->settings['buttons'][$name][$button] : FALSE, |
|
144 | 144 | ); |
145 | - } |
|
145 | + } |
|
146 | 146 | } |
147 | 147 | else if (isset($meta['extensions']) && is_array($meta['extensions'])) { |
148 | - foreach ($meta['extensions'] as $extension => $title) { |
|
148 | + foreach ($meta['extensions'] as $extension => $title) { |
|
149 | 149 | $form['buttons'][$name][$extension] = array( |
150 | - '#type' => 'checkbox', |
|
151 | - '#title' => isset($meta['url']) ? l($title, $meta['url'], array('target' => '_blank')) : $title, |
|
152 | - '#default_value' => !empty($profile->settings['buttons'][$name][$extension]) ? $profile->settings['buttons'][$name][$extension] : FALSE, |
|
150 | + '#type' => 'checkbox', |
|
151 | + '#title' => isset($meta['url']) ? l($title, $meta['url'], array('target' => '_blank')) : $title, |
|
152 | + '#default_value' => !empty($profile->settings['buttons'][$name][$extension]) ? $profile->settings['buttons'][$name][$extension] : FALSE, |
|
153 | 153 | ); |
154 | - } |
|
154 | + } |
|
155 | + } |
|
155 | 156 | } |
156 | - } |
|
157 | 157 | |
158 | - $form['appearance'] = array( |
|
158 | + $form['appearance'] = array( |
|
159 | 159 | '#type' => 'fieldset', |
160 | 160 | '#title' => t('Editor appearance'), |
161 | 161 | '#collapsible' => TRUE, |
162 | 162 | '#collapsed' => TRUE, |
163 | - ); |
|
163 | + ); |
|
164 | 164 | |
165 | - $form['appearance']['toolbar_loc'] = array( |
|
165 | + $form['appearance']['toolbar_loc'] = array( |
|
166 | 166 | '#type' => 'select', |
167 | 167 | '#title' => t('Toolbar location'), |
168 | 168 | '#default_value' => $profile->settings['toolbar_loc'], |
169 | 169 | '#options' => array('bottom' => t('Bottom'), 'top' => t('Top')), |
170 | 170 | '#description' => t('This option controls whether the editor toolbar is displayed above or below the editing area.'), |
171 | - ); |
|
171 | + ); |
|
172 | 172 | |
173 | - $form['appearance']['toolbar_align'] = array( |
|
173 | + $form['appearance']['toolbar_align'] = array( |
|
174 | 174 | '#type' => 'select', |
175 | 175 | '#title' => t('Button alignment'), |
176 | 176 | '#default_value' => $profile->settings['toolbar_align'], |
177 | 177 | '#options' => array('center' => t('Center'), 'left' => t('Left'), 'right' => t('Right')), |
178 | 178 | '#description' => t('This option controls the alignment of icons in the editor toolbar.'), |
179 | - ); |
|
179 | + ); |
|
180 | 180 | |
181 | - $form['appearance']['path_loc'] = array( |
|
181 | + $form['appearance']['path_loc'] = array( |
|
182 | 182 | '#type' => 'select', |
183 | 183 | '#title' => t('Path location'), |
184 | 184 | '#default_value' => $profile->settings['path_loc'], |
185 | 185 | '#options' => array('none' => t('Hide'), 'top' => t('Top'), 'bottom' => t('Bottom')), |
186 | 186 | '#description' => t('Where to display the path to HTML elements (i.e. <code>body > table > tr > td</code>).'), |
187 | - ); |
|
187 | + ); |
|
188 | 188 | |
189 | - $form['appearance']['resizing'] = array( |
|
189 | + $form['appearance']['resizing'] = array( |
|
190 | 190 | '#type' => 'checkbox', |
191 | 191 | '#title' => t('Enable resizing button'), |
192 | 192 | '#default_value' => $profile->settings['resizing'], |
193 | 193 | '#return_value' => 1, |
194 | 194 | '#description' => t('This option gives you the ability to enable/disable the resizing button. If enabled, the Path location toolbar must be set to "Top" or "Bottom" in order to display the resize icon.'), |
195 | - ); |
|
195 | + ); |
|
196 | 196 | |
197 | - $form['output'] = array( |
|
197 | + $form['output'] = array( |
|
198 | 198 | '#type' => 'fieldset', |
199 | 199 | '#title' => t('Cleanup and output'), |
200 | 200 | '#collapsible' => TRUE, |
201 | 201 | '#collapsed' => TRUE, |
202 | - ); |
|
202 | + ); |
|
203 | 203 | |
204 | - $form['output']['verify_html'] = array( |
|
204 | + $form['output']['verify_html'] = array( |
|
205 | 205 | '#type' => 'checkbox', |
206 | 206 | '#title' => t('Verify HTML'), |
207 | 207 | '#default_value' => $profile->settings['verify_html'], |
208 | 208 | '#return_value' => 1, |
209 | 209 | '#description' => t('If enabled, potentially malicious code like <code><HEAD></code> tags will be removed from HTML contents.'), |
210 | - ); |
|
210 | + ); |
|
211 | 211 | |
212 | - $form['output']['preformatted'] = array( |
|
212 | + $form['output']['preformatted'] = array( |
|
213 | 213 | '#type' => 'checkbox', |
214 | 214 | '#title' => t('Preformatted'), |
215 | 215 | '#default_value' => $profile->settings['preformatted'], |
216 | 216 | '#return_value' => 1, |
217 | 217 | '#description' => t('If enabled, the editor will insert TAB characters on tab and preserve other whitespace characters just like a PRE element in HTML does.'), |
218 | - ); |
|
218 | + ); |
|
219 | 219 | |
220 | - $form['output']['convert_fonts_to_spans'] = array( |
|
220 | + $form['output']['convert_fonts_to_spans'] = array( |
|
221 | 221 | '#type' => 'checkbox', |
222 | 222 | '#title' => t('Convert <font> tags to styles'), |
223 | 223 | '#default_value' => $profile->settings['convert_fonts_to_spans'], |
224 | 224 | '#return_value' => 1, |
225 | 225 | '#description' => t('If enabled, HTML tags declaring the font size, font family, font color and font background color will be replaced by inline CSS styles.'), |
226 | - ); |
|
226 | + ); |
|
227 | 227 | |
228 | - $form['output']['remove_linebreaks'] = array( |
|
228 | + $form['output']['remove_linebreaks'] = array( |
|
229 | 229 | '#type' => 'checkbox', |
230 | 230 | '#title' => t('Remove linebreaks'), |
231 | 231 | '#default_value' => $profile->settings['remove_linebreaks'], |
232 | 232 | '#return_value' => 1, |
233 | 233 | '#description' => t('If enabled, the editor will remove most linebreaks from contents. Disabling this option could avoid conflicts with other input filters.'), |
234 | - ); |
|
234 | + ); |
|
235 | 235 | |
236 | - $form['output']['apply_source_formatting'] = array( |
|
236 | + $form['output']['apply_source_formatting'] = array( |
|
237 | 237 | '#type' => 'checkbox', |
238 | 238 | '#title' => t('Apply source formatting'), |
239 | 239 | '#default_value' => $profile->settings['apply_source_formatting'], |
240 | 240 | '#return_value' => 1, |
241 | 241 | '#description' => t('If enabled, the editor will re-format the HTML source code. Disabling this option could avoid conflicts with other input filters.'), |
242 | - ); |
|
242 | + ); |
|
243 | 243 | |
244 | - $form['output']['paste_auto_cleanup_on_paste'] = array( |
|
244 | + $form['output']['paste_auto_cleanup_on_paste'] = array( |
|
245 | 245 | '#type' => 'checkbox', |
246 | 246 | '#title' => t('Force cleanup on standard paste'), |
247 | 247 | '#default_value' => $profile->settings['paste_auto_cleanup_on_paste'], |
248 | 248 | '#return_value' => 1, |
249 | 249 | '#description' => t('If enabled, the default paste function (CTRL-V or SHIFT-INS) behaves like the "paste from word" plugin function.'), |
250 | - ); |
|
250 | + ); |
|
251 | 251 | |
252 | - $form['css'] = array( |
|
252 | + $form['css'] = array( |
|
253 | 253 | '#type' => 'fieldset', |
254 | 254 | '#title' => t('CSS'), |
255 | 255 | '#collapsible' => TRUE, |
256 | 256 | '#collapsed' => TRUE, |
257 | - ); |
|
257 | + ); |
|
258 | 258 | |
259 | - $form['css']['block_formats'] = array( |
|
259 | + $form['css']['block_formats'] = array( |
|
260 | 260 | '#type' => 'textfield', |
261 | 261 | '#title' => t('Block formats'), |
262 | 262 | '#default_value' => $profile->settings['block_formats'], |
263 | 263 | '#size' => 40, |
264 | 264 | '#maxlength' => 250, |
265 | 265 | '#description' => t('Comma separated list of HTML block formats. Possible values: <code>@format-list</code>.', array('@format-list' => 'p,h1,h2,h3,h4,h5,h6,div,blockquote,address,pre,code,dt,dd')), |
266 | - ); |
|
266 | + ); |
|
267 | 267 | |
268 | - $form['css']['css_setting'] = array( |
|
268 | + $form['css']['css_setting'] = array( |
|
269 | 269 | '#type' => 'select', |
270 | 270 | '#title' => t('Editor CSS'), |
271 | 271 | '#default_value' => $profile->settings['css_setting'], |
272 | 272 | '#options' => array('theme' => t('Use theme CSS'), 'self' => t('Define CSS'), 'none' => t('Editor default CSS')), |
273 | 273 | '#description' => t('Defines the CSS to be used in the editor area.<br />Use theme CSS - loads stylesheets from current site theme.<br/>Define CSS - enter path for stylesheet files below.<br />Editor default CSS - uses default stylesheets from editor.'), |
274 | - ); |
|
274 | + ); |
|
275 | 275 | |
276 | - $form['css']['css_path'] = array( |
|
276 | + $form['css']['css_path'] = array( |
|
277 | 277 | '#type' => 'textfield', |
278 | 278 | '#title' => t('CSS path'), |
279 | 279 | '#default_value' => $profile->settings['css_path'], |
280 | 280 | '#size' => 40, |
281 | 281 | '#maxlength' => 255, |
282 | 282 | '#description' => t('If "Define CSS" was selected above, enter path to a CSS file or a list of CSS files separated by a comma.') . '<br />' . t('Available tokens: <code>%b</code> (base path, eg: <code>/</code>), <code>%t</code> (path to theme, eg: <code>themes/garland</code>)') . '<br />' . t('Example:') . ' css/editor.css,/themes/garland/style.css,%b%t/style.css,http://example.com/external.css', |
283 | - ); |
|
283 | + ); |
|
284 | 284 | |
285 | - $form['css']['css_classes'] = array( |
|
285 | + $form['css']['css_classes'] = array( |
|
286 | 286 | '#type' => 'textarea', |
287 | 287 | '#title' => t('CSS classes'), |
288 | 288 | '#default_value' => $profile->settings['css_classes'], |
289 | 289 | '#description' => t('Optionally define CSS classes for the "Font style" dropdown list.<br />Enter one class on each line in the format: !format. Example: !example<br />If left blank, CSS classes are automatically imported from all loaded stylesheet(s).', array('!format' => '<code>[title]=[class]</code>', '!example' => 'My heading=header1')), |
290 | - ); |
|
290 | + ); |
|
291 | 291 | |
292 | - $form['submit'] = array( |
|
292 | + $form['submit'] = array( |
|
293 | 293 | '#type' => 'submit', |
294 | 294 | '#value' => t('Save'), |
295 | 295 | '#weight' => 100, |
296 | - ); |
|
297 | - $form['cancel'] = array( |
|
296 | + ); |
|
297 | + $form['cancel'] = array( |
|
298 | 298 | '#value' => l(t('Cancel'), 'admin/settings/wysiwyg'), |
299 | 299 | '#weight' => 110, |
300 | - ); |
|
300 | + ); |
|
301 | 301 | |
302 | - return $form; |
|
302 | + return $form; |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | /** |
@@ -308,258 +308,258 @@ discard block |
||
308 | 308 | * @see wysiwyg_profile_form() |
309 | 309 | */ |
310 | 310 | function wysiwyg_profile_form_submit($form, &$form_state) { |
311 | - $values = $form_state['values']; |
|
312 | - if (isset($values['buttons'])) { |
|
311 | + $values = $form_state['values']; |
|
312 | + if (isset($values['buttons'])) { |
|
313 | 313 | // Store only enabled buttons for each plugin. |
314 | 314 | foreach ($values['buttons'] as $plugin => $buttons) { |
315 | - $values['buttons'][$plugin] = array_filter($values['buttons'][$plugin]); |
|
315 | + $values['buttons'][$plugin] = array_filter($values['buttons'][$plugin]); |
|
316 | 316 | } |
317 | 317 | // Store only enabled plugins. |
318 | 318 | $values['buttons'] = array_filter($values['buttons']); |
319 | - } |
|
320 | - // Remove any white-space from 'block_formats' setting, since editor |
|
321 | - // implementations rely on a comma-separated list to explode(). |
|
322 | - $values['block_formats'] = preg_replace('@\s+@', '', $values['block_formats']); |
|
323 | - |
|
324 | - // Remove input format name. |
|
325 | - $format = $values['format']; |
|
326 | - $input_format = $values['input_format']; |
|
327 | - $editor = $values['editor']; |
|
328 | - unset($values['format'], $values['input_format'], $values['editor']); |
|
329 | - |
|
330 | - // Remove FAPI values. |
|
331 | - // @see system_settings_form_submit() |
|
332 | - unset($values['submit'], $values['form_id'], $values['op'], $values['form_token'], $values['form_build_id']); |
|
333 | - |
|
334 | - // Determine if this is an update. |
|
335 | - if (!db_result(db_query("SELECT 1 FROM {wysiwyg} WHERE format = %d", $format))) { |
|
319 | + } |
|
320 | + // Remove any white-space from 'block_formats' setting, since editor |
|
321 | + // implementations rely on a comma-separated list to explode(). |
|
322 | + $values['block_formats'] = preg_replace('@\s+@', '', $values['block_formats']); |
|
323 | + |
|
324 | + // Remove input format name. |
|
325 | + $format = $values['format']; |
|
326 | + $input_format = $values['input_format']; |
|
327 | + $editor = $values['editor']; |
|
328 | + unset($values['format'], $values['input_format'], $values['editor']); |
|
329 | + |
|
330 | + // Remove FAPI values. |
|
331 | + // @see system_settings_form_submit() |
|
332 | + unset($values['submit'], $values['form_id'], $values['op'], $values['form_token'], $values['form_build_id']); |
|
333 | + |
|
334 | + // Determine if this is an update. |
|
335 | + if (!db_result(db_query("SELECT 1 FROM {wysiwyg} WHERE format = %d", $format))) { |
|
336 | 336 | $update = array(); |
337 | - } |
|
338 | - else { |
|
337 | + } |
|
338 | + else { |
|
339 | 339 | $update = array('format'); |
340 | - } |
|
341 | - $wysiwyg = new stdClass(); |
|
342 | - $wysiwyg->format = $format; |
|
343 | - $wysiwyg->editor = $editor; |
|
344 | - $wysiwyg->settings = $values; |
|
340 | + } |
|
341 | + $wysiwyg = new stdClass(); |
|
342 | + $wysiwyg->format = $format; |
|
343 | + $wysiwyg->editor = $editor; |
|
344 | + $wysiwyg->settings = $values; |
|
345 | 345 | |
346 | - // Insert new profile data. |
|
347 | - drupal_write_record('wysiwyg', $wysiwyg, $update); |
|
346 | + // Insert new profile data. |
|
347 | + drupal_write_record('wysiwyg', $wysiwyg, $update); |
|
348 | 348 | |
349 | - drupal_set_message(t('Wysiwyg profile for %format has been saved.', array('%format' => $input_format))); |
|
349 | + drupal_set_message(t('Wysiwyg profile for %format has been saved.', array('%format' => $input_format))); |
|
350 | 350 | |
351 | - $form_state['redirect'] = 'admin/settings/wysiwyg'; |
|
351 | + $form_state['redirect'] = 'admin/settings/wysiwyg'; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
355 | 355 | * Layout for the buttons in the Wysiwyg Editor profile form. |
356 | 356 | */ |
357 | 357 | function theme_wysiwyg_admin_button_table($form) { |
358 | - $buttons = array(); |
|
358 | + $buttons = array(); |
|
359 | 359 | |
360 | - // Flatten forms array. |
|
361 | - foreach (element_children($form) as $name) { |
|
360 | + // Flatten forms array. |
|
361 | + foreach (element_children($form) as $name) { |
|
362 | 362 | foreach (element_children($form[$name]) as $button) { |
363 | - $buttons[] = drupal_render($form[$name][$button]); |
|
363 | + $buttons[] = drupal_render($form[$name][$button]); |
|
364 | + } |
|
364 | 365 | } |
365 | - } |
|
366 | 366 | |
367 | - // Split checkboxes into rows with 3 columns. |
|
368 | - $total = count($buttons); |
|
369 | - $rows = array(); |
|
370 | - for ($i = 0; $i < $total; $i++) { |
|
367 | + // Split checkboxes into rows with 3 columns. |
|
368 | + $total = count($buttons); |
|
369 | + $rows = array(); |
|
370 | + for ($i = 0; $i < $total; $i++) { |
|
371 | 371 | $row = array(); |
372 | 372 | $row[] = array('data' => $buttons[$i]); |
373 | 373 | if (isset($buttons[++$i])) { |
374 | - $row[] = array('data' => $buttons[$i]); |
|
374 | + $row[] = array('data' => $buttons[$i]); |
|
375 | 375 | } |
376 | 376 | if (isset($buttons[++$i])) { |
377 | - $row[] = array('data' => $buttons[$i]); |
|
377 | + $row[] = array('data' => $buttons[$i]); |
|
378 | 378 | } |
379 | 379 | $rows[] = $row; |
380 | - } |
|
380 | + } |
|
381 | 381 | |
382 | - $output = theme('table', array(), $rows, array('width' => '100%')); |
|
382 | + $output = theme('table', array(), $rows, array('width' => '100%')); |
|
383 | 383 | |
384 | - return $output; |
|
384 | + return $output; |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
388 | 388 | * Display overview of setup Wysiwyg Editor profiles; menu callback. |
389 | 389 | */ |
390 | 390 | function wysiwyg_profile_overview() { |
391 | - include_once './includes/install.inc'; |
|
391 | + include_once './includes/install.inc'; |
|
392 | 392 | |
393 | - // Check which wysiwyg editors are installed. |
|
394 | - $editors = wysiwyg_get_all_editors(); |
|
395 | - $count = count($editors); |
|
396 | - $status = array(); |
|
397 | - $options = array('' => t('No editor')); |
|
393 | + // Check which wysiwyg editors are installed. |
|
394 | + $editors = wysiwyg_get_all_editors(); |
|
395 | + $count = count($editors); |
|
396 | + $status = array(); |
|
397 | + $options = array('' => t('No editor')); |
|
398 | 398 | |
399 | - foreach ($editors as $name => $editor) { |
|
399 | + foreach ($editors as $name => $editor) { |
|
400 | 400 | $status[$name] = array( |
401 | - 'severity' => (isset($editor['error']) ? REQUIREMENT_ERROR : ($editor['installed'] ? REQUIREMENT_OK : REQUIREMENT_INFO)), |
|
402 | - 'title' => t('<a href="!vendor-url">@editor</a> (<a href="!download-url">Download</a>)', array('!vendor-url' => $editor['vendor url'], '@editor' => $editor['title'], '!download-url' => $editor['download url'])), |
|
403 | - 'value' => (isset($editor['installed version']) ? $editor['installed version'] : t('Not installed.')), |
|
404 | - 'description' => (isset($editor['error']) ? $editor['error'] : ''), |
|
401 | + 'severity' => (isset($editor['error']) ? REQUIREMENT_ERROR : ($editor['installed'] ? REQUIREMENT_OK : REQUIREMENT_INFO)), |
|
402 | + 'title' => t('<a href="!vendor-url">@editor</a> (<a href="!download-url">Download</a>)', array('!vendor-url' => $editor['vendor url'], '@editor' => $editor['title'], '!download-url' => $editor['download url'])), |
|
403 | + 'value' => (isset($editor['installed version']) ? $editor['installed version'] : t('Not installed.')), |
|
404 | + 'description' => (isset($editor['error']) ? $editor['error'] : ''), |
|
405 | 405 | ); |
406 | 406 | if ($editor['installed']) { |
407 | - $options[$name] = $editor['title'] . (isset($editor['installed version']) ? ' ' . $editor['installed version'] : ''); |
|
407 | + $options[$name] = $editor['title'] . (isset($editor['installed version']) ? ' ' . $editor['installed version'] : ''); |
|
408 | 408 | } |
409 | 409 | else { |
410 | - // Build on-site installation instructions. |
|
411 | - // @todo Setup $library in wysiwyg_load_editor() already. |
|
412 | - $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries'])); |
|
413 | - $targs = array( |
|
410 | + // Build on-site installation instructions. |
|
411 | + // @todo Setup $library in wysiwyg_load_editor() already. |
|
412 | + $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries'])); |
|
413 | + $targs = array( |
|
414 | 414 | '@editor-path' => $editor['editor path'], |
415 | 415 | '@library-filepath' => $editor['library path'] . '/' . (isset($editor['libraries'][$library]['files'][0]) ? $editor['libraries'][$library]['files'][0] : key($editor['libraries'][$library]['files'])), |
416 | - ); |
|
417 | - $instructions = '<p>' . t('Extract the archive and copy its contents into a new folder in the following location:<br /><code>@editor-path</code>', $targs) . '</p>'; |
|
418 | - $instructions .= '<p>' . t('So the actual library can be found at:<br /><code>@library-filepath</code>', $targs) . '</p>'; |
|
416 | + ); |
|
417 | + $instructions = '<p>' . t('Extract the archive and copy its contents into a new folder in the following location:<br /><code>@editor-path</code>', $targs) . '</p>'; |
|
418 | + $instructions .= '<p>' . t('So the actual library can be found at:<br /><code>@library-filepath</code>', $targs) . '</p>'; |
|
419 | 419 | |
420 | - $status[$name]['description'] .= $instructions; |
|
421 | - $count--; |
|
420 | + $status[$name]['description'] .= $instructions; |
|
421 | + $count--; |
|
422 | 422 | } |
423 | 423 | // In case there is an error, always show installation instructions. |
424 | 424 | if (isset($editor['error'])) { |
425 | - $show_instructions = TRUE; |
|
425 | + $show_instructions = TRUE; |
|
426 | + } |
|
426 | 427 | } |
427 | - } |
|
428 | - if (!$count) { |
|
428 | + if (!$count) { |
|
429 | 429 | $show_instructions = TRUE; |
430 | - } |
|
431 | - $form['status'] = array( |
|
430 | + } |
|
431 | + $form['status'] = array( |
|
432 | 432 | '#type' => 'fieldset', |
433 | 433 | '#title' => t('Installation instructions'), |
434 | 434 | '#collapsible' => TRUE, |
435 | 435 | '#collapsed' => !isset($show_instructions), |
436 | 436 | '#description' => (!$count ? t('There are no editor libraries installed currently. The following list contains a list of currently supported editors:') : ''), |
437 | 437 | '#weight' => 10, |
438 | - ); |
|
439 | - $form['status']['report'] = array('#value' => theme('status_report', $status)); |
|
438 | + ); |
|
439 | + $form['status']['report'] = array('#value' => theme('status_report', $status)); |
|
440 | 440 | |
441 | - if (!$count) { |
|
441 | + if (!$count) { |
|
442 | 442 | return $form; |
443 | - } |
|
443 | + } |
|
444 | 444 | |
445 | - $formats = filter_formats(); |
|
446 | - // Reset Wysiwyg cache |
|
447 | - $profiles = wysiwyg_profile_load_all(TRUE); |
|
448 | - $form['formats'] = array( |
|
445 | + $formats = filter_formats(); |
|
446 | + // Reset Wysiwyg cache |
|
447 | + $profiles = wysiwyg_profile_load_all(TRUE); |
|
448 | + $form['formats'] = array( |
|
449 | 449 | '#type' => 'item', |
450 | 450 | '#description' => t('To assign a different editor to a text format, click "delete" to remove the existing first.'), |
451 | 451 | '#tree' => TRUE, |
452 | - ); |
|
452 | + ); |
|
453 | 453 | |
454 | - $enable_save = FALSE; |
|
455 | - $in_code_only = FALSE; |
|
456 | - foreach ($formats as $id => $format) { |
|
454 | + $enable_save = FALSE; |
|
455 | + $in_code_only = FALSE; |
|
456 | + foreach ($formats as $id => $format) { |
|
457 | 457 | $form['formats'][$id]['name'] = array( |
458 | - '#value' => check_plain($format->name), |
|
458 | + '#value' => check_plain($format->name), |
|
459 | 459 | ); |
460 | 460 | // Only display editor selection for associated input formats to avoid |
461 | 461 | // confusion about disabled selection. |
462 | 462 | if (isset($profiles[$id]) && !empty($profiles[$id]->editor)) { |
463 | - $in_code_only = !empty($profiles[$id]->in_code_only); |
|
464 | - $form['formats'][$id]['editor'] = array( |
|
463 | + $in_code_only = !empty($profiles[$id]->in_code_only); |
|
464 | + $form['formats'][$id]['editor'] = array( |
|
465 | 465 | '#value' => $options[$profiles[$id]->editor], |
466 | - ); |
|
467 | - if ($in_code_only) { |
|
466 | + ); |
|
467 | + if ($in_code_only) { |
|
468 | 468 | $form['formats'][$id]['name']['#value'] .= ' <em>(' . t('From: !module module', array('!module' => $profiles[$id]->export_module)) . ')</em>'; |
469 | - } |
|
469 | + } |
|
470 | 470 | } |
471 | 471 | else { |
472 | - $form['formats'][$id]['editor'] = array( |
|
472 | + $form['formats'][$id]['editor'] = array( |
|
473 | 473 | '#type' => 'select', |
474 | 474 | '#default_value' => '', |
475 | 475 | '#options' => $options, |
476 | - ); |
|
477 | - $enable_save = TRUE; |
|
476 | + ); |
|
477 | + $enable_save = TRUE; |
|
478 | 478 | } |
479 | 479 | if (isset($profiles[$id]) && !empty($profiles[$id]->editor)) { |
480 | - $edit = !empty($profiles[$id]->in_code_only)?t('Override'):t('Edit'); |
|
481 | - $form['formats'][$id]['edit'] = array( |
|
480 | + $edit = !empty($profiles[$id]->in_code_only)?t('Override'):t('Edit'); |
|
481 | + $form['formats'][$id]['edit'] = array( |
|
482 | 482 | '#value' => l($edit, "admin/settings/wysiwyg/profile/$id/edit"), |
483 | - ); |
|
484 | - // Only display delete/revert links for wysiwyg loaded from the database |
|
485 | - if (!$in_code_only) { |
|
483 | + ); |
|
484 | + // Only display delete/revert links for wysiwyg loaded from the database |
|
485 | + if (!$in_code_only) { |
|
486 | 486 | $delete = (empty($profiles[$id]->type) || $profiles[$id]->type == t('Normal'))?t('Delete'):t('Revert'); |
487 | 487 | $form['formats'][$id]['delete'] = array( |
488 | - '#value' => l($delete, "admin/settings/wysiwyg/profile/$id/delete"), |
|
488 | + '#value' => l($delete, "admin/settings/wysiwyg/profile/$id/delete"), |
|
489 | 489 | ); |
490 | - } |
|
490 | + } |
|
491 | + } |
|
491 | 492 | } |
492 | - } |
|
493 | 493 | |
494 | - // Submitting the form when no editors can be selected causes errors. |
|
495 | - if ($enable_save) { |
|
494 | + // Submitting the form when no editors can be selected causes errors. |
|
495 | + if ($enable_save) { |
|
496 | 496 | $form['submit'] = array('#type' => 'submit', '#value' => t('Save')); |
497 | - } |
|
498 | - return $form; |
|
497 | + } |
|
498 | + return $form; |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | /** |
502 | 502 | * Return HTML for the Wysiwyg profile overview form. |
503 | 503 | */ |
504 | 504 | function theme_wysiwyg_profile_overview($form) { |
505 | - if (!isset($form['formats'])) { |
|
505 | + if (!isset($form['formats'])) { |
|
506 | 506 | return; |
507 | - } |
|
508 | - $output = ''; |
|
509 | - $header = array(t('Input format'), t('Editor'), array('data' => t('Operations'), 'colspan' => 3)); |
|
510 | - $rows = array(); |
|
511 | - foreach (element_children($form['formats']) as $item) { |
|
507 | + } |
|
508 | + $output = ''; |
|
509 | + $header = array(t('Input format'), t('Editor'), array('data' => t('Operations'), 'colspan' => 3)); |
|
510 | + $rows = array(); |
|
511 | + foreach (element_children($form['formats']) as $item) { |
|
512 | 512 | $format = &$form['formats'][$item]; |
513 | 513 | $rows[] = array( |
514 | - drupal_render($format['name']), |
|
515 | - drupal_render($format['editor']), |
|
516 | - isset($format['edit']) ? drupal_render($format['edit']) : '', |
|
517 | - isset($format['export']) ? drupal_render($format['export']) : '', |
|
518 | - isset($format['delete']) ? drupal_render($format['delete']) : '', |
|
519 | - ); |
|
520 | - } |
|
521 | - $form['formats']['table']['#value'] = theme('table', $header, $rows); |
|
522 | - $output .= drupal_render($form); |
|
523 | - return $output; |
|
514 | + drupal_render($format['name']), |
|
515 | + drupal_render($format['editor']), |
|
516 | + isset($format['edit']) ? drupal_render($format['edit']) : '', |
|
517 | + isset($format['export']) ? drupal_render($format['export']) : '', |
|
518 | + isset($format['delete']) ? drupal_render($format['delete']) : '', |
|
519 | + ); |
|
520 | + } |
|
521 | + $form['formats']['table']['#value'] = theme('table', $header, $rows); |
|
522 | + $output .= drupal_render($form); |
|
523 | + return $output; |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | /** |
527 | 527 | * Submit callback for Wysiwyg profile overview form. |
528 | 528 | */ |
529 | 529 | function wysiwyg_profile_overview_submit($form, &$form_state) { |
530 | - foreach ($form_state['values']['formats'] as $format => $values) { |
|
530 | + foreach ($form_state['values']['formats'] as $format => $values) { |
|
531 | 531 | db_query("UPDATE {wysiwyg} SET editor = '%s' WHERE format = %d", $values['editor'], $format); |
532 | 532 | if (!db_affected_rows()) { |
533 | - db_query("INSERT INTO {wysiwyg} (format, editor) VALUES (%d, '%s')", $format, $values['editor']); |
|
533 | + db_query("INSERT INTO {wysiwyg} (format, editor) VALUES (%d, '%s')", $format, $values['editor']); |
|
534 | + } |
|
534 | 535 | } |
535 | - } |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | /** |
539 | 539 | * Delete editor profile confirmation form. |
540 | 540 | */ |
541 | 541 | function wysiwyg_profile_delete_confirm(&$form_state, $profile) { |
542 | - $formats = filter_formats(); |
|
543 | - $format = $formats[$profile->format]; |
|
544 | - $form['format'] = array('#type' => 'value', '#value' => $format); |
|
545 | - if (isset($profile->type) && $profile->type == t('Overridden')) { |
|
542 | + $formats = filter_formats(); |
|
543 | + $format = $formats[$profile->format]; |
|
544 | + $form['format'] = array('#type' => 'value', '#value' => $format); |
|
545 | + if (isset($profile->type) && $profile->type == t('Overridden')) { |
|
546 | 546 | $form['revert'] = array( |
547 | - '#type' => 'value', |
|
548 | - '#value' => TRUE, |
|
547 | + '#type' => 'value', |
|
548 | + '#value' => TRUE, |
|
549 | 549 | ); |
550 | 550 | return confirm_form( |
551 | - $form, |
|
552 | - t('Are you sure you want to revert the profile settings for %name?', array('%name' => $format->name)), |
|
553 | - 'admin/settings/wysiwyg', |
|
554 | - t('This action cannot be undone.'), t('Revert'), t('Cancel') |
|
551 | + $form, |
|
552 | + t('Are you sure you want to revert the profile settings for %name?', array('%name' => $format->name)), |
|
553 | + 'admin/settings/wysiwyg', |
|
554 | + t('This action cannot be undone.'), t('Revert'), t('Cancel') |
|
555 | 555 | ); |
556 | - } |
|
557 | - return confirm_form( |
|
556 | + } |
|
557 | + return confirm_form( |
|
558 | 558 | $form, |
559 | 559 | t('Are you sure you want to remove the profile for %name?', array('%name' => $format->name)), |
560 | 560 | 'admin/settings/wysiwyg', |
561 | 561 | t('This action cannot be undone.'), t('Remove'), t('Cancel') |
562 | - ); |
|
562 | + ); |
|
563 | 563 | } |
564 | 564 | |
565 | 565 | /** |
@@ -568,16 +568,16 @@ discard block |
||
568 | 568 | * @see wysiwyg_profile_delete_confirm() |
569 | 569 | */ |
570 | 570 | function wysiwyg_profile_delete_confirm_submit($form, &$form_state) { |
571 | - $format = $form_state['values']['format']; |
|
572 | - $wysiwyg = new stdClass(); |
|
573 | - $wysiwyg->format = $format->format; |
|
574 | - wysiwyg_profile_delete($wysiwyg); |
|
575 | - if (!empty($form_state['values']['revert'])) { |
|
571 | + $format = $form_state['values']['format']; |
|
572 | + $wysiwyg = new stdClass(); |
|
573 | + $wysiwyg->format = $format->format; |
|
574 | + wysiwyg_profile_delete($wysiwyg); |
|
575 | + if (!empty($form_state['values']['revert'])) { |
|
576 | 576 | drupal_set_message(t('Wysiwyg profile settings for %name has been reverted.', array('%name' => $format->name))); |
577 | - } |
|
578 | - else { |
|
577 | + } |
|
578 | + else { |
|
579 | 579 | drupal_set_message(t('Wysiwyg profile for %name has been deleted.', array('%name' => $format->name))); |
580 | - } |
|
581 | - $form_state['redirect'] = 'admin/settings/wysiwyg'; |
|
580 | + } |
|
581 | + $form_state['redirect'] = 'admin/settings/wysiwyg'; |
|
582 | 582 | } |
583 | 583 |
@@ -102,8 +102,7 @@ discard block |
||
102 | 102 | if (count($value) > 1) { |
103 | 103 | $tname = t($value[0]); |
104 | 104 | $predefined[$key] = ($tname == $value[1]) ? $tname : "$tname ($value[1])"; |
105 | - } |
|
106 | - else { |
|
105 | + } else { |
|
107 | 106 | $predefined[$key] = t($value[0]); |
108 | 107 | } |
109 | 108 | } |
@@ -143,8 +142,7 @@ discard block |
||
143 | 142 | '#default_value' => !empty($profile->settings['buttons'][$name][$button]) ? $profile->settings['buttons'][$name][$button] : FALSE, |
144 | 143 | ); |
145 | 144 | } |
146 | - } |
|
147 | - else if (isset($meta['extensions']) && is_array($meta['extensions'])) { |
|
145 | + } else if (isset($meta['extensions']) && is_array($meta['extensions'])) { |
|
148 | 146 | foreach ($meta['extensions'] as $extension => $title) { |
149 | 147 | $form['buttons'][$name][$extension] = array( |
150 | 148 | '#type' => 'checkbox', |
@@ -334,8 +332,7 @@ discard block |
||
334 | 332 | // Determine if this is an update. |
335 | 333 | if (!db_result(db_query("SELECT 1 FROM {wysiwyg} WHERE format = %d", $format))) { |
336 | 334 | $update = array(); |
337 | - } |
|
338 | - else { |
|
335 | + } else { |
|
339 | 336 | $update = array('format'); |
340 | 337 | } |
341 | 338 | $wysiwyg = new stdClass(); |
@@ -405,8 +402,7 @@ discard block |
||
405 | 402 | ); |
406 | 403 | if ($editor['installed']) { |
407 | 404 | $options[$name] = $editor['title'] . (isset($editor['installed version']) ? ' ' . $editor['installed version'] : ''); |
408 | - } |
|
409 | - else { |
|
405 | + } else { |
|
410 | 406 | // Build on-site installation instructions. |
411 | 407 | // @todo Setup $library in wysiwyg_load_editor() already. |
412 | 408 | $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries'])); |
@@ -467,8 +463,7 @@ discard block |
||
467 | 463 | if ($in_code_only) { |
468 | 464 | $form['formats'][$id]['name']['#value'] .= ' <em>(' . t('From: !module module', array('!module' => $profiles[$id]->export_module)) . ')</em>'; |
469 | 465 | } |
470 | - } |
|
471 | - else { |
|
466 | + } else { |
|
472 | 467 | $form['formats'][$id]['editor'] = array( |
473 | 468 | '#type' => 'select', |
474 | 469 | '#default_value' => '', |
@@ -574,8 +569,7 @@ discard block |
||
574 | 569 | wysiwyg_profile_delete($wysiwyg); |
575 | 570 | if (!empty($form_state['values']['revert'])) { |
576 | 571 | drupal_set_message(t('Wysiwyg profile settings for %name has been reverted.', array('%name' => $format->name))); |
577 | - } |
|
578 | - else { |
|
572 | + } else { |
|
579 | 573 | drupal_set_message(t('Wysiwyg profile for %name has been deleted.', array('%name' => $format->name))); |
580 | 574 | } |
581 | 575 | $form_state['redirect'] = 'admin/settings/wysiwyg'; |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | $profile['settings'] = array(); |
20 | 20 | } |
21 | 21 | $profile['settings'] += array( |
22 | - 'default' => TRUE, |
|
23 | - 'user_choose' => FALSE, |
|
24 | - 'show_toggle' => TRUE, |
|
22 | + 'default' => true, |
|
23 | + 'user_choose' => false, |
|
24 | + 'show_toggle' => true, |
|
25 | 25 | 'theme' => 'advanced', |
26 | 26 | 'language' => 'en', |
27 | 27 | 'access' => 1, |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | 'toolbar_loc' => 'top', |
31 | 31 | 'toolbar_align' => 'left', |
32 | 32 | 'path_loc' => 'bottom', |
33 | - 'resizing' => TRUE, |
|
33 | + 'resizing' => true, |
|
34 | 34 | // Also available, but buggy in TinyMCE 2.x: blockquote,code,dt,dd,samp. |
35 | 35 | 'block_formats' => 'p,address,pre,h2,h3,h4,h5,h6,div', |
36 | - 'verify_html' => TRUE, |
|
37 | - 'preformatted' => FALSE, |
|
38 | - 'convert_fonts_to_spans' => TRUE, |
|
39 | - 'remove_linebreaks' => TRUE, |
|
40 | - 'apply_source_formatting' => FALSE, |
|
41 | - 'paste_auto_cleanup_on_paste' => FALSE, |
|
36 | + 'verify_html' => true, |
|
37 | + 'preformatted' => false, |
|
38 | + 'convert_fonts_to_spans' => true, |
|
39 | + 'remove_linebreaks' => true, |
|
40 | + 'apply_source_formatting' => false, |
|
41 | + 'paste_auto_cleanup_on_paste' => false, |
|
42 | 42 | 'css_setting' => 'theme', |
43 | - 'css_path' => NULL, |
|
44 | - 'css_classes' => NULL, |
|
43 | + 'css_path' => null, |
|
44 | + 'css_classes' => null, |
|
45 | 45 | ); |
46 | 46 | $profile = (object) $profile; |
47 | 47 | |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | $form['basic'] = array( |
57 | 57 | '#type' => 'fieldset', |
58 | 58 | '#title' => t('Basic setup'), |
59 | - '#collapsible' => TRUE, |
|
60 | - '#collapsed' => TRUE, |
|
59 | + '#collapsible' => true, |
|
60 | + '#collapsed' => true, |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | $form['basic']['default'] = array( |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | $form['buttons'] = array( |
114 | 114 | '#type' => 'fieldset', |
115 | 115 | '#title' => t('Buttons and plugins'), |
116 | - '#collapsible' => TRUE, |
|
117 | - '#collapsed' => TRUE, |
|
118 | - '#tree' => TRUE, |
|
116 | + '#collapsible' => true, |
|
117 | + '#collapsed' => true, |
|
118 | + '#tree' => true, |
|
119 | 119 | '#theme' => 'wysiwyg_admin_button_table', |
120 | 120 | ); |
121 | 121 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $form['buttons'][$name][$button] = array( |
141 | 141 | '#type' => 'checkbox', |
142 | 142 | '#title' => $title, |
143 | - '#default_value' => !empty($profile->settings['buttons'][$name][$button]) ? $profile->settings['buttons'][$name][$button] : FALSE, |
|
143 | + '#default_value' => !empty($profile->settings['buttons'][$name][$button]) ? $profile->settings['buttons'][$name][$button] : false, |
|
144 | 144 | ); |
145 | 145 | } |
146 | 146 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $form['buttons'][$name][$extension] = array( |
150 | 150 | '#type' => 'checkbox', |
151 | 151 | '#title' => isset($meta['url']) ? l($title, $meta['url'], array('target' => '_blank')) : $title, |
152 | - '#default_value' => !empty($profile->settings['buttons'][$name][$extension]) ? $profile->settings['buttons'][$name][$extension] : FALSE, |
|
152 | + '#default_value' => !empty($profile->settings['buttons'][$name][$extension]) ? $profile->settings['buttons'][$name][$extension] : false, |
|
153 | 153 | ); |
154 | 154 | } |
155 | 155 | } |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | $form['appearance'] = array( |
159 | 159 | '#type' => 'fieldset', |
160 | 160 | '#title' => t('Editor appearance'), |
161 | - '#collapsible' => TRUE, |
|
162 | - '#collapsed' => TRUE, |
|
161 | + '#collapsible' => true, |
|
162 | + '#collapsed' => true, |
|
163 | 163 | ); |
164 | 164 | |
165 | 165 | $form['appearance']['toolbar_loc'] = array( |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | $form['output'] = array( |
198 | 198 | '#type' => 'fieldset', |
199 | 199 | '#title' => t('Cleanup and output'), |
200 | - '#collapsible' => TRUE, |
|
201 | - '#collapsed' => TRUE, |
|
200 | + '#collapsible' => true, |
|
201 | + '#collapsed' => true, |
|
202 | 202 | ); |
203 | 203 | |
204 | 204 | $form['output']['verify_html'] = array( |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | $form['css'] = array( |
253 | 253 | '#type' => 'fieldset', |
254 | 254 | '#title' => t('CSS'), |
255 | - '#collapsible' => TRUE, |
|
256 | - '#collapsed' => TRUE, |
|
255 | + '#collapsible' => true, |
|
256 | + '#collapsed' => true, |
|
257 | 257 | ); |
258 | 258 | |
259 | 259 | $form['css']['block_formats'] = array( |
@@ -422,16 +422,16 @@ discard block |
||
422 | 422 | } |
423 | 423 | // In case there is an error, always show installation instructions. |
424 | 424 | if (isset($editor['error'])) { |
425 | - $show_instructions = TRUE; |
|
425 | + $show_instructions = true; |
|
426 | 426 | } |
427 | 427 | } |
428 | 428 | if (!$count) { |
429 | - $show_instructions = TRUE; |
|
429 | + $show_instructions = true; |
|
430 | 430 | } |
431 | 431 | $form['status'] = array( |
432 | 432 | '#type' => 'fieldset', |
433 | 433 | '#title' => t('Installation instructions'), |
434 | - '#collapsible' => TRUE, |
|
434 | + '#collapsible' => true, |
|
435 | 435 | '#collapsed' => !isset($show_instructions), |
436 | 436 | '#description' => (!$count ? t('There are no editor libraries installed currently. The following list contains a list of currently supported editors:') : ''), |
437 | 437 | '#weight' => 10, |
@@ -444,15 +444,15 @@ discard block |
||
444 | 444 | |
445 | 445 | $formats = filter_formats(); |
446 | 446 | // Reset Wysiwyg cache |
447 | - $profiles = wysiwyg_profile_load_all(TRUE); |
|
447 | + $profiles = wysiwyg_profile_load_all(true); |
|
448 | 448 | $form['formats'] = array( |
449 | 449 | '#type' => 'item', |
450 | 450 | '#description' => t('To assign a different editor to a text format, click "delete" to remove the existing first.'), |
451 | - '#tree' => TRUE, |
|
451 | + '#tree' => true, |
|
452 | 452 | ); |
453 | 453 | |
454 | - $enable_save = FALSE; |
|
455 | - $in_code_only = FALSE; |
|
454 | + $enable_save = false; |
|
455 | + $in_code_only = false; |
|
456 | 456 | foreach ($formats as $id => $format) { |
457 | 457 | $form['formats'][$id]['name'] = array( |
458 | 458 | '#value' => check_plain($format->name), |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | '#default_value' => '', |
475 | 475 | '#options' => $options, |
476 | 476 | ); |
477 | - $enable_save = TRUE; |
|
477 | + $enable_save = true; |
|
478 | 478 | } |
479 | 479 | if (isset($profiles[$id]) && !empty($profiles[$id]->editor)) { |
480 | 480 | $edit = !empty($profiles[$id]->in_code_only)?t('Override'):t('Edit'); |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | if (isset($profile->type) && $profile->type == t('Overridden')) { |
546 | 546 | $form['revert'] = array( |
547 | 547 | '#type' => 'value', |
548 | - '#value' => TRUE, |
|
548 | + '#value' => true, |
|
549 | 549 | ); |
550 | 550 | return confirm_form( |
551 | 551 | $form, |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | function wysiwyg_profile_form($form_state, $profile) { |
12 | 12 | // Merge in defaults. |
13 | - $profile = (array) $profile; |
|
13 | + $profile = (array)$profile; |
|
14 | 14 | $profile += array( |
15 | 15 | 'format' => 0, |
16 | 16 | 'editor' => '', |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'css_path' => NULL, |
44 | 44 | 'css_classes' => NULL, |
45 | 45 | ); |
46 | - $profile = (object) $profile; |
|
46 | + $profile = (object)$profile; |
|
47 | 47 | |
48 | 48 | $formats = filter_formats(); |
49 | 49 | $editor = wysiwyg_get_editor($profile->editor); |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | if (!empty($meta['path'])) { |
129 | 129 | // @todo Button icon locations are different in editors, editor versions, |
130 | 130 | // and contrib/custom plugins (like Image Assist, f.e.). |
131 | - $img_src = $meta['path'] . "/images/$name.gif"; |
|
131 | + $img_src = $meta['path']."/images/$name.gif"; |
|
132 | 132 | // Handle plugins that have more than one button. |
133 | 133 | if (!file_exists($img_src)) { |
134 | - $img_src = $meta['path'] . "/images/$button.gif"; |
|
134 | + $img_src = $meta['path']."/images/$button.gif"; |
|
135 | 135 | } |
136 | - $icon = file_exists($img_src) ? '<img src="' . base_path() . $img_src . '" title="' . $button . '" style="border: 1px solid grey; vertical-align: middle;" />' : ''; |
|
136 | + $icon = file_exists($img_src) ? '<img src="'.base_path().$img_src.'" title="'.$button.'" style="border: 1px solid grey; vertical-align: middle;" />' : ''; |
|
137 | 137 | } |
138 | 138 | $title = (isset($meta['url']) ? l($title, $meta['url'], array('target' => '_blank')) : $title); |
139 | - $title = (!empty($icon) ? $icon . ' ' . $title : $title); |
|
139 | + $title = (!empty($icon) ? $icon.' '.$title : $title); |
|
140 | 140 | $form['buttons'][$name][$button] = array( |
141 | 141 | '#type' => 'checkbox', |
142 | 142 | '#title' => $title, |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | '#default_value' => $profile->settings['css_path'], |
280 | 280 | '#size' => 40, |
281 | 281 | '#maxlength' => 255, |
282 | - '#description' => t('If "Define CSS" was selected above, enter path to a CSS file or a list of CSS files separated by a comma.') . '<br />' . t('Available tokens: <code>%b</code> (base path, eg: <code>/</code>), <code>%t</code> (path to theme, eg: <code>themes/garland</code>)') . '<br />' . t('Example:') . ' css/editor.css,/themes/garland/style.css,%b%t/style.css,http://example.com/external.css', |
|
282 | + '#description' => t('If "Define CSS" was selected above, enter path to a CSS file or a list of CSS files separated by a comma.').'<br />'.t('Available tokens: <code>%b</code> (base path, eg: <code>/</code>), <code>%t</code> (path to theme, eg: <code>themes/garland</code>)').'<br />'.t('Example:').' css/editor.css,/themes/garland/style.css,%b%t/style.css,http://example.com/external.css', |
|
283 | 283 | ); |
284 | 284 | |
285 | 285 | $form['css']['css_classes'] = array( |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | 'description' => (isset($editor['error']) ? $editor['error'] : ''), |
405 | 405 | ); |
406 | 406 | if ($editor['installed']) { |
407 | - $options[$name] = $editor['title'] . (isset($editor['installed version']) ? ' ' . $editor['installed version'] : ''); |
|
407 | + $options[$name] = $editor['title'].(isset($editor['installed version']) ? ' '.$editor['installed version'] : ''); |
|
408 | 408 | } |
409 | 409 | else { |
410 | 410 | // Build on-site installation instructions. |
@@ -412,10 +412,10 @@ discard block |
||
412 | 412 | $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries'])); |
413 | 413 | $targs = array( |
414 | 414 | '@editor-path' => $editor['editor path'], |
415 | - '@library-filepath' => $editor['library path'] . '/' . (isset($editor['libraries'][$library]['files'][0]) ? $editor['libraries'][$library]['files'][0] : key($editor['libraries'][$library]['files'])), |
|
415 | + '@library-filepath' => $editor['library path'].'/'.(isset($editor['libraries'][$library]['files'][0]) ? $editor['libraries'][$library]['files'][0] : key($editor['libraries'][$library]['files'])), |
|
416 | 416 | ); |
417 | - $instructions = '<p>' . t('Extract the archive and copy its contents into a new folder in the following location:<br /><code>@editor-path</code>', $targs) . '</p>'; |
|
418 | - $instructions .= '<p>' . t('So the actual library can be found at:<br /><code>@library-filepath</code>', $targs) . '</p>'; |
|
417 | + $instructions = '<p>'.t('Extract the archive and copy its contents into a new folder in the following location:<br /><code>@editor-path</code>', $targs).'</p>'; |
|
418 | + $instructions .= '<p>'.t('So the actual library can be found at:<br /><code>@library-filepath</code>', $targs).'</p>'; |
|
419 | 419 | |
420 | 420 | $status[$name]['description'] .= $instructions; |
421 | 421 | $count--; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | '#value' => $options[$profiles[$id]->editor], |
466 | 466 | ); |
467 | 467 | if ($in_code_only) { |
468 | - $form['formats'][$id]['name']['#value'] .= ' <em>(' . t('From: !module module', array('!module' => $profiles[$id]->export_module)) . ')</em>'; |
|
468 | + $form['formats'][$id]['name']['#value'] .= ' <em>('.t('From: !module module', array('!module' => $profiles[$id]->export_module)).')</em>'; |
|
469 | 469 | } |
470 | 470 | } |
471 | 471 | else { |
@@ -477,13 +477,13 @@ discard block |
||
477 | 477 | $enable_save = TRUE; |
478 | 478 | } |
479 | 479 | if (isset($profiles[$id]) && !empty($profiles[$id]->editor)) { |
480 | - $edit = !empty($profiles[$id]->in_code_only)?t('Override'):t('Edit'); |
|
480 | + $edit = !empty($profiles[$id]->in_code_only) ?t('Override') : t('Edit'); |
|
481 | 481 | $form['formats'][$id]['edit'] = array( |
482 | 482 | '#value' => l($edit, "admin/settings/wysiwyg/profile/$id/edit"), |
483 | 483 | ); |
484 | 484 | // Only display delete/revert links for wysiwyg loaded from the database |
485 | 485 | if (!$in_code_only) { |
486 | - $delete = (empty($profiles[$id]->type) || $profiles[$id]->type == t('Normal'))?t('Delete'):t('Revert'); |
|
486 | + $delete = (empty($profiles[$id]->type) || $profiles[$id]->type == t('Normal')) ?t('Delete') : t('Revert'); |
|
487 | 487 | $form['formats'][$id]['delete'] = array( |
488 | 488 | '#value' => l($delete, "admin/settings/wysiwyg/profile/$id/delete"), |
489 | 489 | ); |
@@ -9,13 +9,13 @@ |
||
9 | 9 | * Implementation of hook_wysiwyg_plugin(). |
10 | 10 | */ |
11 | 11 | function wysiwyg_break_plugin() { |
12 | - $plugins['break'] = array( |
|
12 | + $plugins['break'] = array( |
|
13 | 13 | 'title' => t('Teaser break'), |
14 | 14 | 'vendor url' => 'http://drupal.org/project/wysiwyg', |
15 | 15 | 'icon file' => 'break.gif', |
16 | 16 | 'icon title' => t('Separate the teaser and body of this content'), |
17 | 17 | 'settings' => array(), |
18 | - ); |
|
19 | - return $plugins; |
|
18 | + ); |
|
19 | + return $plugins; |
|
20 | 20 | } |
21 | 21 |
@@ -9,25 +9,25 @@ discard block |
||
9 | 9 | * Menu callback; Output a wysiwyg plugin dialog page. |
10 | 10 | */ |
11 | 11 | function wysiwyg_dialog($plugin, $instance) { |
12 | - $plugins = wysiwyg_get_all_plugins(); |
|
13 | - if (!isset($plugins[$plugin])) { |
|
12 | + $plugins = wysiwyg_get_all_plugins(); |
|
13 | + if (!isset($plugins[$plugin])) { |
|
14 | 14 | return drupal_access_denied(); |
15 | - } |
|
16 | - $callback = $plugin . '_wysiwyg_dialog'; |
|
17 | - if (!function_exists($callback)) { |
|
15 | + } |
|
16 | + $callback = $plugin . '_wysiwyg_dialog'; |
|
17 | + if (!function_exists($callback)) { |
|
18 | 18 | return drupal_not_found(); |
19 | - } |
|
19 | + } |
|
20 | 20 | |
21 | - // Suppress admin menu. |
|
22 | - module_invoke('admin_menu', 'suppress'); |
|
23 | - // Add editor instance id to Drupal.settings. |
|
24 | - $settings = array( |
|
21 | + // Suppress admin menu. |
|
22 | + module_invoke('admin_menu', 'suppress'); |
|
23 | + // Add editor instance id to Drupal.settings. |
|
24 | + $settings = array( |
|
25 | 25 | 'plugin' => $plugin, |
26 | 26 | 'instance' => $instance, |
27 | - ); |
|
28 | - drupal_add_js(array('wysiwyg' => $settings), 'setting'); |
|
27 | + ); |
|
28 | + drupal_add_js(array('wysiwyg' => $settings), 'setting'); |
|
29 | 29 | |
30 | - echo theme('wysiwyg_dialog_page', $callback($instance)); |
|
30 | + echo theme('wysiwyg_dialog_page', $callback($instance)); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -38,26 +38,26 @@ discard block |
||
38 | 38 | * @see template_preprocess() |
39 | 39 | */ |
40 | 40 | function template_preprocess_wysiwyg_dialog_page(&$variables) { |
41 | - // Construct page title |
|
42 | - $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal')); |
|
41 | + // Construct page title |
|
42 | + $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal')); |
|
43 | 43 | |
44 | - $variables['head_title'] = implode(' | ', $head_title); |
|
45 | - $variables['base_path'] = base_path(); |
|
46 | - $variables['front_page'] = url(); |
|
47 | - // @todo Would a breadcrumb make sense / possible at all? |
|
48 | - // $variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb()); |
|
49 | - $variables['head'] = drupal_get_html_head(); |
|
50 | - $variables['help'] = theme('help'); |
|
51 | - $variables['language'] = $GLOBALS['language']; |
|
52 | - $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; |
|
53 | - $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : ''; |
|
54 | - $variables['site_name'] = (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : ''); |
|
55 | - $variables['css'] = drupal_add_css(); |
|
56 | - $variables['styles'] = drupal_get_css(); |
|
57 | - $variables['scripts'] = drupal_get_js(); |
|
58 | - $variables['tabs'] = theme('menu_local_tasks'); |
|
59 | - $variables['title'] = drupal_get_title(); |
|
60 | - // Closure should be filled last. |
|
61 | - $variables['closure'] = theme('closure'); |
|
44 | + $variables['head_title'] = implode(' | ', $head_title); |
|
45 | + $variables['base_path'] = base_path(); |
|
46 | + $variables['front_page'] = url(); |
|
47 | + // @todo Would a breadcrumb make sense / possible at all? |
|
48 | + // $variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb()); |
|
49 | + $variables['head'] = drupal_get_html_head(); |
|
50 | + $variables['help'] = theme('help'); |
|
51 | + $variables['language'] = $GLOBALS['language']; |
|
52 | + $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; |
|
53 | + $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : ''; |
|
54 | + $variables['site_name'] = (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : ''); |
|
55 | + $variables['css'] = drupal_add_css(); |
|
56 | + $variables['styles'] = drupal_get_css(); |
|
57 | + $variables['scripts'] = drupal_get_js(); |
|
58 | + $variables['tabs'] = theme('menu_local_tasks'); |
|
59 | + $variables['title'] = drupal_get_title(); |
|
60 | + // Closure should be filled last. |
|
61 | + $variables['closure'] = theme('closure'); |
|
62 | 62 | } |
63 | 63 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | if (!isset($plugins[$plugin])) { |
14 | 14 | return drupal_access_denied(); |
15 | 15 | } |
16 | - $callback = $plugin . '_wysiwyg_dialog'; |
|
16 | + $callback = $plugin.'_wysiwyg_dialog'; |
|
17 | 17 | if (!function_exists($callback)) { |
18 | 18 | return drupal_not_found(); |
19 | 19 | } |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | * plugin meta-information as values. |
37 | 37 | */ |
38 | 38 | function hook_wysiwyg_plugin($editor, $version) { |
39 | - switch ($editor) { |
|
39 | + switch ($editor) { |
|
40 | 40 | case 'tinymce': |
41 | 41 | if ($version > 3) { |
42 | 42 | return array( |
43 | - 'myplugin' => array( |
|
43 | + 'myplugin' => array( |
|
44 | 44 | // A URL to the plugin's homepage. |
45 | 45 | 'url' => 'http://drupal.org/project/img_assist', |
46 | 46 | // The full path to the native editor plugin, no trailing slash. |
@@ -54,19 +54,19 @@ discard block |
||
54 | 54 | // match the corresponding JavaScript implementation. The value is |
55 | 55 | // is displayed on the editor configuration form only. |
56 | 56 | 'buttons' => array( |
57 | - 'img_assist' => t('Image Assist'), |
|
57 | + 'img_assist' => t('Image Assist'), |
|
58 | 58 | ), |
59 | 59 | // A list of editor extensions provided by this native plugin. |
60 | 60 | // Extensions are not displayed as buttons and touch the editor's |
61 | 61 | // internals, so you should know what you are doing. |
62 | 62 | 'extensions' => array( |
63 | - 'imce' => t('IMCE'), |
|
63 | + 'imce' => t('IMCE'), |
|
64 | 64 | ), |
65 | 65 | // A list of global, native editor configuration settings to |
66 | 66 | // override. To be used rarely and only when required. |
67 | 67 | 'options' => array( |
68 | - 'file_browser_callback' => 'imceImageBrowser', |
|
69 | - 'inline_styles' => TRUE, |
|
68 | + 'file_browser_callback' => 'imceImageBrowser', |
|
69 | + 'inline_styles' => TRUE, |
|
70 | 70 | ), |
71 | 71 | // Boolean whether the editor needs to load this plugin. When TRUE, |
72 | 72 | // the editor will automatically load the plugin based on the 'path' |
@@ -81,13 +81,13 @@ discard block |
||
81 | 81 | 'internal' => TRUE, |
82 | 82 | // TinyMCE-specific: Additional HTML elements to allow in the markup. |
83 | 83 | 'extended_valid_elements' => array( |
84 | - 'img[class|src|border=0|alt|title|width|height|align|name|style]', |
|
84 | + 'img[class|src|border=0|alt|title|width|height|align|name|style]', |
|
85 | + ), |
|
85 | 86 | ), |
86 | - ), |
|
87 | 87 | ); |
88 | - } |
|
89 | - break; |
|
90 | - } |
|
88 | + } |
|
89 | + break; |
|
90 | + } |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | * Wysiwyg module. |
102 | 102 | */ |
103 | 103 | function hook_wysiwyg_include_directory($type) { |
104 | - switch ($type) { |
|
104 | + switch ($type) { |
|
105 | 105 | case 'plugins': |
106 | 106 | // You can just return $type, if you place your Wysiwyg plugins into a |
107 | 107 | // sub-directory named 'plugins'. |
108 | 108 | return $type; |
109 | - } |
|
109 | + } |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * Meta information about the buttons provided by this plugin. |
137 | 137 | */ |
138 | 138 | function hook_INCLUDE_plugin() { |
139 | - $plugins['awesome'] = array( |
|
139 | + $plugins['awesome'] = array( |
|
140 | 140 | // The plugin's title; defaulting to its internal name ('awesome'). |
141 | 141 | 'title' => t('Awesome plugin'), |
142 | 142 | // The (vendor) homepage of this plugin; defaults to ''. |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | ), |
166 | 166 | // TinyMCE-specific: Additional HTML elements to allow in the markup. |
167 | 167 | 'extended_valid_elements' => array( |
168 | - 'tag1[attribute1|attribute2]', |
|
169 | - 'tag2[attribute3|attribute4]', |
|
168 | + 'tag1[attribute1|attribute2]', |
|
169 | + 'tag2[attribute3|attribute4]', |
|
170 | 170 | ), |
171 | - ); |
|
172 | - return $plugins; |
|
171 | + ); |
|
172 | + return $plugins; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | * - theme: The name of the editor theme/skin. |
197 | 197 | */ |
198 | 198 | function hook_wysiwyg_editor_settings_alter(&$settings, $context) { |
199 | - // Each editor has its own collection of native settings that may be extended |
|
200 | - // or overridden. Please consult the respective official vendor documentation |
|
201 | - // for details. |
|
202 | - if ($context['profile']->editor == 'tinymce') { |
|
199 | + // Each editor has its own collection of native settings that may be extended |
|
200 | + // or overridden. Please consult the respective official vendor documentation |
|
201 | + // for details. |
|
202 | + if ($context['profile']->editor == 'tinymce') { |
|
203 | 203 | // Supported values to JSON data types. |
204 | 204 | $settings['cleanup_on_startup'] = TRUE; |
205 | - } |
|
205 | + } |
|
206 | 206 | } |
@@ -37,56 +37,56 @@ discard block |
||
37 | 37 | */ |
38 | 38 | function hook_wysiwyg_plugin($editor, $version) { |
39 | 39 | switch ($editor) { |
40 | - case 'tinymce': |
|
41 | - if ($version > 3) { |
|
42 | - return array( |
|
43 | - 'myplugin' => array( |
|
44 | - // A URL to the plugin's homepage. |
|
45 | - 'url' => 'http://drupal.org/project/img_assist', |
|
46 | - // The full path to the native editor plugin, no trailing slash. |
|
47 | - // Ignored when 'internal' is set to TRUE below. |
|
48 | - 'path' => drupal_get_path('module', 'img_assist') . '/drupalimage', |
|
49 | - // The name of the plugin's main JavaScript file. |
|
50 | - // Ignored when 'internal' is set to TRUE below. |
|
51 | - // Default value depends on which editor the plugin is for. |
|
52 | - 'filename' => 'editor_plugin.js', |
|
53 | - // A list of buttons provided by this native plugin. The key has to |
|
54 | - // match the corresponding JavaScript implementation. The value is |
|
55 | - // is displayed on the editor configuration form only. |
|
56 | - 'buttons' => array( |
|
57 | - 'img_assist' => t('Image Assist'), |
|
58 | - ), |
|
59 | - // A list of editor extensions provided by this native plugin. |
|
60 | - // Extensions are not displayed as buttons and touch the editor's |
|
61 | - // internals, so you should know what you are doing. |
|
62 | - 'extensions' => array( |
|
63 | - 'imce' => t('IMCE'), |
|
64 | - ), |
|
65 | - // A list of global, native editor configuration settings to |
|
66 | - // override. To be used rarely and only when required. |
|
67 | - 'options' => array( |
|
68 | - 'file_browser_callback' => 'imceImageBrowser', |
|
69 | - 'inline_styles' => TRUE, |
|
70 | - ), |
|
71 | - // Boolean whether the editor needs to load this plugin. When TRUE, |
|
72 | - // the editor will automatically load the plugin based on the 'path' |
|
73 | - // variable provided. If FALSE, the plugin either does not need to |
|
74 | - // be loaded or is already loaded by something else on the page. |
|
75 | - // Most plugins should define TRUE here. |
|
76 | - 'load' => TRUE, |
|
77 | - // Boolean whether this plugin is a native plugin, i.e. shipped with |
|
78 | - // the editor. Definition must be ommitted for plugins provided by |
|
79 | - // other modules. TRUE means 'path' and 'filename' above are ignored |
|
80 | - // and the plugin is instead loaded from the editor's plugin folder. |
|
81 | - 'internal' => TRUE, |
|
82 | - // TinyMCE-specific: Additional HTML elements to allow in the markup. |
|
83 | - 'extended_valid_elements' => array( |
|
84 | - 'img[class|src|border=0|alt|title|width|height|align|name|style]', |
|
85 | - ), |
|
40 | + case 'tinymce': |
|
41 | + if ($version > 3) { |
|
42 | + return array( |
|
43 | + 'myplugin' => array( |
|
44 | + // A URL to the plugin's homepage. |
|
45 | + 'url' => 'http://drupal.org/project/img_assist', |
|
46 | + // The full path to the native editor plugin, no trailing slash. |
|
47 | + // Ignored when 'internal' is set to TRUE below. |
|
48 | + 'path' => drupal_get_path('module', 'img_assist') . '/drupalimage', |
|
49 | + // The name of the plugin's main JavaScript file. |
|
50 | + // Ignored when 'internal' is set to TRUE below. |
|
51 | + // Default value depends on which editor the plugin is for. |
|
52 | + 'filename' => 'editor_plugin.js', |
|
53 | + // A list of buttons provided by this native plugin. The key has to |
|
54 | + // match the corresponding JavaScript implementation. The value is |
|
55 | + // is displayed on the editor configuration form only. |
|
56 | + 'buttons' => array( |
|
57 | + 'img_assist' => t('Image Assist'), |
|
86 | 58 | ), |
87 | - ); |
|
88 | - } |
|
89 | - break; |
|
59 | + // A list of editor extensions provided by this native plugin. |
|
60 | + // Extensions are not displayed as buttons and touch the editor's |
|
61 | + // internals, so you should know what you are doing. |
|
62 | + 'extensions' => array( |
|
63 | + 'imce' => t('IMCE'), |
|
64 | + ), |
|
65 | + // A list of global, native editor configuration settings to |
|
66 | + // override. To be used rarely and only when required. |
|
67 | + 'options' => array( |
|
68 | + 'file_browser_callback' => 'imceImageBrowser', |
|
69 | + 'inline_styles' => TRUE, |
|
70 | + ), |
|
71 | + // Boolean whether the editor needs to load this plugin. When TRUE, |
|
72 | + // the editor will automatically load the plugin based on the 'path' |
|
73 | + // variable provided. If FALSE, the plugin either does not need to |
|
74 | + // be loaded or is already loaded by something else on the page. |
|
75 | + // Most plugins should define TRUE here. |
|
76 | + 'load' => TRUE, |
|
77 | + // Boolean whether this plugin is a native plugin, i.e. shipped with |
|
78 | + // the editor. Definition must be ommitted for plugins provided by |
|
79 | + // other modules. TRUE means 'path' and 'filename' above are ignored |
|
80 | + // and the plugin is instead loaded from the editor's plugin folder. |
|
81 | + 'internal' => TRUE, |
|
82 | + // TinyMCE-specific: Additional HTML elements to allow in the markup. |
|
83 | + 'extended_valid_elements' => array( |
|
84 | + 'img[class|src|border=0|alt|title|width|height|align|name|style]', |
|
85 | + ), |
|
86 | + ), |
|
87 | + ); |
|
88 | + } |
|
89 | + break; |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | */ |
103 | 103 | function hook_wysiwyg_include_directory($type) { |
104 | 104 | switch ($type) { |
105 | - case 'plugins': |
|
106 | - // You can just return $type, if you place your Wysiwyg plugins into a |
|
107 | - // sub-directory named 'plugins'. |
|
108 | - return $type; |
|
105 | + case 'plugins': |
|
106 | + // You can just return $type, if you place your Wysiwyg plugins into a |
|
107 | + // sub-directory named 'plugins'. |
|
108 | + return $type; |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'url' => 'http://drupal.org/project/img_assist', |
46 | 46 | // The full path to the native editor plugin, no trailing slash. |
47 | 47 | // Ignored when 'internal' is set to TRUE below. |
48 | - 'path' => drupal_get_path('module', 'img_assist') . '/drupalimage', |
|
48 | + 'path' => drupal_get_path('module', 'img_assist').'/drupalimage', |
|
49 | 49 | // The name of the plugin's main JavaScript file. |
50 | 50 | // Ignored when 'internal' is set to TRUE below. |
51 | 51 | // Default value depends on which editor the plugin is for. |
@@ -150,13 +150,13 @@ discard block |
||
150 | 150 | 'icon title' => t('Do something'), |
151 | 151 | // An alternative path to the integration JavaScript; defaults to |
152 | 152 | // '[path-to-module]/[plugins-directory]/[plugin-name]'. |
153 | - 'js path' => drupal_get_path('module', 'mymodule') . '/awesomeness', |
|
153 | + 'js path' => drupal_get_path('module', 'mymodule').'/awesomeness', |
|
154 | 154 | // An alternative filename of the integration JavaScript; defaults to |
155 | 155 | // '[plugin-name].js'. |
156 | 156 | 'js file' => 'awesome.js', |
157 | 157 | // An alternative path to the integration stylesheet; defaults to |
158 | 158 | // '[path-to-module]/[plugins-directory]/[plugin-name]'. |
159 | - 'css path' => drupal_get_path('module', 'mymodule') . '/awesomeness', |
|
159 | + 'css path' => drupal_get_path('module', 'mymodule').'/awesomeness', |
|
160 | 160 | // An alternative filename of the integration stylesheet; defaults to |
161 | 161 | // '[plugin-name].css'. |
162 | 162 | 'css file' => 'awesome.css', |
@@ -66,19 +66,19 @@ discard block |
||
66 | 66 | // override. To be used rarely and only when required. |
67 | 67 | 'options' => array( |
68 | 68 | 'file_browser_callback' => 'imceImageBrowser', |
69 | - 'inline_styles' => TRUE, |
|
69 | + 'inline_styles' => true, |
|
70 | 70 | ), |
71 | 71 | // Boolean whether the editor needs to load this plugin. When TRUE, |
72 | 72 | // the editor will automatically load the plugin based on the 'path' |
73 | 73 | // variable provided. If FALSE, the plugin either does not need to |
74 | 74 | // be loaded or is already loaded by something else on the page. |
75 | 75 | // Most plugins should define TRUE here. |
76 | - 'load' => TRUE, |
|
76 | + 'load' => true, |
|
77 | 77 | // Boolean whether this plugin is a native plugin, i.e. shipped with |
78 | 78 | // the editor. Definition must be ommitted for plugins provided by |
79 | 79 | // other modules. TRUE means 'path' and 'filename' above are ignored |
80 | 80 | // and the plugin is instead loaded from the editor's plugin folder. |
81 | - 'internal' => TRUE, |
|
81 | + 'internal' => true, |
|
82 | 82 | // TinyMCE-specific: Additional HTML elements to allow in the markup. |
83 | 83 | 'extended_valid_elements' => array( |
84 | 84 | 'img[class|src|border=0|alt|title|width|height|align|name|style]', |
@@ -201,6 +201,6 @@ discard block |
||
201 | 201 | // for details. |
202 | 202 | if ($context['profile']->editor == 'tinymce') { |
203 | 203 | // Supported values to JSON data types. |
204 | - $settings['cleanup_on_startup'] = TRUE; |
|
204 | + $settings['cleanup_on_startup'] = true; |
|
205 | 205 | } |
206 | 206 | } |
@@ -17,14 +17,14 @@ |
||
17 | 17 | * Implementation of hook_menu(). |
18 | 18 | */ |
19 | 19 | function forum_tweaks_menu() { |
20 | - // Note that this comes straight out of the Advanced Forum module. As such, |
|
21 | - // it should be removed should said module be added at a future point in time |
|
22 | - $items['community/forum/%/read'] = array( |
|
20 | + // Note that this comes straight out of the Advanced Forum module. As such, |
|
21 | + // it should be removed should said module be added at a future point in time |
|
22 | + $items['community/forum/%/read'] = array( |
|
23 | 23 | 'access callback' => 'forum_tweaks_markasread_access', |
24 | 24 | 'page arguments' => array(2), |
25 | 25 | 'page callback' => 'forum_tweaks_markasread', |
26 | 26 | 'type' => MENU_CALLBACK, |
27 | 27 | 'file' => 'includes/mark-read.inc', |
28 | - ); |
|
29 | - return $items; |
|
28 | + ); |
|
29 | + return $items; |
|
30 | 30 | } |
@@ -13,31 +13,31 @@ discard block |
||
13 | 13 | * Either fill a $links array or return a string version of the link to mark read. |
14 | 14 | */ |
15 | 15 | function forum_tweaks_get_mark_read_link($tid = 0, &$links = array()) { |
16 | - if (forum_tweaks_markasread_access() && !in_array($tid, variable_get('forum_containers', array()))) { |
|
16 | + if (forum_tweaks_markasread_access() && !in_array($tid, variable_get('forum_containers', array()))) { |
|
17 | 17 | if ($tid) { |
18 | - $links['mark-read']['title'] = t('Mark all topics read'); |
|
19 | - $links['mark-read']['href'] = "community/forum/{$tid}/read"; |
|
18 | + $links['mark-read']['title'] = t('Mark all topics read'); |
|
19 | + $links['mark-read']['href'] = "community/forum/{$tid}/read"; |
|
20 | 20 | |
21 | - return l(t('Mark all topics read') . '<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => TRUE)); |
|
21 | + return l(t('Mark all topics read') . '<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => TRUE)); |
|
22 | 22 | } |
23 | 23 | else { |
24 | - $links['mark-read']['title'] = t('Mark all forums read'); |
|
25 | - $links['mark-read']['href'] = "community/forum/0/read"; |
|
24 | + $links['mark-read']['title'] = t('Mark all forums read'); |
|
25 | + $links['mark-read']['href'] = "community/forum/0/read"; |
|
26 | 26 | |
27 | - return l(t('Mark all forums read') . '<span class="image-replace"></span>', "forum/markasread", array('html' => TRUE)); |
|
27 | + return l(t('Mark all forums read') . '<span class="image-replace"></span>', "forum/markasread", array('html' => TRUE)); |
|
28 | + } |
|
28 | 29 | } |
29 | - } |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Marks all posts in forums or in a given forum as read by the current user. |
34 | 34 | */ |
35 | 35 | function forum_tweaks_markasread($current_forum_id = 0) { |
36 | - global $user; |
|
36 | + global $user; |
|
37 | 37 | |
38 | - // See if we're on a forum or on the forum overview |
|
39 | - // Path will be /forum/markasread or /forum/markasread/tid |
|
40 | - if ($current_forum_id) { |
|
38 | + // See if we're on a forum or on the forum overview |
|
39 | + // Path will be /forum/markasread or /forum/markasread/tid |
|
40 | + if ($current_forum_id) { |
|
41 | 41 | // Delete the current history entries so already visited nodes get updated. |
42 | 42 | $sql = "DELETE h |
43 | 43 | FROM {history} AS h |
@@ -58,26 +58,26 @@ discard block |
||
58 | 58 | |
59 | 59 | // Readpath integration |
60 | 60 | if (module_exists('readpath')) { |
61 | - readpath_clear_readpath(); |
|
61 | + readpath_clear_readpath(); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | drupal_set_message(t('All content in this forum has been marked as read')); |
65 | 65 | drupal_goto('community/forum/' . $current_forum_id); |
66 | - } |
|
66 | + } |
|
67 | 67 | |
68 | - // We are on the forum overview, requesting all forums be marked read |
|
69 | - $forum_vocabulary_id = variable_get('forum_nav_vocabulary', ''); |
|
68 | + // We are on the forum overview, requesting all forums be marked read |
|
69 | + $forum_vocabulary_id = variable_get('forum_nav_vocabulary', ''); |
|
70 | 70 | |
71 | - // Delete the current history entries so already visited nodes get updated. |
|
72 | - $sql = "DELETE h |
|
71 | + // Delete the current history entries so already visited nodes get updated. |
|
72 | + $sql = "DELETE h |
|
73 | 73 | FROM {history} AS h |
74 | 74 | INNER JOIN {term_node} AS tn ON (h.nid = tn.nid) |
75 | 75 | INNER JOIN {term_data} AS td ON (td.tid = tn.tid) |
76 | 76 | WHERE h.uid = %d AND td.vid = %d"; |
77 | - db_query($sql, $user->uid, $forum_vocabulary_id); |
|
77 | + db_query($sql, $user->uid, $forum_vocabulary_id); |
|
78 | 78 | |
79 | - // Update the history table with all forum nodes newer than the cutoff. |
|
80 | - $sql = "INSERT INTO {history} (uid, nid, timestamp) |
|
79 | + // Update the history table with all forum nodes newer than the cutoff. |
|
80 | + $sql = "INSERT INTO {history} (uid, nid, timestamp) |
|
81 | 81 | SELECT DISTINCT %d, n.nid, %d |
82 | 82 | FROM {node} AS n |
83 | 83 | INNER JOIN {term_node} AS tn ON n.nid=tn.nid |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | INNER JOIN {term_data} AS td ON tn.tid = td.tid |
86 | 86 | WHERE (n.changed > %d OR ncs.last_comment_timestamp > %d) AND td.vid = %d"; |
87 | 87 | |
88 | - $args = array($user->uid, time(), NODE_NEW_LIMIT, NODE_NEW_LIMIT, $forum_vocabulary_id); |
|
88 | + $args = array($user->uid, time(), NODE_NEW_LIMIT, NODE_NEW_LIMIT, $forum_vocabulary_id); |
|
89 | 89 | |
90 | - db_query($sql, $args); |
|
90 | + db_query($sql, $args); |
|
91 | 91 | |
92 | - drupal_set_message(t('All forum content has been marked as read')); |
|
93 | - drupal_goto('community/forum'); |
|
92 | + drupal_set_message(t('All forum content has been marked as read')); |
|
93 | + drupal_goto('community/forum'); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -101,6 +101,6 @@ discard block |
||
101 | 101 | * cached and re-used for other users. |
102 | 102 | */ |
103 | 103 | function forum_tweaks_markasread_access() { |
104 | - global $user; |
|
105 | - return user_access('access content') && $user->uid; |
|
104 | + global $user; |
|
105 | + return user_access('access content') && $user->uid; |
|
106 | 106 | } |
@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | $links['mark-read']['title'] = t('Mark all topics read'); |
19 | 19 | $links['mark-read']['href'] = "community/forum/{$tid}/read"; |
20 | 20 | |
21 | - return l(t('Mark all topics read') . '<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => TRUE)); |
|
21 | + return l(t('Mark all topics read').'<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => TRUE)); |
|
22 | 22 | } |
23 | 23 | else { |
24 | 24 | $links['mark-read']['title'] = t('Mark all forums read'); |
25 | 25 | $links['mark-read']['href'] = "community/forum/0/read"; |
26 | 26 | |
27 | - return l(t('Mark all forums read') . '<span class="image-replace"></span>', "forum/markasread", array('html' => TRUE)); |
|
27 | + return l(t('Mark all forums read').'<span class="image-replace"></span>', "forum/markasread", array('html' => TRUE)); |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | drupal_set_message(t('All content in this forum has been marked as read')); |
65 | - drupal_goto('community/forum/' . $current_forum_id); |
|
65 | + drupal_goto('community/forum/'.$current_forum_id); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // We are on the forum overview, requesting all forums be marked read |
@@ -19,8 +19,7 @@ |
||
19 | 19 | $links['mark-read']['href'] = "community/forum/{$tid}/read"; |
20 | 20 | |
21 | 21 | return l(t('Mark all topics read') . '<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => TRUE)); |
22 | - } |
|
23 | - else { |
|
22 | + } else { |
|
24 | 23 | $links['mark-read']['title'] = t('Mark all forums read'); |
25 | 24 | $links['mark-read']['href'] = "community/forum/0/read"; |
26 | 25 |
@@ -18,13 +18,13 @@ |
||
18 | 18 | $links['mark-read']['title'] = t('Mark all topics read'); |
19 | 19 | $links['mark-read']['href'] = "community/forum/{$tid}/read"; |
20 | 20 | |
21 | - return l(t('Mark all topics read') . '<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => TRUE)); |
|
21 | + return l(t('Mark all topics read') . '<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => true)); |
|
22 | 22 | } |
23 | 23 | else { |
24 | 24 | $links['mark-read']['title'] = t('Mark all forums read'); |
25 | 25 | $links['mark-read']['href'] = "community/forum/0/read"; |
26 | 26 | |
27 | - return l(t('Mark all forums read') . '<span class="image-replace"></span>', "forum/markasread", array('html' => TRUE)); |
|
27 | + return l(t('Mark all forums read') . '<span class="image-replace"></span>', "forum/markasread", array('html' => true)); |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | } |
@@ -2,38 +2,38 @@ discard block |
||
2 | 2 | // $Id: bbcode.module,v 1.50 2008/02/07 14:05:30 naudefj Exp $ |
3 | 3 | |
4 | 4 | function bbcode_help($section) { |
5 | - if ($section == 'admin/modules#description') |
|
5 | + if ($section == 'admin/modules#description') |
|
6 | 6 | return t('Allow the use of BBCode in your posts.'); |
7 | 7 | } |
8 | 8 | |
9 | 9 | function bbcode_filter_tips($delta, $format, $long = false) { |
10 | - if ($long) { |
|
10 | + if ($long) { |
|
11 | 11 | include_once(drupal_get_path('module', 'bbcode') .'/bbcode-help.inc'); |
12 | 12 | return _bbcode_filter_tip(); |
13 | - } |
|
14 | - else { |
|
13 | + } |
|
14 | + else { |
|
15 | 15 | # D5: $output = t('You can use !BBCode tags in the text.', array('!BBCode' => l(t('BBCode'), "filter/tips/$format", NULL, NULL, 'filter-bbcode-' . $delta))); |
16 | 16 | $output = t('You can use !BBCode (opens in new window) tags in the text.', |
17 | - array( |
|
17 | + array( |
|
18 | 18 | '!BBCode' => l(t('BBCode'), "filter/tips/$format", |
19 | 19 | array( |
20 | - 'fragment' => 'filter-bbcode-' . $delta, |
|
21 | - 'attributes' => |
|
22 | - array( |
|
23 | - 'target'=>'_blank', |
|
24 | - 'rel'=>'noopener noreferrer', |
|
25 | - ), |
|
20 | + 'fragment' => 'filter-bbcode-' . $delta, |
|
21 | + 'attributes' => |
|
22 | + array( |
|
23 | + 'target'=>'_blank', |
|
24 | + 'rel'=>'noopener noreferrer', |
|
25 | + ), |
|
26 | 26 | )) |
27 | - )); |
|
27 | + )); |
|
28 | 28 | if (variable_get("bbcode_make_links_$format", FALSE)) { |
29 | - $output .= ' '. t('URLs will automatically be converted to links.'); |
|
29 | + $output .= ' '. t('URLs will automatically be converted to links.'); |
|
30 | 30 | } |
31 | 31 | return $output; |
32 | - } |
|
32 | + } |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | function bbcode_filter($op, $delta = 0, $format = -1, $text = '') { |
36 | - switch ($op) { |
|
36 | + switch ($op) { |
|
37 | 37 | case 'list': |
38 | 38 | return array(0 => t('BBCode')); |
39 | 39 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | case 'process': |
44 | 44 | include_once(drupal_get_path('module', 'bbcode') .'/bbcode-filter.inc'); |
45 | - if (variable_get("bbcode_debug_$format", 0)) { |
|
45 | + if (variable_get("bbcode_debug_$format", 0)) { |
|
46 | 46 | $timing_start = explode(' ', microtime()); |
47 | 47 | $ret = _bbcode_filter_process($text, $format); |
48 | 48 | $timing_stop = explode(' ', microtime()); |
@@ -50,99 +50,99 @@ discard block |
||
50 | 50 | $elapsed += $timing_stop[0] - $timing_start[0]; |
51 | 51 | $ret .= '<hr />'. l('BBCode', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.<hr />'; |
52 | 52 | return $ret; |
53 | - } |
|
54 | - else |
|
53 | + } |
|
54 | + else |
|
55 | 55 | return _bbcode_filter_process($text, $format); |
56 | 56 | |
57 | 57 | case 'settings': |
58 | 58 | $form = array(); |
59 | - $form['bbcode_filter'] = array( |
|
59 | + $form['bbcode_filter'] = array( |
|
60 | 60 | '#type' => 'fieldset', |
61 | 61 | '#title' => t('BBCode filter'), |
62 | 62 | '#collapsible' => TRUE, |
63 | 63 | '#collapsed' => FALSE); |
64 | - $form['bbcode_filter']["bbcode_make_links_$format"] = array( |
|
64 | + $form['bbcode_filter']["bbcode_make_links_$format"] = array( |
|
65 | 65 | '#type' => 'select', |
66 | 66 | '#title' => t('Convert addresses to links'), |
67 | 67 | '#default_value' => variable_get("bbcode_make_links_$format", 1), |
68 | 68 | '#options' => array(t('Disabled'), t('Enabled')), |
69 | 69 | '#description' => t('Turn web and e-mail addresses into clickable links. This is useful if content authors do not explicitly mark addresses as links with [url] and [email] tags.')); |
70 | - $form['bbcode_filter']["bbcode_filter_nofollow_$format"] = array( |
|
70 | + $form['bbcode_filter']["bbcode_filter_nofollow_$format"] = array( |
|
71 | 71 | '#type' => 'select', |
72 | 72 | '#title' => t('Spam link deterrent'), |
73 | 73 | '#default_value' => variable_get("bbcode_filter_nofollow_$format", 0), |
74 | 74 | '#options' => array(t('Disabled'), t('Enabled')), |
75 | 75 | '#description' => t('If enabled, BBCode will add rel="nofollow" to all links, as a measure to reduce the effectiveness of spam links. Note: this will also prevent valid links from being followed by search engines, therefore it is likely most effective when enabled for anonymous users.')); |
76 | - $form['bbcode_filter']["bbcode_encode_mailto_$format"] = array( |
|
76 | + $form['bbcode_filter']["bbcode_encode_mailto_$format"] = array( |
|
77 | 77 | '#type' => 'select', |
78 | 78 | '#title' => t('Email address encoding'), |
79 | 79 | '#default_value' => variable_get("bbcode_encode_mailto_$format", 1), |
80 | 80 | '#options' => array(t('Disabled'), t('Enabled')), |
81 | 81 | '#description' => t('Whether to encode email addresses with javascript. With this method you will have clickable mailto links, but it will be a bit harder for spam robots to collect them.')); |
82 | - $form['bbcode_filter']["bbcode_paragraph_breaks_$format"] = array( |
|
82 | + $form['bbcode_filter']["bbcode_paragraph_breaks_$format"] = array( |
|
83 | 83 | '#type' => 'select', |
84 | 84 | '#title' => t('Smart paragraph and line breaks'), |
85 | 85 | '#default_value' => variable_get("bbcode_paragraph_breaks_$format", 2), |
86 | 86 | '#options' => array(t('Disabled'), t('Line breaks only'), t('Line and paragraph breaks')), |
87 | 87 | '#description' => t('Add line and paragraph breaks to text, excluding text in preformatted code blocks. If you disable this option, you need to enable Drupal\'s "Line break converter". Don\'t use both together!')); |
88 | - $form['bbcode_filter']["bbcode_debug_$format"] = array( |
|
88 | + $form['bbcode_filter']["bbcode_debug_$format"] = array( |
|
89 | 89 | '#type' => 'select', |
90 | 90 | '#title' => t('Print debugging info'), |
91 | 91 | '#default_value' => variable_get("bbcode_debug_$format", 0), |
92 | 92 | '#options' => array(t('Disabled'), t('Enabled')), |
93 | 93 | '#description' => t('Print BBCode parse date and execution time. This option should be disabled on production sites. You may need to clear the cache after changing this option.')); |
94 | - return $form; |
|
94 | + return $form; |
|
95 | 95 | |
96 | 96 | default: |
97 | 97 | return $text; |
98 | - } |
|
98 | + } |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /* hook_quicktags_alter |
102 | 102 | * Alter icons if the quicktags module is enabled |
103 | 103 | */ |
104 | 104 | function bbcode_quicktags_alter($items) { |
105 | - $path = base_path() . drupal_get_path('module','quicktags') .'/'; |
|
106 | - $items['ed_italic'] = array( |
|
107 | - 'name' => 'italic', |
|
108 | - 'prefix' => '[i]', |
|
109 | - 'suffix' => '[/i]', |
|
110 | - 'accesskey' => 'i', |
|
111 | - 'weight' => 10, |
|
112 | - 'icon' => $path .'ed_italic.png', |
|
105 | + $path = base_path() . drupal_get_path('module','quicktags') .'/'; |
|
106 | + $items['ed_italic'] = array( |
|
107 | + 'name' => 'italic', |
|
108 | + 'prefix' => '[i]', |
|
109 | + 'suffix' => '[/i]', |
|
110 | + 'accesskey' => 'i', |
|
111 | + 'weight' => 10, |
|
112 | + 'icon' => $path .'ed_italic.png', |
|
113 | 113 | ); |
114 | - $items['ed_bold'] = array( |
|
115 | - 'name' => 'bold', |
|
116 | - 'prefix' => '[b]', |
|
117 | - 'suffix' => '[/b]', |
|
118 | - 'accesskey' => 'b', |
|
119 | - 'weight' => 20, |
|
120 | - 'icon' => $path .'ed_bold.png', |
|
114 | + $items['ed_bold'] = array( |
|
115 | + 'name' => 'bold', |
|
116 | + 'prefix' => '[b]', |
|
117 | + 'suffix' => '[/b]', |
|
118 | + 'accesskey' => 'b', |
|
119 | + 'weight' => 20, |
|
120 | + 'icon' => $path .'ed_bold.png', |
|
121 | 121 | ); |
122 | - $items['ed_code'] = array( |
|
123 | - 'name' => 'code', |
|
124 | - 'prefix' =>'[code]', |
|
125 | - 'suffix' => '[/code]', |
|
126 | - 'accesskey' => 'c', |
|
127 | - 'weight' => 30, |
|
128 | - 'icon' => $path .'ed_code.png', |
|
122 | + $items['ed_code'] = array( |
|
123 | + 'name' => 'code', |
|
124 | + 'prefix' =>'[code]', |
|
125 | + 'suffix' => '[/code]', |
|
126 | + 'accesskey' => 'c', |
|
127 | + 'weight' => 30, |
|
128 | + 'icon' => $path .'ed_code.png', |
|
129 | 129 | ); |
130 | - $items['ed_block'] = array( |
|
131 | - 'name' => 'quote', |
|
132 | - 'prefix' =>'[quote]', |
|
133 | - 'suffix' => '[/quote]', |
|
134 | - 'accesskey' => 'q', |
|
135 | - 'weight' => 40, |
|
136 | - 'icon' => $path .'ed_block.png', |
|
130 | + $items['ed_block'] = array( |
|
131 | + 'name' => 'quote', |
|
132 | + 'prefix' =>'[quote]', |
|
133 | + 'suffix' => '[/quote]', |
|
134 | + 'accesskey' => 'q', |
|
135 | + 'weight' => 40, |
|
136 | + 'icon' => $path .'ed_block.png', |
|
137 | 137 | ); |
138 | - $items['ed_link'] = array( |
|
139 | - 'name' => 'link', |
|
140 | - 'prefix' =>'[url=http://]', |
|
141 | - 'suffix' => '[/url]', |
|
142 | - 'accesskey' => 'l', |
|
143 | - 'weight' => 50, |
|
144 | - 'icon' => $path .'ed_link.png', |
|
138 | + $items['ed_link'] = array( |
|
139 | + 'name' => 'link', |
|
140 | + 'prefix' =>'[url=http://]', |
|
141 | + 'suffix' => '[/url]', |
|
142 | + 'accesskey' => 'l', |
|
143 | + 'weight' => 50, |
|
144 | + 'icon' => $path .'ed_link.png', |
|
145 | 145 | ); |
146 | - return $items; |
|
146 | + return $items; |
|
147 | 147 | } |
148 | 148 |
@@ -34,67 +34,67 @@ |
||
34 | 34 | |
35 | 35 | function bbcode_filter($op, $delta = 0, $format = -1, $text = '') { |
36 | 36 | switch ($op) { |
37 | - case 'list': |
|
38 | - return array(0 => t('BBCode')); |
|
37 | + case 'list': |
|
38 | + return array(0 => t('BBCode')); |
|
39 | 39 | |
40 | - case 'description': |
|
41 | - return t('Converts BBCode to HTML.'); |
|
40 | + case 'description': |
|
41 | + return t('Converts BBCode to HTML.'); |
|
42 | 42 | |
43 | - case 'process': |
|
44 | - include_once(drupal_get_path('module', 'bbcode') .'/bbcode-filter.inc'); |
|
45 | - if (variable_get("bbcode_debug_$format", 0)) { |
|
46 | - $timing_start = explode(' ', microtime()); |
|
47 | - $ret = _bbcode_filter_process($text, $format); |
|
48 | - $timing_stop = explode(' ', microtime()); |
|
49 | - $elapsed = $timing_stop[1] - $timing_start[1]; |
|
50 | - $elapsed += $timing_stop[0] - $timing_start[0]; |
|
51 | - $ret .= '<hr />'. l('BBCode', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.<hr />'; |
|
52 | - return $ret; |
|
53 | - } |
|
54 | - else |
|
55 | - return _bbcode_filter_process($text, $format); |
|
43 | + case 'process': |
|
44 | + include_once(drupal_get_path('module', 'bbcode') .'/bbcode-filter.inc'); |
|
45 | + if (variable_get("bbcode_debug_$format", 0)) { |
|
46 | + $timing_start = explode(' ', microtime()); |
|
47 | + $ret = _bbcode_filter_process($text, $format); |
|
48 | + $timing_stop = explode(' ', microtime()); |
|
49 | + $elapsed = $timing_stop[1] - $timing_start[1]; |
|
50 | + $elapsed += $timing_stop[0] - $timing_start[0]; |
|
51 | + $ret .= '<hr />'. l('BBCode', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.<hr />'; |
|
52 | + return $ret; |
|
53 | + } |
|
54 | + else |
|
55 | + return _bbcode_filter_process($text, $format); |
|
56 | 56 | |
57 | - case 'settings': |
|
58 | - $form = array(); |
|
59 | - $form['bbcode_filter'] = array( |
|
60 | - '#type' => 'fieldset', |
|
61 | - '#title' => t('BBCode filter'), |
|
62 | - '#collapsible' => TRUE, |
|
63 | - '#collapsed' => FALSE); |
|
64 | - $form['bbcode_filter']["bbcode_make_links_$format"] = array( |
|
65 | - '#type' => 'select', |
|
66 | - '#title' => t('Convert addresses to links'), |
|
67 | - '#default_value' => variable_get("bbcode_make_links_$format", 1), |
|
68 | - '#options' => array(t('Disabled'), t('Enabled')), |
|
69 | - '#description' => t('Turn web and e-mail addresses into clickable links. This is useful if content authors do not explicitly mark addresses as links with [url] and [email] tags.')); |
|
70 | - $form['bbcode_filter']["bbcode_filter_nofollow_$format"] = array( |
|
71 | - '#type' => 'select', |
|
72 | - '#title' => t('Spam link deterrent'), |
|
73 | - '#default_value' => variable_get("bbcode_filter_nofollow_$format", 0), |
|
74 | - '#options' => array(t('Disabled'), t('Enabled')), |
|
75 | - '#description' => t('If enabled, BBCode will add rel="nofollow" to all links, as a measure to reduce the effectiveness of spam links. Note: this will also prevent valid links from being followed by search engines, therefore it is likely most effective when enabled for anonymous users.')); |
|
76 | - $form['bbcode_filter']["bbcode_encode_mailto_$format"] = array( |
|
77 | - '#type' => 'select', |
|
78 | - '#title' => t('Email address encoding'), |
|
79 | - '#default_value' => variable_get("bbcode_encode_mailto_$format", 1), |
|
80 | - '#options' => array(t('Disabled'), t('Enabled')), |
|
81 | - '#description' => t('Whether to encode email addresses with javascript. With this method you will have clickable mailto links, but it will be a bit harder for spam robots to collect them.')); |
|
82 | - $form['bbcode_filter']["bbcode_paragraph_breaks_$format"] = array( |
|
83 | - '#type' => 'select', |
|
84 | - '#title' => t('Smart paragraph and line breaks'), |
|
85 | - '#default_value' => variable_get("bbcode_paragraph_breaks_$format", 2), |
|
86 | - '#options' => array(t('Disabled'), t('Line breaks only'), t('Line and paragraph breaks')), |
|
87 | - '#description' => t('Add line and paragraph breaks to text, excluding text in preformatted code blocks. If you disable this option, you need to enable Drupal\'s "Line break converter". Don\'t use both together!')); |
|
88 | - $form['bbcode_filter']["bbcode_debug_$format"] = array( |
|
89 | - '#type' => 'select', |
|
90 | - '#title' => t('Print debugging info'), |
|
91 | - '#default_value' => variable_get("bbcode_debug_$format", 0), |
|
92 | - '#options' => array(t('Disabled'), t('Enabled')), |
|
93 | - '#description' => t('Print BBCode parse date and execution time. This option should be disabled on production sites. You may need to clear the cache after changing this option.')); |
|
94 | - return $form; |
|
57 | + case 'settings': |
|
58 | + $form = array(); |
|
59 | + $form['bbcode_filter'] = array( |
|
60 | + '#type' => 'fieldset', |
|
61 | + '#title' => t('BBCode filter'), |
|
62 | + '#collapsible' => TRUE, |
|
63 | + '#collapsed' => FALSE); |
|
64 | + $form['bbcode_filter']["bbcode_make_links_$format"] = array( |
|
65 | + '#type' => 'select', |
|
66 | + '#title' => t('Convert addresses to links'), |
|
67 | + '#default_value' => variable_get("bbcode_make_links_$format", 1), |
|
68 | + '#options' => array(t('Disabled'), t('Enabled')), |
|
69 | + '#description' => t('Turn web and e-mail addresses into clickable links. This is useful if content authors do not explicitly mark addresses as links with [url] and [email] tags.')); |
|
70 | + $form['bbcode_filter']["bbcode_filter_nofollow_$format"] = array( |
|
71 | + '#type' => 'select', |
|
72 | + '#title' => t('Spam link deterrent'), |
|
73 | + '#default_value' => variable_get("bbcode_filter_nofollow_$format", 0), |
|
74 | + '#options' => array(t('Disabled'), t('Enabled')), |
|
75 | + '#description' => t('If enabled, BBCode will add rel="nofollow" to all links, as a measure to reduce the effectiveness of spam links. Note: this will also prevent valid links from being followed by search engines, therefore it is likely most effective when enabled for anonymous users.')); |
|
76 | + $form['bbcode_filter']["bbcode_encode_mailto_$format"] = array( |
|
77 | + '#type' => 'select', |
|
78 | + '#title' => t('Email address encoding'), |
|
79 | + '#default_value' => variable_get("bbcode_encode_mailto_$format", 1), |
|
80 | + '#options' => array(t('Disabled'), t('Enabled')), |
|
81 | + '#description' => t('Whether to encode email addresses with javascript. With this method you will have clickable mailto links, but it will be a bit harder for spam robots to collect them.')); |
|
82 | + $form['bbcode_filter']["bbcode_paragraph_breaks_$format"] = array( |
|
83 | + '#type' => 'select', |
|
84 | + '#title' => t('Smart paragraph and line breaks'), |
|
85 | + '#default_value' => variable_get("bbcode_paragraph_breaks_$format", 2), |
|
86 | + '#options' => array(t('Disabled'), t('Line breaks only'), t('Line and paragraph breaks')), |
|
87 | + '#description' => t('Add line and paragraph breaks to text, excluding text in preformatted code blocks. If you disable this option, you need to enable Drupal\'s "Line break converter". Don\'t use both together!')); |
|
88 | + $form['bbcode_filter']["bbcode_debug_$format"] = array( |
|
89 | + '#type' => 'select', |
|
90 | + '#title' => t('Print debugging info'), |
|
91 | + '#default_value' => variable_get("bbcode_debug_$format", 0), |
|
92 | + '#options' => array(t('Disabled'), t('Enabled')), |
|
93 | + '#description' => t('Print BBCode parse date and execution time. This option should be disabled on production sites. You may need to clear the cache after changing this option.')); |
|
94 | + return $form; |
|
95 | 95 | |
96 | - default: |
|
97 | - return $text; |
|
96 | + default: |
|
97 | + return $text; |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | function bbcode_filter_tips($delta, $format, $long = false) { |
10 | 10 | if ($long) { |
11 | - include_once(drupal_get_path('module', 'bbcode') .'/bbcode-help.inc'); |
|
11 | + include_once(drupal_get_path('module', 'bbcode').'/bbcode-help.inc'); |
|
12 | 12 | return _bbcode_filter_tip(); |
13 | 13 | } |
14 | 14 | else { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | array( |
18 | 18 | '!BBCode' => l(t('BBCode'), "filter/tips/$format", |
19 | 19 | array( |
20 | - 'fragment' => 'filter-bbcode-' . $delta, |
|
20 | + 'fragment' => 'filter-bbcode-'.$delta, |
|
21 | 21 | 'attributes' => |
22 | 22 | array( |
23 | 23 | 'target'=>'_blank', |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | )) |
27 | 27 | )); |
28 | 28 | if (variable_get("bbcode_make_links_$format", FALSE)) { |
29 | - $output .= ' '. t('URLs will automatically be converted to links.'); |
|
29 | + $output .= ' '.t('URLs will automatically be converted to links.'); |
|
30 | 30 | } |
31 | 31 | return $output; |
32 | 32 | } |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | return t('Converts BBCode to HTML.'); |
42 | 42 | |
43 | 43 | case 'process': |
44 | - include_once(drupal_get_path('module', 'bbcode') .'/bbcode-filter.inc'); |
|
44 | + include_once(drupal_get_path('module', 'bbcode').'/bbcode-filter.inc'); |
|
45 | 45 | if (variable_get("bbcode_debug_$format", 0)) { |
46 | 46 | $timing_start = explode(' ', microtime()); |
47 | 47 | $ret = _bbcode_filter_process($text, $format); |
48 | 48 | $timing_stop = explode(' ', microtime()); |
49 | 49 | $elapsed = $timing_stop[1] - $timing_start[1]; |
50 | 50 | $elapsed += $timing_stop[0] - $timing_start[0]; |
51 | - $ret .= '<hr />'. l('BBCode', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.<hr />'; |
|
51 | + $ret .= '<hr />'.l('BBCode', "filter/tips/$format").' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.<hr />'; |
|
52 | 52 | return $ret; |
53 | 53 | } |
54 | 54 | else |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | * Alter icons if the quicktags module is enabled |
103 | 103 | */ |
104 | 104 | function bbcode_quicktags_alter($items) { |
105 | - $path = base_path() . drupal_get_path('module','quicktags') .'/'; |
|
105 | + $path = base_path().drupal_get_path('module', 'quicktags').'/'; |
|
106 | 106 | $items['ed_italic'] = array( |
107 | 107 | 'name' => 'italic', |
108 | 108 | 'prefix' => '[i]', |
109 | 109 | 'suffix' => '[/i]', |
110 | 110 | 'accesskey' => 'i', |
111 | 111 | 'weight' => 10, |
112 | - 'icon' => $path .'ed_italic.png', |
|
112 | + 'icon' => $path.'ed_italic.png', |
|
113 | 113 | ); |
114 | 114 | $items['ed_bold'] = array( |
115 | 115 | 'name' => 'bold', |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | 'suffix' => '[/b]', |
118 | 118 | 'accesskey' => 'b', |
119 | 119 | 'weight' => 20, |
120 | - 'icon' => $path .'ed_bold.png', |
|
120 | + 'icon' => $path.'ed_bold.png', |
|
121 | 121 | ); |
122 | 122 | $items['ed_code'] = array( |
123 | 123 | 'name' => 'code', |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | 'suffix' => '[/code]', |
126 | 126 | 'accesskey' => 'c', |
127 | 127 | 'weight' => 30, |
128 | - 'icon' => $path .'ed_code.png', |
|
128 | + 'icon' => $path.'ed_code.png', |
|
129 | 129 | ); |
130 | 130 | $items['ed_block'] = array( |
131 | 131 | 'name' => 'quote', |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'suffix' => '[/quote]', |
134 | 134 | 'accesskey' => 'q', |
135 | 135 | 'weight' => 40, |
136 | - 'icon' => $path .'ed_block.png', |
|
136 | + 'icon' => $path.'ed_block.png', |
|
137 | 137 | ); |
138 | 138 | $items['ed_link'] = array( |
139 | 139 | 'name' => 'link', |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | 'suffix' => '[/url]', |
142 | 142 | 'accesskey' => 'l', |
143 | 143 | 'weight' => 50, |
144 | - 'icon' => $path .'ed_link.png', |
|
144 | + 'icon' => $path.'ed_link.png', |
|
145 | 145 | ); |
146 | 146 | return $items; |
147 | 147 | } |
@@ -10,8 +10,7 @@ discard block |
||
10 | 10 | if ($long) { |
11 | 11 | include_once(drupal_get_path('module', 'bbcode') .'/bbcode-help.inc'); |
12 | 12 | return _bbcode_filter_tip(); |
13 | - } |
|
14 | - else { |
|
13 | + } else { |
|
15 | 14 | # D5: $output = t('You can use !BBCode tags in the text.', array('!BBCode' => l(t('BBCode'), "filter/tips/$format", NULL, NULL, 'filter-bbcode-' . $delta))); |
16 | 15 | $output = t('You can use !BBCode (opens in new window) tags in the text.', |
17 | 16 | array( |
@@ -50,8 +49,7 @@ discard block |
||
50 | 49 | $elapsed += $timing_stop[0] - $timing_start[0]; |
51 | 50 | $ret .= '<hr />'. l('BBCode', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.<hr />'; |
52 | 51 | return $ret; |
53 | - } |
|
54 | - else |
|
52 | + } else |
|
55 | 53 | return _bbcode_filter_process($text, $format); |
56 | 54 | |
57 | 55 | case 'settings': |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | ), |
26 | 26 | )) |
27 | 27 | )); |
28 | - if (variable_get("bbcode_make_links_$format", FALSE)) { |
|
28 | + if (variable_get("bbcode_make_links_$format", false)) { |
|
29 | 29 | $output .= ' '. t('URLs will automatically be converted to links.'); |
30 | 30 | } |
31 | 31 | return $output; |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | $form['bbcode_filter'] = array( |
60 | 60 | '#type' => 'fieldset', |
61 | 61 | '#title' => t('BBCode filter'), |
62 | - '#collapsible' => TRUE, |
|
63 | - '#collapsed' => FALSE); |
|
62 | + '#collapsible' => true, |
|
63 | + '#collapsed' => false); |
|
64 | 64 | $form['bbcode_filter']["bbcode_make_links_$format"] = array( |
65 | 65 | '#type' => 'select', |
66 | 66 | '#title' => t('Convert addresses to links'), |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: bbcode-help.inc,v 1.8 2007/01/28 21:18:45 naudefj Exp $ |
3 | 3 | |
4 | 4 | function _bbcode_filter_tip() { |
5 | - return t("<a id=\"filter-bbcode\"></a><h2>BBCode Guide</h2> |
|
5 | + return t("<a id=\"filter-bbcode\"></a><h2>BBCode Guide</h2> |
|
6 | 6 | |
7 | 7 | <p> |
8 | 8 | BBCode allows you to specify formatting rules for your text, |