You are here

function pm_helper_get_fa_icon in Drupal PM (Project Management) 7.3

Same name and namespace in other branches
  1. 8 pm.module \pm_helper_get_fa_icon()
  2. 7.2 pm.module \pm_helper_get_fa_icon()

Helper to attach fontawesome icons.

1 call to pm_helper_get_fa_icon()
pm_preprocess_pm_icon in ./pm.theme.inc
Implements hook_preprocess_pm_icon().

File

includes/pm.icon.inc, line 179
Icon handling by Drupal PM.

Code

function pm_helper_get_fa_icon($original_key, $default_class = 'fa_wrench') {
  $context = array(
    'original_key' => $original_key,
    'default_class' => $default_class,
  );
  $key = str_replace(' ', '_', $original_key);
  $key = str_replace('-', '_', $key);
  $map = pm_icon_map();
  $class = isset($map[$key]) ? $map[$key] : $original_key;
  drupal_alter('pm_icon_classes', $class, $key, $context);
  return $class;
}