Drupal 7: how to get the modules list
You can use drush pm-list --type=Module --status=enabled
command for getting a list of installed modules.
For further options, please check out http://www.drupaltonight.com/drupal-articles/using-drush-get-list-enabled-modules
Install "Drush" (a good option in any case, once you get used to it, you'll love it). It has a build in command to list all installed modules themes.
If you need to see the list of modules to display it elsewhere (this can be a security issue!), you can look into the way how drush does it (pm.drush.inc:218).
Furthermore there is a core function, but I don't know if this is what you want.
module_list($refresh = FALSE, $bootstrap_refresh = FALSE, $sort = FALSE, $fixed_list = NULL)
Here are more details.http://api.drupal.org/api/drupal/includes!module.inc/function/module_list/7