You are here

function comment_perm_admin_settings in Comment Permissions 7.2

Same name and namespace in other branches
  1. 5 comment_perm.module \comment_perm_admin_settings()
  2. 6 comment_perm.admin.inc \comment_perm_admin_settings()
  3. 7 comment_perm.admin.inc \comment_perm_admin_settings()

Menu callback; presents the comment_perm settings page.

1 string reference to 'comment_perm_admin_settings'
comment_perm_menu in ./comment_perm.module
Implements hook_menu().

File

./comment_perm.admin.inc, line 11
Administration pages for Comment Permissions module.

Code

function comment_perm_admin_settings() {
  $form = array();
  $form['help'] = array(
    '#markup' => t('Enable the extended comment permissions for certain content types here.
      Then go to !administer_permissions to configure which roles can post comments for these content types.', array(
      '!administer_permissions' => l(t('administer permissions'), 'admin/user/permissions'),
    )),
  );
  $types = array();
  foreach (node_type_get_types() as $type => $content_type) {
    $status = _comment_perm_admin_comment_status_info($type);
    $types[$type] = $content_type->name . ' ' . $status;
  }
  $form['comment_perm_node_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Enable comment permissions by role for these content types'),
    '#default_value' => variable_get('comment_perm_node_types', array()),
    '#options' => $types,
  );
  $form['comment_perm_hide_comments'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide comments entirely'),
    '#default_value' => variable_get('comment_perm_hide_comments', 0),
    '#description' => t('Comments will be hidden entirely for users without permission to post comments.'),
  );
  return system_settings_form($form);
}