Commit d1335cf6 authored by dawehner's avatar dawehner Committed by tim.plunkett

Make the wizard working again

parent 65dc722d
......@@ -381,7 +381,7 @@ function views_ui_add_form($form, &$form_state) {
$wizard_key = $show_form['wizard_key']['#default_value'];
views_include_handlers();
$manager = new WizardManager();
$manager = views_get_plugin_manager('wizard');
$info = $manager->getDefinition($wizard_key);
$wizard_instance = $manager->createInstance($wizard_key, $info);
$form = $wizard_instance->build_form($form, $form_state);
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\views\Plugins\Type\WizardManager.
* Definition of Drupal\views\Plugins\Type\WizardPluginManager.
*/
namespace Drupal\views\Plugins\Type;
......@@ -11,7 +11,7 @@
use Drupal\Component\Plugin\Factory\DefaultFactory;
use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
class WizardManager extends PluginManagerBase {
class WizardPluginManager extends PluginManagerBase {
public function __construct() {
$this->discovery = new AnnotatedClassDiscovery('views', 'wizard');
$this->factory = new DefaultFactory($this->discovery);
......
......@@ -120,7 +120,7 @@ function build_form($form, &$form_state) {
'#size' => 5,
'#element_validate' => array('views_element_validate_integer'),
);
$form['displays']['page']['options']['pagerz'] = array(
$form['displays']['page']['options']['pager'] = array(
'#title' => t('Use a pager'),
'#type' => 'checkbox',
'#default_value' => TRUE,
......@@ -431,6 +431,12 @@ protected function build_sorts(&$form, &$form_state) {
$sorts += $this->plugin['available_sorts'];
}
foreach ($sorts as &$option) {
if (is_object($option)) {
$option = $option->get();
}
}
// If there is no sorts option available continue.
if (!empty($sorts)) {
$form['displays']['show']['sort'] = array(
......
......@@ -27,6 +27,7 @@
use Drupal\views\Plugins\Type\ExposedFormPluginManager;
use Drupal\views\Plugins\Type\HandlerPluginManager;
use Drupal\views\Plugins\Type\DisplayExtenderPluginManager;
use Drupal\views\Plugins\Type\WizardPluginManager;
/**
* Advertise the current views api version
......@@ -1427,6 +1428,9 @@ function views_get_plugin_manager($type) {
case 'display_extender':
$manager = new DisplayExtenderPluginManager();
break;
case 'wizard':
$manager = new WizardPluginManager();
break;
case 'field':
case 'filter':
case 'argument':
......
......@@ -578,7 +578,8 @@ function views_ui_get_wizard($wizard_type) {
*/
function views_ui_get_wizards() {
ctools_include('plugins');
$wizard_plugins = module_invoke_all('views_wizard');
$manager = views_get_plugin_manager('wizard');
$wizard_plugins = $manager->getDefinitions();
$wizard_tables = array();
foreach ($wizard_plugins as $name => $info) {
$wizard_tables[$info['base_table']] = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment