Projet

Général

Profil

Révision 6fd71452

Ajouté par Julien Enselme il y a environ 10 ans

Update CKEditor

Voir les différences:

drupal7/sites/all/modules/ckeditor/ckeditor.install
49 49
  module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib');
50 50

  
51 51
  //searching ckeditor.js
52
  $editor_path = _ckeditor_script_path();
52
  $ckeditor_path = _ckeditor_script_path();
53 53
  //insert default input formats to profiles
54 54
  db_insert('ckeditor_input_format')->fields(array("name" => "Advanced", "format" => 'filtered_html'))->execute();
55 55
  db_insert('ckeditor_input_format')->fields(array("name" => "Full", "format" => 'full_html'))->execute();
......
67 67
  $arr['default'] = "t";
68 68
  $arr['show_toggle'] = "t";
69 69
  $arr['popup'] = variable_get('ckeditor_popup', 0) ? "t" : "f";
70
  // <!--break--> does not work in Filtered HTML, so DrupalBreak does not make sense here
71
  // https://drupal.org/node/881006
70 72
  $arr['toolbar'] = "
71 73
[
72 74
    ['Source'],
73 75
    ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'],
74
    ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'],
76
    ['Undo','Redo','Find','Replace','-','SelectAll'],
75 77
    ['Image','Media','Flash','Table','HorizontalRule','Smiley','SpecialChar'],
76 78
    ['Maximize', 'ShowBlocks'],
77 79
    '/',
78 80
    ['Format'],
79
    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
81
    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript','-','RemoveFormat'],
80 82
    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
81 83
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'],
82
    ['Link','Unlink','Anchor', 'Linkit']
84
    ['Link','Unlink','Anchor','Linkit']
83 85
]
84 86
    ";
85 87
  $arr['expand'] = variable_get('ckeditor_toolbar_start_expanded', 1) ? "t" : "f";
......
119 121
[
120 122
    ['Source'],
121 123
    ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'],
122
    ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'],
124
    ['Undo','Redo','Find','Replace','-','SelectAll'],
123 125
    ['Image','Media','Flash','Table','HorizontalRule','Smiley','SpecialChar','Iframe'],
124 126
    '/',
125
    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
127
    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript','-','RemoveFormat'],
126 128
    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
127
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'],
128
    ['Link','Unlink','Anchor', 'Linkit'],
129
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl','-','Language'],
130
    ['Link','Unlink','Anchor','Linkit'],
129 131
    ['DrupalBreak'],
130 132
    '/',
131 133
    ['Format','Font','FontSize'],
......
140 142

  
141 143
  $arr = array();
142 144

  
143
  if ($editor_path) {
144
    $arr['ckeditor_path'] = $editor_path;
145
  if (!empty($ckeditor_path)) {
146
    $arr['ckeditor_path'] = $ckeditor_path;
147
  }
148
  else {
149
    $arr['ckeditor_path'] = '//cdn.ckeditor.com/4.4.0/full-all';
145 150
  }
146 151

  
147 152
  db_insert('ckeditor_settings')->fields(array("name" => "CKEditor Global Profile", "settings" => serialize($arr)))->execute();
......
238 243
        }
239 244
      }
240 245
    }
241
    if ((($installed_version = _ckeditor_requirements_getinstalledversion()) !== NULL) && (-1 == version_compare($installed_version, '3.1 SVN')) && $installed_version != '%VERSION%') {
246
    if ((($installed_version = _ckeditor_requirements_getinstalledversion()) !== NULL) && $installed_version != '%VERSION%' && $installed_version != '<URL>' && (-1 == version_compare($installed_version, '3.1 SVN'))) {
242 247
      $requirements['ckeditor']['description'] = t('Some features are disabled because you are using an older version of CKEditor. Please upgrade to CKEditor 3.1 (or higher).');
243 248
      $requirements['ckeditor']['severity'] = REQUIREMENT_INFO;
244 249
    }
......
246 251
      if ($installed_version == '%VERSION%') {
247 252
        $requirements['ckeditor']['value'] = 'GIT version';
248 253
      }
254
      else if ($installed_version == '<URL>') {
255
        $requirements['ckeditor']['value'] = 'Unknown version. CKEditor is loaded from a remote URL.';
256
        $requirements['ckeditor']['severity'] = REQUIREMENT_INFO;
257
      }
249 258
      else {
250 259
        $requirements['ckeditor']['value'] = $installed_version;
251 260
      }
......
275 284
function _ckeditor_requirements_getinstalledversion() {
276 285
  module_load_include('module', 'ckeditor');
277 286
  $editor_path = ckeditor_path('local', TRUE);
287
  if ($editor_path == '<URL>') {
288
    $url = ckeditor_path('url', TRUE);
289
    $matches = array();
290
    if (preg_match("|cdn.ckeditor.com/(\d(\.\d+)+.*)/|i", $url, $matches)) {
291
      return $matches[1];
292
    }
293
    return '<URL>';
294
  }
278 295
  $jspath = $editor_path . '/ckeditor.js';
279 296

  
280 297
  $configcontents = @file_get_contents($jspath);
......
595 612
    );
596 613
    db_create_table('ckeditor_input_format', $ckeditor_input_format);
597 614
  }
598
}
615
}

Formats disponibles : Unified diff