comparison core/modules/tour/tour.api.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php
2
3 /**
4 * @file
5 * Describes API functions for tour module.
6 */
7
8 /**
9 * @addtogroup hooks
10 * @{
11 */
12
13 /**
14 * Allow modules to alter tour items before render.
15 *
16 * @param array $tour_tips
17 * Array of \Drupal\tour\TipPluginInterface items.
18 * @param \Drupal\Core\Entity\EntityInterface $entity
19 * The tour which contains the $tour_tips.
20 */
21 function hook_tour_tips_alter(array &$tour_tips, Drupal\Core\Entity\EntityInterface $entity) {
22 foreach ($tour_tips as $tour_tip) {
23 if ($tour_tip->get('id') == 'tour-code-test-1') {
24 $tour_tip->set('body', 'Altered by hook_tour_tips_alter');
25 }
26 }
27 }
28
29 /**
30 * Allow modules to alter tip plugin definitions.
31 *
32 * @param array $info
33 * The array of tip plugin definitions, keyed by plugin ID.
34 *
35 * @see \Drupal\tour\Annotation\Tip
36 */
37 function hook_tour_tips_info_alter(&$info) {
38 // Swap out the class used for this tip plugin.
39 if (isset($info['text'])) {
40 $info['class'] = 'Drupal\mymodule\Plugin\tour\tip\MyCustomTipPlugin';
41 }
42 }
43
44 /**
45 * @} End of "addtogroup hooks".
46 */