function advagg_mod_match_path

nittany7 advagg_mod.module advagg_mod_match_path($pages, $visibility)
cis7 advagg_mod.module advagg_mod_match_path($pages, $visibility)
mooc7 advagg_mod.module advagg_mod_match_path($pages, $visibility)

Transforms all CSS files into inline CSS.

Parameters

$pages: string from the advagg_mod_inline_pages variable.

$visibility: visibility setting from the advagg_mod_inline_visibility variable.

See also

block_block_list_alter()

1 call to advagg_mod_match_path()
advagg_mod_inline_page in modules/contrib/advagg/advagg_mod/advagg_mod.module
Returns TRUE if this page should have inline CSS/JS.

File

modules/contrib/advagg/advagg_mod/advagg_mod.module, line 375
Advanced aggregation modifier module.

Code

function advagg_mod_match_path($pages, $visibility) {
  // Limited visibility blocks must list at least one page.
  if ($visibility == BLOCK_VISIBILITY_LISTED && empty($pages)) {
    $page_match = FALSE;
  }
  elseif ($pages) {
    // Match path if necessary.
    // Convert path to lowercase. This allows comparison of the same path
    // with different case. Ex: /Page, /page, /PAGE.
    $pages = drupal_strtolower($pages);
    if ($visibility < BLOCK_VISIBILITY_PHP) {
      // Convert the Drupal path to lowercase
      $path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
      // Compare the lowercase internal and lowercase 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);
      }
      // When $visibility has a value of 0 (BLOCK_VISIBILITY_NOTLISTED),
      // the block is displayed on all pages except those listed in $pages.
      // When set to 1 (BLOCK_VISIBILITY_LISTED), it is displayed only on those
      // pages listed in $block->pages.
      $page_match = !($visibility xor $page_match);
    }
    elseif (module_exists('php')) {
      $page_match = php_eval($pages);
    }
    else {
      $page_match = FALSE;
    }
  }
  else {
    $page_match = TRUE;
  }

  return $page_match;
}