You are here

function document_block2_form in Document 7

Same name and namespace in other branches
  1. 6 document.module \document_block2_form()
  2. 8.x document.module \document_block2_form()
1 string reference to 'document_block2_form'
document_block_view in ./document.module

File

./document.module, line 604

Code

function document_block2_form($form, $form_state) {
  $form = array();
  $action = url('document');
  $form['document_block2_label'] = array(
    '#type' => 'item',
    '#title' => t('Search for a document'),
    '#prefix' => '<div class="document-block-label">',
    '#suffix' => '</div>',
  );
  $form['document_block2_input'] = array(
    '#type' => 'textfield',
    '#attributes' => array(
      'class' => array(
        'document-block-input',
      ),
    ),
  );
  $form['document_block2_submit'] = array(
    '#type' => 'image_button',
    '#src' => document_image_url('doc-search.png'),
    '#attributes' => array(
      'class' => array(
        'document-block-submit',
      ),
    ),
  );
  $types = document_get_types(FALSE);
  $types[''] = '--Select Type--';
  $form['document_block2_doctype'] = array(
    '#type' => 'select',
    '#options' => $types,
    '#required' => TRUE,
    '#attributes' => array(
      'class' => array(
        'document-block-doctype',
      ),
    ),
  );
  $form['document_block2_advanced'] = array(
    '#type' => 'markup',
    '#markup' => "<div class='document-block-advanced'><a href='{$action}'>" . t('Advanced Search') . "</a></div>",
  );
  $form['#method'] = 'get';
  $form['#action'] = $action;
  return $form;
}