Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / tour / tour.api.php
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  */