Implements \Drupal\system\Plugin\PluginUIInterface::form().
Overrides PluginUIInterface::form
public function form($form, &$form_state) {
$plugin_definition = $this
->getPluginDefinition();
// @todo Find out how to let the manager be injected into the class.
if (class_exists($plugin_definition['manager'])) {
$manager = new $plugin_definition['manager']();
}
else {
$manager = drupal_container()
->get($plugin_definition['manager']);
}
$plugins = $manager
->getDefinitions();
$rows = array();
foreach ($plugins as $plugin_id => $display_plugin_definition) {
$rows[] = $this
->row($plugin_id, $display_plugin_definition);
}
$form['plugins'] = array(
'#theme' => 'table',
'#header' => $this
->tableHeader(),
'#rows' => $rows,
);
return $form;
}