function theme_rotor_block in Rotor Banner 5.7
Same name and namespace in other branches
- 5 rotor.module \theme_rotor_block()
- 6 rotor.module \theme_rotor_block()
Theme function for the block
Parameters
array $items The list of nodes to present in the block.:
1 theme call to theme_rotor_block()
- rotor_block_content in ./
rotor.module - Returns the block content.
File
- ./
rotor.module, line 305 - A rotor banner consists in a set of images that will be changing. This module is made using jquery.
Code
function theme_rotor_block($items = array()) {
if (count($items) == 0) {
return '';
}
// Prints the script variables and includes the rotor javascript file.
$time = variable_get('rotor_seconds', 10);
drupal_add_js(drupal_get_path('module', 'rotor') . '/rotor.js');
drupal_add_js('var rotor_enabled = true;', 'inline');
drupal_add_js('var rotor_time = ' . $time . ';', 'inline');
// Print the rotor items.
$output = '<div id="rotor">';
if (variable_get('rotor_group_tabs', ROTOR_GROUP_TABS) == ROTOR_GROUP_TABS) {
$output .= theme('rotor_tabs', $items);
$output .= theme('rotor_items', $items);
}
else {
$output .= theme('rotor_items', $items);
}
$output .= '</div>';
return $output;
}