You are here

function variable_admin_page_module in Variable 7.2

Same name and namespace in other branches
  1. 7 variable_admin/variable_admin.inc \variable_admin_page_module()

Variable overview, by group

1 string reference to 'variable_admin_page_module'
variable_admin_menu in variable_admin/variable_admin.module
Implements hook_menu().

File

variable_admin/variable_admin.inc, line 68
Variable API module - Admin UI

Code

function variable_admin_page_module($name = NULL) {
  variable_include();
  $build['message']['#markup'] = _variable_admin_realm_message();
  $realm_options = _variable_admin_realm_options();
  if ($name && in_array($name, module_list())) {
    $modules = system_list('module_enabled');
    $module = $modules[$name];
    drupal_set_title($module->info['name']);
    $list = variable_list_module($name);
    $build['description']['#markup'] = $module->info['description'];
    $build['form'] = drupal_get_form('variable_edit_form', array_keys($list), $realm_options);
    return $build;
  }
  else {

    // Groups overview
    $build['modules'] = array(
      '#type' => 'vertical_tabs',
    );
    foreach (system_list('module_enabled') as $module) {
      if ($variables = variable_list_module($module->name)) {
        $build['modules'][$module->name] = array(
          '#type' => 'fieldset',
          '#title' => $module->info['name'],
          '#collapsible' => TRUE,
          '#collapsed' => TRUE,
          '#description' => $module->info['description'] . ' ' . l(t('Edit module variables'), 'admin/config/system/variable/module/' . $module->name),
          '#group' => 'modules',
        );
        $build['modules'][$module->name]['list'] = variable_admin_group_list($variables, $realm_options);
      }
    }
    return $build;
  }
}