function _homebox_get_css_classes_for_block in Homebox 7.3
Same name and namespace in other branches
- 6.3 homebox.module \_homebox_get_css_classes_for_block()
- 6 homebox.module \_homebox_get_css_classes_for_block()
- 6.2 homebox.module \_homebox_get_css_classes_for_block()
- 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 1307 - 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 (isset($block['movable']) && !($block['movable'] === 0)) {
$classes[] = 'homebox-draggable';
}
// Adds CSS class for collapsed block
if (isset($block['open']) && !$block['open']) {
$classes[] = 'homebox-portlet-collapsed';
}
// Adds CSS for closed block
if (isset($block['status']) && !$block['status']) {
$classes[] = 'homebox-portlet-closed';
}
// Adds CSS if block is unclosable
if (isset($block['closable']) && $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);
}