You are here

function querypath_examples_show_musicbrainz_form in QueryPath 6

Same name and namespace in other branches
  1. 7.3 querypath_examples.module \querypath_examples_show_musicbrainz_form()
  2. 7.2 querypath_examples.module \querypath_examples_show_musicbrainz_form()
1 string reference to 'querypath_examples_show_musicbrainz_form'
querypath_examples_show_musicbrainz in ./querypath_examples.module

File

./querypath_examples.module, line 213
The main file for querypath_examples.

Code

function querypath_examples_show_musicbrainz_form($edit) {
  $form['explain'] = array(
    '#type' => 'item',
    '#title' => t('MusicBrainz Example'),
    '#value' => t('Enter an artist and this will query the MusicBrainz XML service an return the "best" artist match and a list of albums by the artist.'),
  );
  $form['artist_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Enter an Artist Name'),
    '#description' => t('Examples: U2, Tori Amos'),
    '#size' => 60,
    '#maxlength' => 256,
    '#required' => TRUE,
  );
  $form['submit_artist'] = array(
    '#type' => 'submit',
    '#value' => t('Find'),
  );
  if (!empty($_SESSION['musicbrainz_data'])) {
    $form['out'] = array(
      '#type' => 'markup',
      '#value' => $_SESSION['musicbrainz_data'],
    );
    unset($_SESSION['musicbrainz_data']);
  }
  return $form;
}