diff --git a/fckeditor.install b/fckeditor.install index 6bbe5fcddf762e11545f643e7c81a819d975d91c..0abd58763ca4e2111def67a787c6b6fbc6c18305 100644 --- a/fckeditor.install +++ b/fckeditor.install @@ -22,7 +22,7 @@ * == END LICENSE == * * @file - * Implementation of hook_install() + * Implementation of hook_install(). * * This will automatically install the database tables for the FCKeditor module for both the MySQL and PostgreSQL databases. * @@ -151,8 +151,8 @@ function fckeditor_install() { } /** -* Implementation of hook_schema(). -*/ + * Implementation of hook_schema(). + */ function fckeditor_schema() { $schema['fckeditor_settings'] = array( 'description' => 'Stores FCKeditor profile settings', @@ -302,7 +302,7 @@ function fckeditor_update_6130() { } /** - * Implementation of hook_uninstall() + * Implementation of hook_uninstall(). */ function fckeditor_uninstall() { drupal_uninstall_schema('fckeditor'); diff --git a/fckeditor.module b/fckeditor.module index c5036fccc04942ec45cc5f9eed491dfc6cded201..f903b2aeb583ae796b4cb5a9c2e3a0878c2e2788 100644 --- a/fckeditor.module +++ b/fckeditor.module @@ -43,7 +43,7 @@ $_fckeditor_configuration = array(); $_fckeditor_js_ids = array(); /** - * Implementation of hook_help + * Implementation of hook_help() */ function fckeditor_help($path, $arg) { switch ($path) { @@ -55,11 +55,11 @@ function fckeditor_help($path, $arg) { $output = t("

The Global Profile allows you to define settings that are common for all profiles. Values defined in other profiles will be appended to the global configuration. This way you can avoid repeating some of the settings that are usually the same in each profile.

"); break; } - else if (!empty($arg[3]) && in_array($arg[3], array("add", "edit"))) { + elseif (!empty($arg[3]) && in_array($arg[3], array("add", "edit"))) { $output = t("

Note: FCKeditor is highly configurable. The most commonly used features are listed below. If you want to take a look at all available settings, open !fckconfig and then customize !fckeditor_config to your needs. This is also the only way to define new toolbar sets. It is advised to not edit fckconfig.js because you may overwrite it accidentally when you update the editor.

", array('!fckconfig' => drupal_get_path('module', 'fckeditor') ."/fckeditor/fckconfig.js", '!fckeditor_config' => drupal_get_path('module', 'fckeditor') ."/fckeditor.config.js")); break; } - else if (!empty($arg[3]) && in_array($arg[3], array("delete", "deleteg"))) { + elseif (!empty($arg[3]) && in_array($arg[3], array("delete", "deleteg"))) { break; } $output = t("

The FCKeditor module allows Drupal to replace textarea fields with a rich text or WYSIWYG editor. This editor brings many of the powerful functionalities of known desktop editors like Word to the web. It's relatively lightweight and doesn't require any kind of installation on the client computer.

More information about the editor is located at the !fckeditorlink. A small user guide is located at !userguidelink.

", @@ -137,7 +137,7 @@ function fckeditor_help($path, $arg) { } /** - * Implementation of hook_perm + * Implementation of hook_perm(). * Administer -> User management -> Permissions */ function fckeditor_perm() { @@ -399,10 +399,10 @@ function fckeditor_profile_validate($edit) { if ($edit['css_mode'] != 'self') { $errors['css_path'] = t('CSS path is not empty. Please set the "Editor CSS" option to "define css" mode.'); } - else if (false !== strpos($edit['css_path'], '"')) { + elseif (false !== strpos($edit['css_path'], '"')) { $errors['css_path'] = t('Double quotes are not allowed in CSS path.'); } - else if (substr($edit['css_path'], 0, 1) == "'" && substr($edit['css_path'], -1) == "'") { + elseif (substr($edit['css_path'], 0, 1) == "'" && substr($edit['css_path'], -1) == "'") { $errors['css_path'] = t('Enter valid path, do not surround it with quotes.'); } } @@ -411,10 +411,10 @@ function fckeditor_profile_validate($edit) { if ($edit['css_style'] != 'self') { $errors['styles_path'] = t('Path to predefined styles is not empty. Please set the "Predefined styles" option to "define path to fckstyles.xml" mode.'); } - else if (false !== strpos($edit['styles_path'], '"')) { + elseif (false !== strpos($edit['styles_path'], '"')) { $errors['styles_path'] = t('Double quotes are not allowed in path.'); } - else if (substr($edit['styles_path'], 0, 1) == "'" && substr($edit['styles_path'], -1) == "'") { + elseif (substr($edit['styles_path'], 0, 1) == "'" && substr($edit['styles_path'], -1) == "'") { $errors['styles_path'] = t('Enter valid path, do not surround it with quotes.'); } } @@ -919,7 +919,7 @@ function fckeditor_process_textarea($element) { $content .= $element['#post']['teaser_js'] .""; } $content .= $element['#value']; - $wysiwyg_link = '
'."\n"; + $wysiwyg_link = '
'."\n"; $wysiwyg_link .= ""; $wysiwyg_link .= $fckeditor_on ? t("Switch to plain text editor") : t("Switch to rich text editor"); $wysiwyg_link .= ""; @@ -1139,7 +1139,7 @@ function fckeditor_process_textarea($element) { $js .= $js_id .".Config['StylesXmlPath'] = \"". $styles_xml_path ."\";\n"; } } - else if (!empty($conf['css_style']) && $conf['css_style'] == 'self') { + elseif (!empty($conf['css_style']) && $conf['css_style'] == 'self') { $conf['styles_path'] = str_replace("%h%t", "%t", $conf['styles_path']); $js .= $js_id .".Config['StylesXmlPath'] = \"". str_replace(array('%h', '%t', '%m'), array($host, $host . $themepath, $module_drupal_path), $conf['styles_path']) ."\";\n"; } @@ -1168,7 +1168,7 @@ function fckeditor_process_textarea($element) { if (file_exists($path)) { $css_files[$name] = $host . $path; } - else if (!empty($css_files[$name])) { + elseif (!empty($css_files[$name])) { unset($css_files[$name]); } } @@ -1185,20 +1185,20 @@ function fckeditor_process_textarea($element) { $editorcss .= $host . $color_paths[1] .","; } } - else if (!empty($color_paths[0])) { + elseif (!empty($color_paths[0])) { $editorcss .= $host . $color_paths[0] .","; } $editorcss .= $module_full_path ."/fckeditor.css\";\n"; $js .= $js_id .".Config['EditorAreaCSS'] = ". $editorcss; } - else if (file_exists($style_css)) { + elseif (file_exists($style_css)) { $js .= $js_id .".Config['EditorAreaCSS'] = \"". $host . $style_css .",". $module_full_path ."/fckeditor.css\";"; } else { $js .= $js_id .".Config['EditorAreaCSS'] = \"". $module_full_path ."/fckeditor.css\";"; } } - else if ($conf['css_mode'] == 'self') { + elseif ($conf['css_mode'] == 'self') { $conf['css_path'] = str_replace("%h%t", "%t", $conf['css_path']); $js .= $js_id .".Config['EditorAreaCSS'] = \"". str_replace(array('%h', '%t'), array($host, $host . $themepath), $conf['css_path']) .",". $module_full_path ."/fckeditor.css\";"; } @@ -1214,7 +1214,8 @@ function fckeditor_process_textarea($element) { if ($element['#id'] == 'edit-body') { $teasersuffix = '&teaser=edit-teaser-js'; - } else { + } + else { $teasersuffix = ''; } @@ -2252,7 +2253,7 @@ function fckeditor_is_compatible_client() { if (function_exists('FCKeditor_IsCompatibleBrowser')) { return FCKeditor_IsCompatibleBrowser(); } - else if (class_exists('FCKeditor')) { + elseif (class_exists('FCKeditor')) { //FCKeditor 2.6 with definition of FCKeditor_IsCompatibleBrowser() in fckeditor.php if (filesize($fckeditor_main_file) > 1500) { include_once $fckeditor_main_file; @@ -2291,9 +2292,9 @@ function fckeditor_user_get_setting($user, $profile, $setting) { } function fckeditor_user_get_profile($user, $clear = FALSE) { - static $profile_name; + static $profile_name = NULL; - if ($clear === TRUE || $profile_name == null) { + if ($clear === TRUE || $profile_name == NULL) { $profile_name = array(); } @@ -2310,7 +2311,7 @@ function fckeditor_user_get_profile($user, $clear = FALSE) { if (isset($rid) && isset($user->roles[$rid])) { $profile_name[$user->uid] = db_result(db_query("SELECT s.name FROM {fckeditor_settings} s INNER JOIN {fckeditor_role} r ON r.name = s.name WHERE r.rid='%s'", $rid)); } - else if ($user->uid == "1") { + elseif ($user->uid == "1") { $profile_name[$user->uid] = db_result(db_query_range("SELECT s.name FROM {fckeditor_settings} s INNER JOIN {fckeditor_role} r ON r.name = s.name ORDER BY r.rid DESC", 1)); } }