You are here

function ds_plugins in Display Suite 6.2

Same name and namespace in other branches
  1. 6 includes/ds.plugins.inc \ds_plugins()

Menu callback. Registers plugins for a module.

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

File

includes/ds.plugins.inc, line 11
Administration functions for DS plugins.

Code

function ds_plugins($form_state, $module) {
  $form = array();
  $form['#module'] = $module;
  $form['info'] = array(
    '#type' => 'item',
    '#value' => t('Enable or disable plugins for this module.'),
  );
  $plugins = ds_plugins_retrieve($module);
  $plugin_settings = variable_get($module . '_plugin_settings', array());
  if (is_array($plugins)) {
    $form['#plugins'] = $plugins;
    foreach ($plugins as $key => $plugin) {
      $form['plugin_' . $plugin['key']] = array(
        '#type' => 'checkbox',
        '#default_value' => isset($plugin_settings[$plugin['key']]['status']) ? $plugin_settings[$plugin['key']]['status'] : 0,
      );
    }
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}