You are here

function menu_position_menu_position_condition_pages in Menu Position 6

Same name and namespace in other branches
  1. 7.2 plugins/menu_position.pages.inc \menu_position_menu_position_condition_pages()
  2. 7 plugins/menu_position.pages.inc \menu_position_menu_position_condition_pages()

Checks if the node is of a certain type.

Parameters

$variables: An array containing each of the variables saved in the database necessary to evaluate this condition of the rule.

Return value

TRUE if condition applies successfully. Otherwise FALSE.

File

plugins/menu_position.pages.inc, line 16
Provides the "Pages" rule plugin for the Menu Position module.

Code

function menu_position_menu_position_condition_pages($variables) {

  // Grab the variables stored statically in the rule.
  $pages = $variables['pages'];

  // 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 (!$page_match && $path != $_GET['q']) {
    $page_match = drupal_match_path($_GET['q'], $pages);
  }
  return $page_match;
}