You are here

function homebox_build in Homebox 6

Same name and namespace in other branches
  1. 6.3 homebox.module \homebox_build()
  2. 6.2 homebox.module \homebox_build()
  3. 7.3 homebox.module \homebox_build()
  4. 7.2 homebox.module \homebox_build()

Responsible for firing the hook_theme()

Return value

homebox_theme() call

1 string reference to 'homebox_build'
homebox_menu in ./homebox.module
Implementation of hook_menu().

File

./homebox.module, line 197
Home box main file, takes care of global functions settings constants, etc.

Code

function homebox_build($pid) {

  // If no default block layout is set return a Drupal 404
  if (db_result(db_query("SELECT COUNT(*) FROM {homebox_default} WHERE pid = %d", $pid)) == 0) {
    drupal_not_found();
    exit;
  }

  // Get every block placed into its region sorted by weight
  $regions = homebox_load_blocks_in_regions($pid);

  // Get the list of available blocks to activate/desactivate
  $available_blocks = homebox_list_available_blocks($regions);

  // Is color support enabled?
  if (variable_get('homebox_users_use_colors_' . $pid, FALSE)) {
    $color_css_classes = _homebox_get_css_color_classes($pid);
  }
  else {
    $color_css_classes = NULL;
  }
  $column_count = variable_get('homebox_column_count_' . $pid, 3);
  return theme('homebox', $regions, $available_blocks, $color_css_classes, $column_count, $pid);
}