function ffc_condition_execute_hide_on_pages in Field formatter conditions 7
Hide the source field when the current path is matched.
File
- ./
ffc.module, line 192 - Field formatter conditions.
Code
function ffc_condition_execute_hide_on_pages(&$build, $source, $configuration) {
$pages = $configuration['pages'];
$visibility = $configuration['visibility'];
$path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
$page_match = drupal_match_path($path, $pages);
if ($path != $_GET['q']) {
$page_match = $page_match || drupal_match_path($_GET['q'], $pages);
}
$page_match = !($visibility xor $page_match);
if ($page_match) {
$build[$source]['#access'] = FALSE;
}
}