You are here

function pm_preprocess_html in Drupal PM (Project Management) 8

Same name and namespace in other branches
  1. 7.3 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 526
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);
  $font_awesome_enabled = module_exists('fontawesome');
  switch ($pm_icon) {
    case PM_ICON_SET_DEFAULT_BEHAVIOUR:
      $vars['classes_array'][] = $font_awesome_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;
  }
}