You are here

function _mail_edit_module_list in Mail Editor 7

Same name and namespace in other branches
  1. 6 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 327
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();
  $query = db_select('system', 's')
    ->fields('s', array(
    'name',
    'info',
  ))
    ->condition('s.type', 'module')
    ->orderBy('s.name');
  if (!$all) {
    $query
      ->condition('s.status', 1);
  }
  foreach ($query
    ->execute() as $module) {
    $info = unserialize($module->info);
    if (isset($info['name'])) {
      $modules[$all][$module->name] = $info['name'];
    }
  }
  return $modules[$all];
}