You are here

function _oa_core_hide_comment_settings in Open Atrium Core 7.2

Alters a node edit form to hide comment settings.

4 calls to _oa_core_hide_comment_settings()
oa_core_form_oa_group_node_form_alter in ./oa_core.module
Implements hook_form_FORM_ID_alter().
oa_core_form_oa_space_node_form_alter in ./oa_core.module
Implements hook_form_FORM_ID_alter().
oa_core_form_oa_team_node_form_alter in modules/oa_teams/oa_teams.module
Implements hook_form_FORM_ID_alter().
oa_sections_form_oa_section_node_form_alter in modules/oa_sections/oa_sections.module
Implements hook_form_FORM_ID_alter().

File

./oa_core.module, line 1596

Code

function _oa_core_hide_comment_settings(&$form) {
  $node = $form['#node'];
  if (isset($form['comment_settings']) && (empty($node->type) || variable_get('comment_' . $node->type, COMMENT_NODE_OPEN) == COMMENT_NODE_HIDDEN) && (empty($node->nid) || $node->comment == COMMENT_NODE_HIDDEN || $node->comment == COMMENT_NODE_CLOSED && empty($node->comment_count))) {
    $form['comment_settings']['#access'] = FALSE;
  }
}