1 ajax.inc ajax_command_set_dialog_option($selector, $option_name, $option_value)

Provides an AJAX command that sets jQuery UI dialog properties.

This command is implemented by Backdrop.ajax.prototype.commands.setDialogOption() defined in misc/dialog.ajax.js.

Parameters

string $selector: The selector of the dialog whose title will be set. If set to an empty value, the default modal dialog will be selected.

string $option_name: The name of the option to set. May be any jQuery UI dialog option. See http://api.jqueryui.com/dialog.

mixed $option_value: The value of the option to be passed to the dialog.

Return value

array: An array suitable for use with the ajax_render() function.

Related topics

File

core/includes/ajax.inc, line 1435
Functions for use with Backdrop's Ajax framework.

Code

function ajax_command_set_dialog_option($selector, $option_name, $option_value) {
  $selector = empty($selector) ? '#backdrop-modal' : $selector;

  return array(
    'command' => 'setDialogOption',
    'selector' => $selector,
    'optionName' => $option_name,
    'optionValue' => $option_value,
  );
}