You are here

function _quickbar_path_to_attribute in Quickbar 7.2

Convert path to valid attribute.

2 calls to _quickbar_path_to_attribute()
quickbar_menu_navigation_links in ./quickbar.module
Generate a links array from a menu tree array.
quickbar_preprocess_quickbar in theme/theme.inc
Preprocessor for theme('quickbar').

File

./quickbar.module, line 529

Code

function _quickbar_path_to_attribute($path) {
  $attribute = str_replace('<front>', 'front', $path);
  $attribute = preg_replace('#^https?://#', '', $attribute);
  $replacements = array(
    '%',
    '<',
    '>',
    '#',
    '/',
  );
  foreach ($replacements as $token) {
    $attribute = str_replace($token, '-', $attribute);
  }
  return $attribute;
}