You are here

function _ueditor_page_match in UEditor - 百度编辑器 7.3

Same name and namespace in other branches
  1. 7.2 ueditor.module \_ueditor_page_match()

ueditor match pages with current path.

1 call to _ueditor_page_match()
ueditor_init in ./ueditor.module
Implementation of hook_init().

File

./ueditor.module, line 697
Integration ueditor for wysiwyg.

Code

function _ueditor_page_match() {
  $inject = variable_get('ueditor_inject', UEDITOR_INJECT_EXCEPT_LISTED);
  $pages = variable_get('ueditor_pages', "admin\nadmin/*\nuser\nuser/*\nimce\nimce/*\nueditor/controller\nueditor/controller/*\n");
  $path = drupal_get_path_alias($_GET['q']);

  // Compare with the internal and path alias (if any).
  $page_match = drupal_match_path($path, $pages);
  if ($path != $_GET['q']) {
    $page_match = $page_match || drupal_match_path($_GET['q'], $pages);
  }
  return !($inject xor $page_match);
}