function siteimprove_is_frontpage in Siteimprove 7
Trying to detect if the current page is the frontpage.
Return value
bool True if the page is the frontpage, false otherwise.
1 call to siteimprove_is_frontpage()
- siteimprove_init in ./
siteimprove.module - Implements hook_init().
File
- ./
siteimprove.module, line 157 - Drupal Module: Siteimprove Plugin.
Code
function siteimprove_is_frontpage() {
$frontpage = variable_get('site_frontpage', '');
if (drupal_is_front_page()) {
return TRUE;
}
elseif (!empty($frontpage) && preg_match('/(^node\\/\\d*(\\/edit)?$)/', current_path())) {
$current_entity_path = 'node/' . arg(1);
return $current_entity_path == $frontpage;
}
elseif (!empty($frontpage) && preg_match('/(^taxonomy\\/term\\/\\d*(\\/edit)?$)/', current_path())) {
$current_entity_path = 'taxonomy/term/' . arg(2);
return $current_entity_path == $frontpage;
}
else {
return FALSE;
}
}