function mostpopular_service_load_by_block in Drupal Most Popular 7
Loads configured most popular services within the given block.
Parameters
integer $bid : The block ID.
boolean $enabled: If true (default), only enabled services will be retrieved. If false, all services will be retrieved.
Return value
array An array of most popular service configurations.
4 calls to mostpopular_service_load_by_block()
- mostpopular_block_delete in ./
mostpopular.module - mostpopular_block_view in ./
mostpopular.module - Implements hook_block_view().
- mostpopular_refresh in ./
mostpopular.module - Refreshes data from each service by invoking the refresh callback for each service.
- mostpopular_services_admin_form in ./
mostpopular.services.inc - Renders a form for configuring the blocks and services.
File
- ./
mostpopular.module, line 433 - The main file for the Most Popular module.
Code
function mostpopular_service_load_by_block($bid, $enabled = TRUE, $reset = FALSE) {
$services =& drupal_static(__FUNCTION__, array());
if (!isset($services[$bid]) || $reset) {
$params = array(
'bid' => $bid,
);
if ($enabled) {
$params['enabled'] = TRUE;
}
$services[$bid] = mostpopular_service_load_multiple(array(), $params);
}
return $services[$bid];
}