You are here

function bg_image_ui_page_has_bg_image in Background Images 7

Checks if the current path has a background image. If it does, we return the nid of the matching path or pattern. Othewise return false.

1 call to bg_image_ui_page_has_bg_image()
bg_image_ui_init in bg_image_ui/bg_image_ui.module
Implements hook_init()

File

bg_image_ui/bg_image_ui.module, line 324

Code

function bg_image_ui_page_has_bg_image() {
  $current_path_alias = drupal_get_path_alias($_GET['q']);
  $current_path = $_GET['q'];
  foreach (bg_image_ui_get_paths() as $pid => $item) {
    if (drupal_match_path($current_path, $item->path) || drupal_match_path($current_path_alias, $item->path)) {
      return $item->nid;
    }
  }
  return FALSE;
}