ckeditor_update_7000

  1. drupal
    1. 7 ckeditor.install function
Drupal 7 ckeditor_update_7000()

Updates broken settings for the 'Full' profile. (Resets toolbar to default)

File

sites/all/modules/ckeditor/ckeditor.install, line 394

Code

function ckeditor_update_7000() {
  _ckeditor_d6_to_d7_migration();
  $result = db_query("SELECT settings FROM {ckeditor_settings} WHERE name = :name", array(':name' => 'Full'))->fetchField();
  $settings = unserialize($result);
  $settings['toolbar'] = "
[
    ['Source'],
    ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'],
    ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'],
    ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],
    '/',
    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'],
    ['Link','Unlink','Anchor'],
    ['DrupalBreak'],
    '/',
    ['Format','Font','FontSize'],
    ['TextColor','BGColor'],
    ['Maximize', 'ShowBlocks']
]
    ";

  $settings = serialize($settings);

  $update = db_update('ckeditor_settings')
                    ->fields(array(
    'settings' => $settings,
  ))
                    ->condition('name', 'Full', '=')
                    ->execute();
}