You are here

function hosting_server_preprocess in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 server/hosting_server.module \hosting_server_preprocess()

Implements hook_preprocess().

File

server/hosting_server.module, line 852

Code

function hosting_server_preprocess(&$variables) {
  if (isset($variables['view']) && array_key_exists('services', $variables['view']->field)) {
    if ($variables['header']) {
      $services = explode(',', $variables['header']['services']);

      // Split our headers and fields.
      _hosting_server_preprocess_explode($variables['header']);
      _hosting_server_preprocess_explode($variables['rows'], 1);

      // Adjust the rest of the $variables accordingly.
      _hosting_server_preprocess_expand($variables['header_classes'], $services);
      _hosting_server_preprocess_expand($variables['field_attributes'], $services);
      _hosting_server_preprocess_expand($variables['field_classes'], $services);
      _hosting_server_preprocess_expand($variables['fields'], $services);

      // Add service availability classes.
      _hosting_server_preprocess_classes($variables['field_classes'], $variables['rows']);
    }
  }
}