You are here

function beautytips_manager_get_custom_tips in BeautyTips 7.2

Same name and namespace in other branches
  1. 8 beautytips_manager/beautytips_manager.module \beautytips_manager_get_custom_tips()
  2. 6.2 beautytips_manager.module \beautytips_manager_get_custom_tips()

Retrieve all custom beautytips.

2 calls to beautytips_manager_get_custom_tips()
beautytips_manager_init in ./beautytips_manager.module
Implements hook_init().
beautytips_manager_tips_manager_page in ./beautytips_manager.admin.inc
Listing of all beautytips available.

File

./beautytips_manager.module, line 188
Code related to defining and displaying custom beautytips and styles.

Code

function beautytips_manager_get_custom_tips() {
  $tips = [];
  $cache = cache_get('beautytips:beautytips-ui-custom-tips');
  if (!$cache) {
    $results = db_query("SELECT * FROM {beautytips_custom_tips}");
    foreach ($results as $result) {
      $tips[$result->id] = $result;
    }
    cache_set('beautytips:beautytips-ui-custom-tips', $tips);
  }
  else {
    $tips = $cache->data;
  }
  return $tips;
}