5bb93d076de1ed0414cf9804d13889807aea2e4e
[yaffs-website] / web / themes / contrib / bootstrap / src / Plugin / Setting / JavaScript / Tooltips / TooltipPlacement.php
1 <?php
2 /**
3  * @file
4  * Contains \Drupal\bootstrap\Plugin\Setting\JavaScript\Tooltips\TooltipPlacement.
5  */
6
7 namespace Drupal\bootstrap\Plugin\Setting\JavaScript\Tooltips;
8
9 use Drupal\bootstrap\Annotation\BootstrapSetting;
10 use Drupal\bootstrap\Plugin\Setting\SettingBase;
11 use Drupal\Core\Annotation\Translation;
12
13 /**
14  * The "tooltip_placement" theme setting.
15  *
16  * @ingroup plugins_setting
17  *
18  * @BootstrapSetting(
19  *   id = "tooltip_placement",
20  *   type = "select",
21  *   title = @Translation("placement"),
22  *   description = @Translation("Where to position the tooltip. When <code>auto</code> is specified, it will dynamically reorient the tooltip. For example, if placement is <code>auto left</code>, the tooltip will display to the left when possible, otherwise it will display right."),
23  *   defaultValue = "auto left",
24  *   options = {
25  *     "top" = @Translation("top"),
26  *     "bottom" = @Translation("bottom"),
27  *     "left" = @Translation("left"),
28  *     "right" = @Translation("right"),
29  *     "auto" = @Translation("auto"),
30  *     "auto top" = @Translation("auto top"),
31  *     "auto bottom" = @Translation("auto bottom"),
32  *     "auto left" = @Translation("auto left"),
33  *     "auto right" = @Translation("auto right"),
34  *   },
35  *   groups = {
36  *     "javascript" = @Translation("JavaScript"),
37  *     "tooltips" = @Translation("Tooltips"),
38  *     "options" = @Translation("Options"),
39  *   },
40  * )
41  */
42 class TooltipPlacement extends SettingBase {
43
44   /**
45    * {@inheritdoc}
46    */
47   public function drupalSettings() {
48     return !!$this->theme->getSetting('tooltip_enabled');
49   }
50
51 }