function ds_extras_is_entity_page_view in Display Suite 7.2
Helper function to check if this is a page view.
The page title option adds the ability to hide or override the page title. However, it can't happen that an entity bleeds its page title to say a view or the frontpage.
See http://drupal.org/node/1526732 and http://drupal.org/node/1446554.
1 call to ds_extras_is_entity_page_view()
- ds_extras_entity_view_alter in modules/
ds_extras/ ds_extras.module - Implements hook_entity_view_alter().
File
- modules/
ds_extras/ ds_extras.module, line 694 - Display Suite extras main functions.
Code
function ds_extras_is_entity_page_view($build, $entity_type) {
switch ($entity_type) {
case 'node':
return node_is_page($build['#node']);
break;
case 'user':
$page_account = menu_get_object('user');
return !empty($page_account) ? $page_account->uid == $build['#account']->uid : FALSE;
break;
case 'taxonomy_term':
$page_term = menu_get_object('taxonomy_term', 2);
return !empty($page_term) ? $page_term->tid == $build['#term']->tid : FALSE;
break;
case 'profile2':
return $build['#view_mode'] == 'page';
break;
}
return FALSE;
}