function theme_mostpopular_block in Drupal Most Popular 6
The main theme function for the most popular block. This theme loads the javascript helper file and a basic stylesheet.
Calls theme('mostpopular_block_services', $service) to render the links to other services.
Calls theme('mostpopular_block_intervals', $interval) to render the links to other intervals.
Calls mostpopular_get_items($sid, $iid) to get the initial list of most popular items. This list can subsequently change via AJAX calls from the service or interval links.
Parameters
integer $sid: The service ID of the currently-selected service.
integer $iid: The interval ID of the currently-selected interval.
1 theme call to theme_mostpopular_block()
- mostpopular_block in ./
mostpopular.module - Implements hook_block() to create the most popular block.
File
- ./
mostpopular.block.inc, line 156 - Defines all the pages, blocks and themes for rendering the most popular data to general users.
Code
function theme_mostpopular_block($sid, $iid) {
_mostpopular_load_stylesheets();
// Load the javascript file
drupal_add_js(drupal_get_path('module', 'mostpopular') . '/js/fade.js');
drupal_add_js(drupal_get_path('module', 'mostpopular') . '/js/mostpopular.js');
// Print the tabs for services and intervals
$tpl = '<div class="mostpopular mostpopular--widget">';
$tpl .= theme('mostpopular_services', $sid, $iid);
$tpl .= theme('mostpopular_intervals', $sid, $iid);
// Show the content
$tpl .= '<div class="mostpopular--content">';
$tpl .= mostpopular_get_items($sid, $iid);
$tpl .= '</div>';
$tpl .= '</div>';
return $tpl;
}