You are here

function pm_preprocess_html in Drupal PM (Project Management) 7.3

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

Set body class to use pm default icons if required.

File

./pm.module, line 360
Main module file for the Project Management module.

Code

function pm_preprocess_html(&$vars) {
  $pm_icon = variable_get('pm_icon', PM_ICON_SET_DEFAULT_BEHAVIOUR);
  switch ($pm_icon) {
    case PM_ICON_SET_DEFAULT_BEHAVIOUR:

      // Use fontawesome icons if available, defer to legacy otherwise.
      $fontawesome_status = _pm_get_fontawesome_status();
      $vars['classes_array'][] = $fontawesome_status == PM_FONTAWESOME_ENABLED ? "pm-use-fa-icons" : "pm-use-storm-icons";
      break;
    case PM_ICON_SET_FONTAWESOME:
      $vars['classes_array'][] = "pm-use-fa-icons";
      break;
    case PM_ICON_SET_STORM:
      $vars['classes_array'][] = "pm-use-storm-icons";
      break;
  }
}