Version 1
[yaffs-website] / web / modules / contrib / ctools / src / Ajax / OpenModalWizardCommand.php
1 <?php
2
3 namespace Drupal\ctools\Ajax;
4
5 use Drupal\Core\Ajax\OpenModalDialogCommand;
6
7 class OpenModalWizardCommand extends OpenModalDialogCommand {
8
9   public function __construct($object, $tempstore_id, array $parameters = array(), array $dialog_options = array(), $settings = NULL) {
10     // Instantiate the wizard class properly.
11     $parameters += [
12       'tempstore_id' => $tempstore_id,
13       'machine_name' => NULL,
14       'step' => NULL,
15     ];
16     $form = \Drupal::service('ctools.wizard.factory')->getWizardForm($object, $parameters, TRUE);
17     $title = isset($form['#title']) ? $form['#title'] : '';
18     $content = $form;
19
20     parent::__construct($title, $content, $dialog_options, $settings);
21   }
22
23 }