You are here

function linkit_picker_form_alter in Linkit Picker 6

Same name and namespace in other branches
  1. 7.3 linkit_picker.module \linkit_picker_form_alter()
  2. 7 linkit_picker.module \linkit_picker_form_alter()
  3. 7.2 linkit_picker.module \linkit_picker_form_alter()

Implementation of hook_form_alter().

File

./linkit_picker.module, line 11
Main file for linkit_pikcer module.

Code

function linkit_picker_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == "_linkit_form") {
    $form['link']['browser_wrapper'] = array(
      '#type' => 'fieldset',
      '#title' => t('Browser'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#weight' => 3,
      '#attributes' => array(
        'class' => 'linkit_picker',
      ),
    );
    $form['link']['browser_wrapper']['node'] = array(
      '#type' => 'button',
      '#value' => t('Node'),
      '#weight' => 0,
      '#attributes' => array(
        'class' => 'linkit_picker_button',
      ),
    );
    $form['link']['browser_wrapper']['user'] = array(
      '#type' => 'button',
      '#value' => t('User'),
      '#weight' => 1,
      '#attributes' => array(
        'class' => 'linkit_picker_button',
      ),
    );
    $form['link']['browser_wrapper']['term'] = array(
      '#type' => 'button',
      '#value' => t('Term'),
      '#weight' => 2,
      '#attributes' => array(
        'class' => 'linkit_picker_button',
      ),
    );
    $form['link']['browser_wrapper']['container'] = array(
      '#prefix' => '<div id="linkit-picker-container">',
      '#suffix' => '</div>',
      '#type' => 'markup',
      '#value' => _linkit_picker_render_container(),
      '#weight' => 10,
    );
  }
}