You are here

function ctools_automodal_is_path_modal in CTools Auto-modal 7

Check if an internal Drupal path should be converted to a modal link.

1 call to ctools_automodal_is_path_modal()
ctools_automodal_preprocess_link in ./ctools_automodal.module
Implements hook_preprocess_link().

File

./ctools_automodal.module, line 46

Code

function ctools_automodal_is_path_modal($path) {
  static $modal_paths_regex;
  if (!isset($modal_paths_regex)) {
    $modal_paths = variable_get('ctools_automodal_paths', array());
    foreach ($modal_paths as &$modal_path) {
      $modal_path = preg_quote($modal_path, '/');
      $modal_path = str_replace('\\*', '.*', $modal_path);
    }
    $modal_paths_regex = '/^(' . implode('|', $modal_paths) . ')$/';
  }
  return (bool) preg_match($modal_paths_regex, $path);
}