You are here

function spaces_design_preprocess_page in Spaces 6.2

Turn design choices into theme variables.

1 string reference to 'spaces_design_preprocess_page'
spaces_design_theme_registry_alter in spaces_design/spaces_design.module
Implementation of hook_theme_registry_alter().

File

spaces_design/spaces_design.module, line 58

Code

function spaces_design_preprocess_page(&$vars) {
  $space = spaces_get_space();
  if (!empty($space->settings['color'])) {
    $vars['body_classes'] .= " spaces-design";

    // We add in spaces design styles in their own key to give themes
    // who blow away/reset $vars['styles'] a chance to recover.
    $vars['spaces_design_styles'] = theme('spaces_design', $space->settings['color']);
    $vars['styles'] .= $vars['spaces_design_styles'];
  }
  if (!empty($space->settings['logo']['fid'])) {
    $file = db_fetch_object(db_query('SELECT * FROM {files} f WHERE f.fid = %d', $space->settings['logo']['fid']));
    if ($file->filepath && file_exists($file->filepath)) {
      $vars['spaces_logo'] = theme('spaces_design_logo', $file->filepath);
    }
  }
}