You are here

function ckeditor_init in CKEditor - WYSIWYG HTML editor 6

Implementation of hook_init().

File

./ckeditor.module, line 409
CKEditor - The text editor for the Internet - http://ckeditor.com Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.

Code

function ckeditor_init() {
  drupal_add_css(drupal_get_path('module', 'ckeditor') . '/ckeditor.css');

  // Added for support [#1288664] Views
  if (module_exists('views') && preg_match('/admin\\/build\\/views/', $_GET['q'])) {
    $module_drupal_path = drupal_get_path('module', 'ckeditor');
    $editor_local_path = ckeditor_path(TRUE);
    drupal_add_js($editor_local_path . '/ckeditor.js', 'module', 'footer', FALSE, TRUE, FALSE);
    drupal_add_js($module_drupal_path . '/includes/ckeditor.utils.js', 'module', 'footer');
    drupal_add_js(array(
      'ckeditor' => array(
        'ajaxToken' => drupal_get_token('ckeditorAjaxCall'),
        'xss_url' => url('ckeditor/xss'),
        'default_input_format' => variable_get('filter_default_format', 1),
        'settings' => array(
          'edit-footer',
          'edit-header',
        ),
      ),
    ), 'setting');
  }
}