function _facetapi_html_id in Facet API 6.3
1 call to _facetapi_html_id()
- FacetapiWidgetLinks::buildListItems in plugins/facetapi/widget_links.inc
- Recursive function that converts the render array into an array that can be
passed to theme_item_list().
File
- ./facetapi.module, line 1334
- An abstracted facet API that can be used by various search backends.
Code
function _facetapi_html_id($id) {
$id_counter =& ctools_static(__FUNCTION__, array());
$id = strtr(drupal_strtolower($id), array(
' ' => '-',
'_' => '-',
'[' => '-',
']' => '',
));
$id = preg_replace('/[^A-Za-z0-9\\-_]/', '', $id);
$id = preg_replace('/\\-+/', '-', $id);
if (isset($id_counter[$id])) {
$id_counter[$id]++;
}
else {
$id_counter[$id] = 0;
}
$id .= '-' . $id_counter[$id];
return $id;
}