You are here

function template_preprocess_getlocations_box in Get Locations 7

Same name and namespace in other branches
  1. 6.2 getlocations.theme.inc \template_preprocess_getlocations_box()
  2. 6 getlocations.theme.inc \template_preprocess_getlocations_box()
  3. 7.2 getlocations.module \template_preprocess_getlocations_box()

Prepares variables for getlocations_box.tpl.php

Parameters

array $variables: An associative array containing all the elements to construct an HTML document suitable for use in a colorbox.

File

./getlocations.module, line 7354
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function template_preprocess_getlocations_box(&$variables) {
  if (module_exists('admin_menu')) {
    admin_menu_suppress();
  }
  $getlocations_paths = getlocations_paths_get();
  drupal_add_js($getlocations_paths['getlocations_box_path']);

  // Construct page title
  if (drupal_get_title()) {
    $head_title = array(
      strip_tags(drupal_get_title()),
      variable_get('site_name', 'Drupal'),
    );
  }
  else {
    $head_title = array(
      variable_get('site_name', 'Drupal'),
    );
    if (variable_get('site_slogan', '')) {
      $head_title[] = variable_get('site_slogan', '');
    }
  }
  $variables['head_title'] = implode(' | ', $head_title);
  $variables['base_path'] = base_path();
  $variables['head'] = drupal_get_html_head();
  $variables['language'] = $GLOBALS['language'];
  $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
  $variables['css'] = drupal_add_css();
  $variables['styles'] = drupal_get_css();
  $variables['scripts'] = drupal_get_js();
  $variables['title'] = drupal_get_title();

  // Closure should be filled last.
  $variables['closure'] = theme('closure');

  // Compile a list of classes that are going to be applied to the body element.
  // This allows advanced theming based on context (home page, node of certain type, etc.).
  $body_classes = array();

  // Add a class that tells us whether we're on the front page or not.
  $body_classes[] = $variables['is_front'] ? 'front' : 'not-front';

  // Add a class that tells us whether the page is viewed by an authenticated user or not.
  $body_classes[] = $variables['logged_in'] ? 'logged-in' : 'not-logged-in';
  $body_classes[] = 'no-sidebars';

  // Implode with spaces.
  $variables['body_classes'] = implode(' ', $body_classes);
}