You are here

function ds_module_list in Display Suite 6.2

Same name and namespace in other branches
  1. 6.3 includes/ds.modules.inc \ds_module_list()

Provide information about all installed modules

1 string reference to 'ds_module_list'
_ds_ui_menu in includes/ds.registry.inc
Return menu items and import default settings.

File

includes/ds.modules.inc, line 37
Info about a module.

Code

function ds_module_list() {
  $output = '';
  foreach (module_implements('ds_api') as $module) {
    $api_info = ds_api_info($module);
    $form = array();

    // Fieldset
    $form[$api_info['module']] = array(
      '#type' => 'fieldset',
      '#title' => t($api_info['title']),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
      '#access' => user_access('administer ' . $api_info['module']),
    );

    // Tools
    $fields = l('Fields', DS_PATH_MODULES . '/' . $api_info['module'] . '/fields');
    $fieldgroups = l('Fieldgroups', DS_PATH_MODULES . '/' . $api_info['module'] . '/fieldgroups');
    $buildmodes = l('Build modes', DS_PATH_MODULES . '/' . $api_info['module'] . '/buildmodes');
    $plugins = l('Plugins', DS_PATH_MODULES . '/' . $api_info['module'] . '/plugins');
    $form[$api_info['module']]['tools'] = array(
      '#value' => '<p>' . $fields . ' | ' . $fieldgroups . ' | ' . $buildmodes . ' | ' . $plugins . '</p>',
      '#weight' => -1,
    );

    // Help
    $help = implode('', $api_info['help']);
    $form[$api_info['module']]['help'] = array(
      '#value' => $help,
    );
    $output .= drupal_render($form);
  }
  if (empty($output)) {
    $output = '<p>' . t('No modules which provide settings were found.') . '</p></p>' . t('For example, to change display options for nodes, use <a href="http://drupal.org/project/nd">Node Displays</a>. Other modules are listed in the <a href="http://drupal.org/node/644662">documentation</a>.') . '</p>';
  }
  return $output;
}