You are here

function ds_module_list in Display Suite 6.3

Same name and namespace in other branches
  1. 6.2 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 = '';
  $modules = ds_get_display_handlers();
  foreach ($modules as $key => $module) {
    $form = array();

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

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

    // Help
    $form[$key]['help'] = array(
      '#value' => $module['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;
}