perm, "access fckeditor")) { if (false !== strpos($variable->perm, "use default fckeditor")) { db_query("UPDATE {permission} SET perm = '%s' WHERE rid = '%s'", str_replace("use default fckeditor", "access fckeditor", $variable->perm), $variable->rid); } else if (false !== strpos($variable->perm, "use advanced fckeditor")) { db_query("UPDATE {permission} SET perm = '%s' WHERE rid = '%s'", str_replace("use advanced fckeditor", "access fckeditor", $variable->perm), $variable->rid); } } } return $ret; } /** * Update from 5.x-2.0 to 5.x-2.1 * */ function fckeditor_update_3() { $ret = array(); $result = db_query('SELECT * FROM {fckeditor_settings}'); $global_profile_found = FALSE; while ($data = db_fetch_object($result)) { if ($data->name == "FCKeditor Global Profile") { $global_profile_found = TRUE; } if ($data->settings) { $settings = unserialize($data->settings); } if (isset($settings['excl_mode'], $settings['excl_list']) && !empty($settings['excl_list'])) { switch ($settings['excl_mode']) { case 0: // normal exclusion based on the id $settings['excl_fields'] = $settings['excl_list']; $settings['excl_mode'] = 0; break; case 1: //normal inclusion based on the id $settings['excl_fields'] = $settings['excl_list']; $settings['excl_mode'] = 1; break; case 2: //path exclusion $settings['excl_paths'] = $settings['excl_list']; $settings['excl_mode'] = 0; break; case 3: //path inclusion $settings['excl_paths'] = $settings['excl_list']; $settings['excl_mode'] = 1; break; } unset($settings['excl_list']); } if (isset($settings['simple_incl_mode'], $settings['simple_incl_list']) && !empty($settings['simple_incl_list'])) { switch ($settings['simple_incl_mode']) { case 1: //normal inclusion based on the id $settings['simple_incl_fields'] = $settings['simple_incl_list']; break; case 3: //path inclusion $settings['simple_incl_paths'] = $settings['simple_incl_list']; break; } unset($settings['simple_incl_mode']); unset($settings['simple_incl_list']); } db_query("UPDATE {fckeditor_settings} SET settings='%s' WHERE name='%s'", serialize($settings), $data->name); } if (!$global_profile_found) { db_query("INSERT INTO {fckeditor_settings} (name, settings) VALUES ('%s', '%s')", "FCKeditor Global Profile", serialize(array())); } return $ret; } function fckeditor_update_5() { $ret = array(); menu_rebuild(); return $ret; } /** * Implementation of hook_uninstall() */ function fckeditor_uninstall() { db_query('DROP TABLE {fckeditor_settings}'); db_query('DROP TABLE {fckeditor_role}'); // Clean up variables left by 5.x-1.x variable_del('fckeditor_popup'); variable_del('fckeditor_default_toolbar'); variable_del('fckeditor_advanced_toolbar'); variable_del('fckeditor_minimum_rows'); variable_del('fckeditor_toolbar_start_expanded'); variable_del('fckeditor_exclude_toggle'); variable_del('fckeditor_exclude'); variable_del('fckeditor_width'); variable_del('fckeditor_stylesheet'); variable_del('fckeditor_upload_basic'); variable_del('fckeditor_upload_advanced'); }