diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-10-06 10:26:39 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-10-06 10:26:39 -0700 |
commit | 408f3a0d9c78bb7f0a633d77b8f2644652acf009 (patch) | |
tree | 37747c545c365a53a3795bf5b1fe8d3174294abc /modules/simpletest | |
parent | 762235d18917536aad7e8dc5ddcf23027247a104 (diff) | |
download | brdo-408f3a0d9c78bb7f0a633d77b8f2644652acf009.tar.gz brdo-408f3a0d9c78bb7f0a633d77b8f2644652acf009.tar.bz2 |
Issue #1067120 by BTMash, DamienMcKenna, corvus_ch, valthebald, mrfelton, fgm, Dave Reid: Fixed Missing hook_taxonomy_term_view() or hook_entity_view() when viewing a term.
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/taxonomy_test.module | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/simpletest/tests/taxonomy_test.module b/modules/simpletest/tests/taxonomy_test.module index aae13a2d4..f82950c30 100644 --- a/modules/simpletest/tests/taxonomy_test.module +++ b/modules/simpletest/tests/taxonomy_test.module @@ -3,6 +3,8 @@ /** * @file * Test module for Taxonomy hooks and functions not used in core. + * + * @see TaxonomyHooksTestCase::testTaxonomyTermHooks() */ /** @@ -55,6 +57,34 @@ function taxonomy_test_taxonomy_term_delete($term) { } /** + * Implements hook_taxonomy_term_view(). + */ +function taxonomy_test_taxonomy_term_view($term, $view_mode, $langcode) { + if ($view_mode == 'full') { + $term->content['taxonomy_test_term_view_check'] = array( + '#prefix' => '<div>', + '#markup' => t('The antonym is %antonym', array('%antonym' => $term->antonym)), + '#suffix' => '</div>', + '#weight' => 10, + ); + } +} + +/** + * Implements hook_entity_view(). + */ +function taxonomy_test_entity_view($entity, $type, $view_mode, $langcode) { + if ($type == 'taxonomy_term' && $view_mode == 'full') { + $entity->content['taxonomy_test_entity_view_check'] = array( + '#prefix' => '<div>', + '#markup' => t('The antonym is %antonym', array('%antonym' => $entity->antonym)), + '#suffix' => '</div>', + '#weight' => 20, + ); + } +} + +/** * Implements hook_form_alter(). */ function taxonomy_test_form_alter(&$form, $form_state, $form_id) { |