You are here

function fckeditor_is_enabled in FCKeditor - WYSIWYG HTML editor 6

Same name and namespace in other branches
  1. 5.2 fckeditor.module \fckeditor_is_enabled()
  2. 6.2 fckeditor.module \fckeditor_is_enabled()

Parameters

int $excl_mode 1/include, exclude otherwise:

string $excl_fields fields (HTML IDs):

string $excl_paths paths (drupal paths):

string $element_id current ID:

string $get_q current path:

Return value

boolean returns true if FCKeditor is enabled

1 call to fckeditor_is_enabled()
fckeditor_process_textarea in ./fckeditor.module
This function create the HTML objects required for the FCKeditor

File

./fckeditor.module, line 778
FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben

Code

function fckeditor_is_enabled($excl_mode, $excl_fields, $excl_paths, $element_id, $get_q) {
  $arr_excl_fields = preg_split("/[\\s,]+/", strip_tags($excl_fields));
  $field_found = fckeditor_idsearch($element_id, $arr_excl_fields);
  $path = drupal_get_path_alias($get_q);
  $regexp = '/^(' . preg_replace(array(
    '/(\\r\\n?|\\n)/',
    '/\\\\\\*/',
    '/(^|\\|)\\\\<front\\\\>($|\\|)/',
  ), array(
    '|',
    '.*',
    '\\1' . preg_quote(variable_get('site_frontpage', 'node'), '/') . '\\2',
  ), preg_quote($excl_paths, '/')) . ')$/';
  $path_found = preg_match($regexp, $path);
  $found = $field_found || $path_found;
  $result = $excl_mode == 1 ? $found : !$found;
  return $result;
}