You are here

function panels_mini_get_id in Panels 6.3

Same name and namespace in other branches
  1. 5.2 panels_mini/panels_mini.module \panels_mini_get_id()
  2. 6.2 panels_mini/panels_mini.module \panels_mini_get_id()
  3. 7.3 panels_mini/panels_mini.module \panels_mini_get_id()

Statically store all used IDs to ensure all mini panels get a unique id.

2 calls to panels_mini_get_id()
panels_mini_block in panels_mini/panels_mini.module
Implementation of hook_block().
panels_mini_panels_mini_content_type_render in panels_mini/plugins/content_types/panels_mini.inc
Render a mini panel called from a panels display.

File

panels_mini/panels_mini.module, line 96
panels_mini.module

Code

function panels_mini_get_id($name) {
  static $id_cache = array();
  $id = 'mini-panel-' . $name;
  if (!empty($id_cache[$name])) {
    $id .= "-" . $id_cache[$name]++;
  }
  else {
    $id_cache[$name] = 1;
  }
  return $id;
}