You are here

function oembed_test in oEmbed 7

Same name and namespace in other branches
  1. 7.0 oembed.admin.inc \oembed_test()

oEmbed sandbox callback.

1 string reference to 'oembed_test'
oembed_menu in ./oembed.module
Implements hook_menu().

File

./oembed.admin.inc, line 34
OEmbed admin pages.

Code

function oembed_test($form, &$form_state) {
  $form['url'] = array(
    '#type' => 'textfield',
    '#title' => t('URL'),
    '#description' => t('URL to request from oEmbed provider'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  if (isset($form_state['embed'])) {
    $form['response'] = array(
      '#type' => 'container',
    );
    $form['response']['display']['oembed'] = array(
      '#type' => 'fieldset',
      '#title' => t('oEmbed'),
    );
    $form['response']['display']['oembed'][] = $form_state['display']['oembed'];
    $form['response']['display']['oembed'][] = array(
      '#prefix' => '<pre>',
      '#markup' => check_plain(drupal_render($form_state['display']['oembed'])),
      '#suffix' => '</pre>',
    );
    $form['response']['display']['oembed_thumbnail'] = array(
      '#type' => 'fieldset',
      '#title' => t('oEmbed Thumbnail'),
    );
    $form['response']['display']['oembed_thumbnail'][] = $form_state['display']['oembed_thumbnail'];
    $form['response']['display']['oembed_thumbnail'][] = array(
      '#prefix' => '<pre>',
      '#markup' => check_plain(drupal_render($form_state['display']['oembed_thumbnail'])),
      '#suffix' => '</pre>',
    );
    $form['response']['details'] = array(
      '#type' => 'fieldset',
      '#title' => t('Details'),
    );
    $form['response']['details']['data'] = array(
      '#prefix' => '<pre>',
      '#markup' => $form_state['embed'],
      '#suffix' => '</pre>',
    );
  }
  return $form;
}