You are here

function _homebox_get_css_classes_for_block in Homebox 6.3

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

Helper function which adds CSS classes to block, for jQuery to work properly

Parameters

$block: A block array

Return value

A string containing CSS classes

1 call to _homebox_get_css_classes_for_block()
homebox_prepare_block in ./homebox.module
Prepare a block for rendering with theme('homebox_block').

File

./homebox.module, line 1257
Homebox main file, takes care of global functions settings constants, etc.

Code

function _homebox_get_css_classes_for_block($block) {
  $classes = array(
    'homebox-portlet',
  );

  // Is the block movable?
  if (!($block['movable'] === 0)) {
    $classes[] = 'homebox-draggable';
  }

  // Adds CSS class for collapsed block
  if (!$block['open']) {
    $classes[] = 'homebox-portlet-collapsed';
  }

  // Adds CSS for closed block
  if (!$block['status']) {
    $classes[] = 'homebox-portlet-closed';
  }

  // Adds CSS if block is unclosable
  if ($block['closable'] === 0) {
    $classes[] = 'homebox-unclosable';
  }

  // Adds color css class
  if (isset($block['color']) && $block['color'] != 'default') {
    $classes[] = 'homebox-color-' . drupal_strtolower($block['color']);
  }
  return implode(" ", $classes);
}