You are here

function privatemsg_filter_form in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 privatemsg_filter/privatemsg_filter.module \privatemsg_filter_form()
  2. 6 privatemsg_filter/privatemsg_filter.module \privatemsg_filter_form()
  3. 7.2 privatemsg_filter/privatemsg_filter.module \privatemsg_filter_form()

Form to show and allow modification of tagging information for a conversation.

1 string reference to 'privatemsg_filter_form'
privatemsg_filter_show_tags in privatemsg_filter/privatemsg_filter.module

File

privatemsg_filter/privatemsg_filter.module, line 813
Allows users to tag private messages and to filter based upon those tags.

Code

function privatemsg_filter_form($form, &$form_state, $thread_id) {
  global $user;

  // Get a list of current tags for this thread
  $query = _privatemsg_assemble_query(array(
    'tags',
    'privatemsg_filter',
  ), $user, array(
    $thread_id,
  ));
  $tags = implode(', ', $query
    ->execute()
    ->fetchCol(1));
  $form['user_id'] = array(
    '#type' => 'value',
    '#value' => $user->uid,
  );
  $form['thread_id'] = array(
    '#type' => 'value',
    '#value' => $thread_id,
  );
  $form['tags'] = array(
    '#type' => 'textfield',
    '#title' => t('Tags for this conversation'),
    '#title_display' => 'invisible',
    '#size' => 30,
    '#default_value' => $tags,
    '#autocomplete_path' => 'messages/filter/tag-autocomplete',
  );
  $form['modify_tags'] = array(
    '#type' => 'submit',
    '#value' => t('Tag this conversation'),
  );
  $form['cancel'] = array(
    '#type' => 'link',
    '#href' => $_GET['q'],
    '#title' => t('Cancel'),
    '#attributes' => array(
      'id' => 'privatemsg-filter-tags-cancel',
    ),
    '#weight' => 50,
  );
  return $form;
}