You are here

function mostpopular_service_info in Drupal Most Popular 7

Gets the list of available services.

See also

hook_mostpopular_service_info()

3 calls to mostpopular_service_info()
mostpopular_services_admin_form in ./mostpopular.services.inc
Renders a form for configuring the blocks and services.
mostpopular_services_admin_form_add_service in ./mostpopular.services.inc
mostpopular_service_load_multiple in ./mostpopular.module
Implements hook_load_multiple().

File

./mostpopular.module, line 368
The main file for the Most Popular module.

Code

function mostpopular_service_info($module = NULL, $delta = NULL) {
  $services =& drupal_static(__FUNCTION__);
  if (!isset($services)) {
    $services = array();
    foreach (module_implements('mostpopular_service_info') as $m) {
      $info = module_invoke($m, 'mostpopular_service_info');
      foreach ($info as $d => $data) {
        $data += array(
          'module' => $m,
          'delta' => $d,
          'title' => '',
        );
        $services[$m][$d] = $data;
      }
    }
  }
  if (!empty($module)) {
    if (!empty($delta)) {
      if (isset($services[$module][$delta])) {
        return $services[$module][$delta];
      }
      return FALSE;
    }
    if (isset($services[$module])) {
      return $services[$module];
    }
    return FALSE;
  }
  return $services;
}