You are here

function beautytips_get_styles in BeautyTips 8

Same name and namespace in other branches
  1. 6.2 beautytips.module \beautytips_get_styles()
  2. 7.2 beautytips.module \beautytips_get_styles()

Get all the defined beautytips styles

4 calls to beautytips_get_styles()
BeautytipsConfigForm::buildForm in src/Form/BeautytipsConfigForm.php
Form constructor.
beautytips_add_js in ./beautytips.module
Add the basic beautytips javascript to the page.
beautytips_get_style in ./beautytips.module
Get an array of options that defines a particular style
CustomTipsEditForm::buildForm in beautytips_manager/src/Form/CustomTipsEditForm.php
Form constructor.

File

./beautytips.module, line 101
Provides API for adding beautytips to pages.

Code

function beautytips_get_styles($reload = FALSE) {
  $cache = \Drupal::cache()
    ->get('beautytips:beautytips-styles');
  if (!$cache || $reload) {
    $styles = \Drupal::moduleHandler()
      ->invokeAll('define_beautytips_styles');
    \Drupal::moduleHandler()
      ->alter('define_beautytips_styles', $styles);

    // Save the beautytips style registry in the cache.
    \Drupal::cache()
      ->set('beautytips:beautytips-styles', $styles, CacheBackendInterface::CACHE_PERMANENT, [
      'beautytips',
    ]);
  }
  else {
    $styles = $cache->data;
  }
  return $styles;
}