You are here

function _mail_edit_module_list in Mail Editor 6

Same name and namespace in other branches
  1. 7 mail_edit.admin.inc \_mail_edit_module_list()

Builds the list of modules that expose mailkeys.

Parameters

bool $all: Return all modules if TRUE, or only enabled ones otherwise.

Return value

array

3 calls to _mail_edit_module_list()
mail_edit_list_filter in ./mail_edit.admin.inc
Filter the mail edit table.
mail_edit_list_filtered_form in ./mail_edit.admin.inc
Create $form array with filtered list.
_mail_edit_list_row in ./mail_edit.admin.inc
Build one row of the mail edit table.

File

./mail_edit.admin.inc, line 313
Administrative interface for the Mail Editor module.

Code

function _mail_edit_module_list($all = FALSE) {
  static $modules;
  if (isset($modules[$all])) {
    return $modules[$all];
  }
  $modules[$all] = array();
  if ($all) {
    $sql = "SELECT name, info FROM {system} WHERE type = 'module' ORDER BY name ASC";
  }
  else {
    $sql = "SELECT name, info FROM {system} WHERE type = 'module' AND status = 1 ORDER BY name ASC";
  }
  $result = db_query($sql);
  while ($module = db_fetch_object($result)) {
    $info = unserialize($module->info);
    $modules[$all][$module->name] = $info['name'];
  }
  return $modules[$all];
}