You are here

function bueditor_check_page in BUEditor 6.2

Same name and namespace in other branches
  1. 6 bueditor.module \bueditor_check_page()
  2. 7 bueditor.inc \bueditor_check_page()

Check if the editor is visible in the page.

1 call to bueditor_check_page()
_bueditor_textarea in ./bueditor.inc
Integrate the editor into textareas.

File

./bueditor.inc, line 209
Implements commonly used functions for bueditor.

Code

function bueditor_check_page($page, $editor) {
  $editor = is_numeric($editor) ? bueditor_editors($editor) : $editor;
  if ($editor) {
    if (drupal_match_path($page, $editor->pages)) {
      return $editor;
    }
    $alias = drupal_get_path_alias($page);
    if ($alias != $page && drupal_match_path($alias, $editor->pages)) {
      return $editor;
    }
    if (arg(0) == 'node' && arg(2) == 'edit') {
      $node = node_load(arg(1));
      if ($node && drupal_match_path('node/add/' . str_replace('_', '-', $node->type), $editor->pages)) {
        return $editor;
      }
    }
  }
  return FALSE;
}