You are here

function advanced_forum_form_alter in Advanced Forum 6.2

Same name and namespace in other branches
  1. 7.2 advanced_forum.module \advanced_forum_form_alter()

Implementation of hook_form_alter().

File

./advanced_forum.module, line 487
Enables the look and feel of other popular forum software.

Code

function advanced_forum_form_alter(&$form, &$form_state, $form_id) {
  if (!empty($form['#node']->type) && advanced_forum_type_is_in_forum($form['#node']->type) && isset($form['body_field']) && isset($form['body_field']['#after_build'])) {

    // Remove the teaser splitter.
    $teaser_js_build = array_search('node_teaser_js', $form['body_field']['#after_build']);
    unset($form['body_field']['#after_build'][$teaser_js_build]);
    $form['body_field']['teaser_js']['#access'] = FALSE;
    $form['body_field']['teaser_include']['#access'] = FALSE;
  }

  // Add our OG view as a potential RON for organic groups.
  if (!empty($form['og_settings']['group_details']['og_home_page_view'])) {
    $form['og_settings']['group_details']['og_home_page_view']['#options']['advanced_forum_group_topic_list'] = 'advanced_forum_group_topic_list';
  }
}