function ajax_test_dialog_contents

Returns example content for dialog tests.

3 calls to ajax_test_dialog_contents()
AjaxTestController::dialogContents in drupal/core/modules/system/tests/modules/ajax_test/lib/Drupal/ajax_test/AjaxTestController.php
Returns example content for dialog testing.
DialogTest::testDialog in drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php
Test sending non-JS and AJAX requests to open and manipulate modals.
_ajax_test_dialog in drupal/core/modules/system/tests/modules/ajax_test/ajax_test.module
Util to render dialog in ajax callback.

File

drupal/core/modules/system/tests/modules/ajax_test/ajax_test.module, line 242
Helper module for Ajax framework tests.

Code

function ajax_test_dialog_contents() {

  // This is a regular render array; the keys do not have special meaning.
  $content = array(
    'content' => array(
      '#markup' => 'Example message',
    ),
    'cancel' => array(
      '#type' => 'link',
      '#title' => 'Cancel',
      '#href' => '',
      '#attributes' => array(
        // This is a special class to which JavaScript assigns dialog closing
        // behavior.
        'class' => array(
          'dialog-cancel',
        ),
      ),
    ),
  );
  return $content;
}