You are here

function advanced_help_get_module_name in Advanced Help 7

Same name and namespace in other branches
  1. 5 advanced_help.module \advanced_help_get_module_name()
  2. 6 advanced_help.module \advanced_help_get_module_name()

Small helper function to get a module's proper name.

Parameters

string $module: Name of the module.

Return value

string Returns module's descriptive name.

2 calls to advanced_help_get_module_name()
advanced_help_index_page in ./advanced_help.module
Page callback to view the advanced help topic index.
advanced_help_topic_page in ./advanced_help.module
Page callback to view a help topic.

File

./advanced_help.module, line 463
Pluggable system to provide advanced help facilities for Drupal and modules.

Code

function advanced_help_get_module_name($module) {
  $settings = advanced_help_get_settings();
  if (isset($settings[$module]['name'])) {
    $name = $settings[$module]['name'];
  }
  else {
    $info = db_query("SELECT s.info FROM {system} s WHERE s.name = :name", array(
      ':name' => $module,
    ))
      ->fetchField();
    $info = unserialize($info);
    $name = t($info['name']);
  }
  return $name;
}