You are here

function fckeditor_idsearch in FCKeditor - WYSIWYG HTML editor 5

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

Search the field id for matches in array of matches

@ param $array An $array with strings to match the $search parameter against

Parameters

$search: A string representing a form field id

Return value

TRUE on match, FALSE on no match

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

File

./fckeditor.module, line 465
FCKeditor Module for Drupal 5.x

Code

function fckeditor_idsearch($search, $array) {
  foreach ($array as $key => $value) {
    if (!empty($value) && preg_match('/^' . str_replace('*', '.*', addslashes($value)) . '$/i', $search)) {

      // on any first match we know we're done here so return positive
      return true;
    }
  }
  return false;
}