You are here

function mobile_tools_get_module_names in Mobile Tools 7.2

Same name and namespace in other branches
  1. 5 mobile_tools.module \mobile_tools_get_module_names()
  2. 6.3 mobile_tools.admin.inc \mobile_tools_get_module_names()
  3. 6 mobile_tools.admin.inc \mobile_tools_get_module_names()
  4. 6.2 mobile_tools.admin.inc \mobile_tools_get_module_names()

return the human readable name of the modules

1 call to mobile_tools_get_module_names()
_mobile_tools_external in ./mobile_tools.admin.inc
Help function that retrieves the modules that implement the hook_is_mobile_device() or hook_is_mobile_site() hooks.

File

./mobile_tools.admin.inc, line 365
Adminstrative pages for Mobile Tools

Code

function mobile_tools_get_module_names($modules) {
  $output = array();
  foreach ($modules as $module_value) {
    $query = "SELECT * FROM {system} WHERE type = 'module' AND name = :name";
    $item = db_query($query, array(
      ':name' => $module_value,
    ))
      ->fetchObject();
    if (!empty($item)) {
      $info = $item->info;
      $info = unserialize($info);
      $output[$module_value] = $info['name'];
    }
  }
  return $output;
}