You are here

function _modal_forms_active in Modal forms (with ctools) 6

Same name and namespace in other branches
  1. 7 modal_forms.module \_modal_forms_active()

Check if modal_forms should be active for the current URL.

Return value

TRUE if modal_forms should be active for the current page.

1 call to _modal_forms_active()
_modal_forms_doheader in ./modal_forms.module
Loads the various js and css files.

File

./modal_forms.module, line 127
Modal Forms allows you to activate a Ctools based ajax modal on common Drupal forms

Code

function _modal_forms_active() {

  // Code from the block_list funtion in block.module.
  $path = drupal_get_path_alias($_GET['q']);
  $modal_forms_pages = variable_get('modal_forms_pages', "admin*\nimg_assist*\nimce*\nnode/add/*\nnode/*/edit");

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