You are here

function cpn_codemirror in Code per Node 7

Same name and namespace in other branches
  1. 6 cpn.module \cpn_codemirror()

Returns path to CodeMirror, or FALSE if not found.

3 calls to cpn_codemirror()
cpn_attach_syntax_highlighting in ./cpn.module
Attaches syntax highlighting to a form element.
cpn_codemirror_version in ./cpn.module
Identify the version of CodeMirror that is currently available.
cpn_settings in ./cpn.admin.inc
Settings form.

File

./cpn.module, line 789
Primary hook implementations.

Code

function cpn_codemirror() {
  static $path;

  // Only process this once per page load.
  if (is_null($path)) {
    if (module_exists('libraries')) {
      $path = libraries_get_path('codemirror');
    }
    else {
      $path = 'sites/all/libraries/codemirror';
    }
    $path = file_exists($path) && is_dir($path) ? $path : FALSE;
  }
  return $path;
}