@@ -130,8 +130,7 @@ |
||
| 130 | 130 | if (isset($config['css_setting'])) { |
| 131 | 131 | if ($config['css_setting'] == 'theme') { |
| 132 | 132 | $settings['EditorAreaCSS'] = implode(',', wysiwyg_get_css()); |
| 133 | - } |
|
| 134 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 133 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 135 | 134 | $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
| 136 | 135 | } |
| 137 | 136 | } |
@@ -173,8 +173,7 @@ |
||
| 173 | 173 | if ($config['css_setting'] == 'theme') { |
| 174 | 174 | // WYMeditor only supports one CSS file currently. |
| 175 | 175 | $settings['stylesheet'] = reset(wysiwyg_get_css()); |
| 176 | - } |
|
| 177 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 176 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 178 | 177 | $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
| 179 | 178 | } |
| 180 | 179 | } |
@@ -105,8 +105,7 @@ discard block |
||
| 105 | 105 | natcasesort($themes); |
| 106 | 106 | $themes = array_values($themes); |
| 107 | 107 | return !empty($themes) ? $themes : array('default'); |
| 108 | - } |
|
| 109 | - else { |
|
| 108 | + } else { |
|
| 110 | 109 | return array('default'); |
| 111 | 110 | } |
| 112 | 111 | } |
@@ -165,16 +164,13 @@ discard block |
||
| 165 | 164 | if (version_compare($editor['installed version'], '3.0.1.4391', '<')) { |
| 166 | 165 | if ($config['css_setting'] == 'theme') { |
| 167 | 166 | $settings['contentsCss'] = reset(wysiwyg_get_css()); |
| 168 | - } |
|
| 169 | - elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 167 | + } elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 170 | 168 | $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
| 171 | 169 | } |
| 172 | - } |
|
| 173 | - else { |
|
| 170 | + } else { |
|
| 174 | 171 | if ($config['css_setting'] == 'theme') { |
| 175 | 172 | $settings['contentsCss'] = wysiwyg_get_css(); |
| 176 | - } |
|
| 177 | - elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 173 | + } elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 178 | 174 | $settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()))); |
| 179 | 175 | } |
| 180 | 176 | } |
@@ -176,8 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | - } |
|
| 180 | - else if ($button == 'fontname') { |
|
| 179 | + } else if ($button == 'fontname') { |
|
| 181 | 180 | $extra = array('menu' => array( |
| 182 | 181 | array('text' => 'Arial', 'checked' => TRUE), |
| 183 | 182 | array('text' => 'Arial Black'), |
@@ -201,8 +200,7 @@ discard block |
||
| 201 | 200 | if (isset($config['css_setting'])) { |
| 202 | 201 | if ($config['css_setting'] == 'theme') { |
| 203 | 202 | $settings['extracss'] = wysiwyg_get_css(); |
| 204 | - } |
|
| 205 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 203 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 206 | 204 | $settings['extracss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
| 207 | 205 | $settings['extracss'] = explode(',', $settings['extracss']); |
| 208 | 206 | } |
@@ -249,11 +247,9 @@ discard block |
||
| 249 | 247 | if (in_array($button, array('heading', 'fontname'))) { |
| 250 | 248 | $type = 'select'; |
| 251 | 249 | $label = $extra['menu'][0]['text']; |
| 252 | - } |
|
| 253 | - elseif (in_array($button, array('fontsize'))) { |
|
| 250 | + } elseif (in_array($button, array('fontsize'))) { |
|
| 254 | 251 | $type = 'spin'; |
| 255 | - } |
|
| 256 | - elseif (in_array($button, array('forecolor', 'backcolor'))) { |
|
| 252 | + } elseif (in_array($button, array('forecolor', 'backcolor'))) { |
|
| 257 | 253 | $type = 'color'; |
| 258 | 254 | } |
| 259 | 255 | |
@@ -101,8 +101,7 @@ |
||
| 101 | 101 | if (isset($config['css_setting'])) { |
| 102 | 102 | if ($config['css_setting'] == 'theme') { |
| 103 | 103 | $settings['CSSFile'] = reset(wysiwyg_get_css()); |
| 104 | - } |
|
| 105 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 104 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 106 | 105 | $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
| 107 | 106 | } |
| 108 | 107 | } |
@@ -108,8 +108,7 @@ |
||
| 108 | 108 | if (file_exists($css)) { |
| 109 | 109 | $settings['externalCSS'] = base_path() . $css; |
| 110 | 110 | } |
| 111 | - } |
|
| 112 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 111 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 113 | 112 | $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
| 114 | 113 | } |
| 115 | 114 | } |
@@ -81,8 +81,7 @@ |
||
| 81 | 81 | if (file_exists($css)) { |
| 82 | 82 | $settings['externalCSS'] = base_path() . $css; |
| 83 | 83 | } |
| 84 | - } |
|
| 85 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 84 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 86 | 85 | $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
| 87 | 86 | } |
| 88 | 87 | } |
@@ -188,8 +188,7 @@ discard block |
||
| 188 | 188 | if (isset($config['css_setting'])) { |
| 189 | 189 | if ($config['css_setting'] == 'theme') { |
| 190 | 190 | $settings['content_css'] = implode(',', wysiwyg_get_css()); |
| 191 | - } |
|
| 192 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 191 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
| 193 | 192 | $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
| 194 | 193 | } |
| 195 | 194 | } |
@@ -367,8 +366,7 @@ discard block |
||
| 367 | 366 | return '-' . $name; |
| 368 | 367 | } |
| 369 | 368 | return $name; |
| 370 | - } |
|
| 371 | - else if ($op == 'remove') { |
|
| 369 | + } else if ($op == 'remove') { |
|
| 372 | 370 | if (strpos($name, '-') === 0) { |
| 373 | 371 | return substr($name, 1); |
| 374 | 372 | } |
@@ -201,8 +201,7 @@ discard block |
||
| 201 | 201 | if (empty($element['format']['guidelines']['#value'])) { |
| 202 | 202 | $element['format']['guidelines']['#value'] = ' '; |
| 203 | 203 | } |
| 204 | - } |
|
| 205 | - else { |
|
| 204 | + } else { |
|
| 206 | 205 | $element[$format]['#attributes']['class'] = (isset($element[$format]['#attributes']['class']) ? $element[$format]['#attributes']['class'] . ' ' : ''); |
| 207 | 206 | $element[$format]['#attributes']['class'] .= 'wysiwyg wysiwyg-format-' . $format . ' wysiwyg-editor-' . $editor . ' wysiwyg-field-' . $field['#id'] . ' wysiwyg-status-' . $status . ' wysiwyg-toggle-' . $toggle . $extra_class; |
| 208 | 207 | } |
@@ -273,8 +272,7 @@ discard block |
||
| 273 | 272 | if (isset($profile->settings['library']) && isset($editor['libraries'][$profile->settings['library']])) { |
| 274 | 273 | $library = $profile->settings['library']; |
| 275 | 274 | $files = $editor['libraries'][$library]['files']; |
| 276 | - } |
|
| 277 | - else { |
|
| 275 | + } else { |
|
| 278 | 276 | // Fallback to the first defined library by default (external libraries can change). |
| 279 | 277 | $library = key($editor['libraries']); |
| 280 | 278 | $files = array_shift($editor['libraries']); |
@@ -284,8 +282,7 @@ discard block |
||
| 284 | 282 | if (is_array($options)) { |
| 285 | 283 | $options += array('type' => 'module', 'scope' => 'header', 'defer' => FALSE, 'cache' => TRUE, 'preprocess' => TRUE); |
| 286 | 284 | drupal_add_js($editor['library path'] . '/' . $file, $options['type'], $options['scope'], $options['defer'], $options['cache'], $options['preprocess']); |
| 287 | - } |
|
| 288 | - else { |
|
| 285 | + } else { |
|
| 289 | 286 | drupal_add_js($editor['library path'] . '/' . $options); |
| 290 | 287 | } |
| 291 | 288 | } |
@@ -322,8 +319,7 @@ discard block |
||
| 322 | 319 | )), 'setting'); |
| 323 | 320 | |
| 324 | 321 | $loaded[$name] = TRUE; |
| 325 | - } |
|
| 326 | - else { |
|
| 322 | + } else { |
|
| 327 | 323 | $loaded[$name] = FALSE; |
| 328 | 324 | } |
| 329 | 325 | } |
@@ -468,8 +464,7 @@ discard block |
||
| 468 | 464 | if (isset($meta['settings'])) { |
| 469 | 465 | drupal_add_js(array('wysiwyg' => array('plugins' => array('drupal' => array($plugin => $meta['settings'])))), 'setting'); |
| 470 | 466 | } |
| 471 | - } |
|
| 472 | - else { |
|
| 467 | + } else { |
|
| 473 | 468 | $profile_plugins_drupal[$plugin] = $processed_plugins[$proxy][$plugin]; |
| 474 | 469 | } |
| 475 | 470 | } |
@@ -711,8 +706,7 @@ discard block |
||
| 711 | 706 | ); |
| 712 | 707 | return $form; |
| 713 | 708 | } |
| 714 | - } |
|
| 715 | - elseif ($op == 'insert' || $op == 'update') { |
|
| 709 | + } elseif ($op == 'insert' || $op == 'update') { |
|
| 716 | 710 | if (isset($edit['wysiwyg_status'])) { |
| 717 | 711 | db_query("DELETE FROM {wysiwyg_user} WHERE uid = %d", $account->uid); |
| 718 | 712 | foreach ($edit['wysiwyg_status'] as $format => $status) { |
@@ -745,8 +739,7 @@ discard block |
||
| 745 | 739 | |
| 746 | 740 | if (!empty($profile->settings['user_choose']) && isset($account->wysiwyg_status[$profile->format])) { |
| 747 | 741 | $status = $account->wysiwyg_status[$profile->format]; |
| 748 | - } |
|
| 749 | - else { |
|
| 742 | + } else { |
|
| 750 | 743 | $status = isset($profile->settings['default']) ? $profile->settings['default'] : TRUE; |
| 751 | 744 | } |
| 752 | 745 | |