SetDialogTitleCommand.php 683 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Drupal\Core\Ajax;
  3. /**
  4. * Defines an AJAX command that sets jQuery UI dialog properties.
  5. *
  6. * @ingroup ajax
  7. */
  8. class SetDialogTitleCommand extends SetDialogOptionCommand {
  9. /**
  10. * Constructs a SetDialogTitleCommand object.
  11. *
  12. * @param string $selector
  13. * The selector of the dialog whose title will be set. If set to an empty
  14. * value, the default modal dialog will be selected.
  15. * @param string $title
  16. * The title that will be set on the dialog.
  17. */
  18. public function __construct($selector, $title) {
  19. $this->selector = $selector ? $selector : '#drupal-modal';
  20. $this->optionName = 'title';
  21. $this->optionValue = $title;
  22. }
  23. }