You are here

function _ckeditor_requirements_isinstalled in CKEditor - WYSIWYG HTML editor 6

Same name and namespace in other branches
  1. 7 includes/ckeditor.lib.inc \_ckeditor_requirements_isinstalled()

Determines whether the CKEditor sources are present

It checks if ckeditor.js is present.

This function is used by ckeditor_requirements()

Return value

boolean True if CKEditor is installed

2 calls to _ckeditor_requirements_isinstalled()
ckeditor_admin_main in includes/ckeditor.admin.inc
Main administrative page
ckeditor_requirements in ./ckeditor.install
Implementation of hook_requirements().

File

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

Code

function _ckeditor_requirements_isinstalled() {
  $editor_path = ckeditor_path(TRUE);
  $jspath = $editor_path . '/ckeditor.js';
  $jsp = file_exists($jspath);
  if (!$jsp && ($editor_path = _ckeditor_script_path())) {
    $result = db_query("SELECT name, settings FROM {ckeditor_settings} WHERE name = 'CKEditor Global Profile'");
    if ($rs = db_fetch_array($result)) {
      $rs['settings'] = unserialize($rs['settings']);
      $rs['settings']['ckeditor_path'] = $editor_path;
      $rs['settings'] = serialize($rs['settings']);
      db_query("UPDATE {ckeditor_settings} SET settings='%s' WHERE name = 'CKEditor Global Profile'", $rs['settings']);
      $jsp = TRUE;
      ckeditor_path(TRUE, TRUE);
    }
  }
  return $jsp;
}