You are here

public function CKEditor::isCompatible in Quick Edit 7

Implements QuickEditInPlaceEditorInterface::isCompatible().

Overrides QuickEditInPlaceEditorInterface::isCompatible

See also

Drupal 8's \Drupal\editor\Plugin\quickedit\editor\Editor::isCompatible().

File

InPlaceEditors/CKEditor.php, line 22

Class

CKEditor
Defines the CKEditor in-place editor.

Code

public function isCompatible(array $instance, array $items) {
  $field = field_info_field($instance['field_name']);

  // This editor is incompatible with multivalued fields.
  if ($field['cardinality'] != 1) {
    return FALSE;
  }
  elseif (!empty($instance['settings']['text_processing'])) {
    $format_id = $items[0]['format'];
    module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib');
    if ($ckeditor_profile = ckeditor_get_profile($format_id)) {
      if ($settings = ckeditor_profiles_compile($format_id)) {
        return $ckeditor_profile->settings['default'] === 't';
      }
    }
    return FALSE;
  }
}