You are here

ckeditor_codemirror.module in CKEditor CodeMirror 8

Same filename and directory in other branches
  1. 8.2 ckeditor_codemirror.module
  2. 7 ckeditor_codemirror.module

Main code for CKEditor CodeMirror module.

File

ckeditor_codemirror.module
View source
<?php

/**
 * @file
 * Main code for CKEditor CodeMirror module.
 */

/**
 * Gets the path of a CKEditor CodeMirror library.
 *
 * @return bool|string
 *   The path to the specified library or FALSE if the library wasn't found.
 */
function _ckeditor_codemirror_get_library_path() {
  $library_names = [
    // README.txt say to use 'ckeditor_codemirror'.
    'ckeditor_codemirror',
    // Old README.txt used 'ckeditor-codemirror'.
    'ckeditor-codemirror',
    // The Webform module is using 'ckeditor.codemirror'.
    'ckeditor.codemirror',
  ];
  foreach ($library_names as $library_name) {
    if (file_exists('libraries/' . $library_name)) {
      return 'libraries/' . $library_name;
    }
  }
  return FALSE;
}

Functions

Namesort descending Description
_ckeditor_codemirror_get_library_path Gets the path of a CKEditor CodeMirror library.