You are here

function document_block1_form in Document 7

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

File

./document.module, line 567

Code

function document_block1_form($form, $form_state) {
  $form = array();
  $action = url('document');
  $form['document_block1_label'] = array(
    '#type' => 'item',
    '#title' => t('Search for a document'),
    '#prefix' => '<div class="document-block-label">',
    '#suffix' => '</div>',
  );
  $form['document_block1_input'] = array(
    '#type' => 'textfield',
    '#attributes' => array(
      'class' => array(
        'document-block-input',
      ),
    ),
  );
  $form['document_block1_submit'] = array(
    '#type' => 'image_button',
    '#src' => document_image_url('doc-search.png'),
    '#attributes' => array(
      'class' => array(
        'document-block-submit',
      ),
    ),
  );
  $form['document_block1_fields'] = array(
    '#type' => 'radios',
    '#options' => array(
      DOCUMENT_SEARCH_AUTHOR => t('Author |'),
      DOCUMENT_SEARCH_KEYWORDS => t('Keywords |'),
      -1 => t('Type |'),
    ),
    '#default_value' => DOCUMENT_SEARCH_AUTHOR,
    '#attributes' => array(
      'class' => array(
        'document-block-fields',
      ),
    ),
  );
  $form['document_block1_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;
}