You are here

function answers_form_question_node_form_alter in Answers 6.2

Same name and namespace in other branches
  1. 7.3 answers.module \answers_form_question_node_form_alter()

Implements hook_form_FORM_ID_alter() for question_node_form().

File

./answers.module, line 132

Code

function answers_form_question_node_form_alter(&$form, &$form_state) {

  // Change the name of the submit button.
  $prompt = arg(1) == 'add' ? t('Ask Your Question') : t('Update Your Question');
  $form['buttons']['submit']['#value'] = $prompt;

  // Populate title field if passed via URL if access to edit title.
  if (isset($_GET['title']) && (!isset($form['#access']) || !empty($form['#access']))) {
    drupal_set_title(t('Add some details to your question'));
    $form['title']['#default_value'] = $_GET['title'];
  }
}