diff --git a/core/modules/book/book.module b/core/modules/book/book.module index c30e66f..82e5d03 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -253,14 +253,9 @@ function book_admin_paths() { */ function book_entity_info_alter(&$info) { // Add the 'Print' view mode for nodes. - if (!isset($info['node']['view_modes'])) { - $info['node']['view_modes'] = array(); - } - $info['node']['view_modes'] += array( - 'print' => array( - 'label' => t('Print'), - 'custom settings' => FALSE, - ), + $info['node']['view_modes']['print'] = array( + 'label' => t('Print'), + 'custom settings' => FALSE, ); } diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index c8360fb..220e957 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -101,11 +101,9 @@ function comment_help($path, $arg) { * Implements hook_entity_info_alter(). */ function comment_entity_info_alter(&$info) { - $info['comment']['view_modes'] = array( - 'full' => array( - 'label' => t('Full comment'), - 'custom settings' => FALSE, - ), + $info['comment']['view_modes']['full'] = array( + 'label' => t('Full comment'), + 'custom settings' => FALSE, ); foreach (node_type_get_names() as $type => $name) { diff --git a/core/modules/file/file.module b/core/modules/file/file.module index f1299a3..4588d4d 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -91,11 +91,9 @@ function file_element_info() { * Implements hook_entity_info_alter(). */ function file_entity_info_alter(&$info) { - $info['file']['view_modes'] = array( - 'full' => array( - 'label' => t('File default'), - 'custom settings' => FALSE, - ), + $info['file']['view_modes']['full'] = array( + 'label' => t('File default'), + 'custom settings' => FALSE, ); } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 26f1fcb..7f90db6 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -197,19 +197,17 @@ function node_entity_info_alter(&$info) { $info['node']['bundle_keys'] = array( 'bundle' => 'type', ); - $info['node']['view_modes'] = array( - 'full' => array( - 'label' => t('Full content'), - 'custom settings' => FALSE, - ), - 'teaser' => array( - 'label' => t('Teaser'), - 'custom settings' => TRUE, - ), - 'rss' => array( - 'label' => t('RSS'), - 'custom settings' => FALSE, - ), + $info['node']['view_modes']['full'] = array( + 'label' => t('Full content'), + 'custom settings' => FALSE, + ); + $info['node']['view_modes']['teaser'] = array( + 'label' => t('Teaser'), + 'custom settings' => TRUE, + ); + $info['node']['view_modes']['rss'] = array( + 'label' => t('RSS'), + 'custom settings' => FALSE, ); // Add a translation handler for fields if the language module is enabled. @@ -220,15 +218,13 @@ function node_entity_info_alter(&$info) { // Search integration is provided by node.module, so search-related // view modes for nodes are defined here and not in search.module. if (module_exists('search')) { - $info['node']['view_modes'] += array( - 'search_index' => array( - 'label' => t('Search index'), - 'custom settings' => FALSE, - ), - 'search_result' => array( - 'label' => t('Search result'), - 'custom settings' => FALSE, - ), + $info['node']['view_modes']['search_index'] = array( + 'label' => t('Search index'), + 'custom settings' => FALSE, + ); + $info['node']['view_modes']['search_result'] = array( + 'label' => t('Search result'), + 'custom settings' => FALSE, ); } diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 147cc36..ceba797 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -112,12 +112,9 @@ function taxonomy_entity_info_alter(&$info) { $info['taxonomy_term']['bundle_keys'] = array( 'bundle' => 'machine_name', ); - $info['taxonomy_term']['view_modes'] = array( - // @todo View mode for display as a field (when attached to nodes etc). - 'full' => array( - 'label' => t('Taxonomy term page'), - 'custom settings' => FALSE, - ), + $info['taxonomy_term']['view_modes']['full'] = array( + 'label' => t('Taxonomy term page'), + 'custom settings' => FALSE, ); foreach (taxonomy_vocabulary_get_names() as $machine_name => $vocabulary) { $info['taxonomy_term']['bundles'][$machine_name] = array( @@ -130,11 +127,9 @@ function taxonomy_entity_info_alter(&$info) { ), ); } - $info['taxonomy_vocabulary']['view_modes'] = array( - 'full' => array( - 'label' => t('Taxonomy vocabulary default'), - 'custom settings' => FALSE, - ), + $info['taxonomy_vocabulary']['view_modes']['full'] = array( + 'label' => t('Taxonomy vocabulary default'), + 'custom settings' => FALSE, ); } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 19d2426..8b05731 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -149,11 +149,9 @@ function user_entity_info_alter(&$info) { 'access arguments' => array('administer users'), ), ); - $info['user']['view_modes'] = array( - 'full' => array( - 'label' => t('User account'), - 'custom settings' => FALSE, - ), + $info['user']['view_modes']['full'] = array( + 'label' => t('User account'), + 'custom settings' => FALSE, ); }