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