You are here

function _quote_settings_form in Quote 7.2

Form settings.

1 string reference to '_quote_settings_form'
quote_menu in ./quote.module
Implements hook_menu().

File

./quote.module, line 176
Allows users to quote posts or comments.

Code

function _quote_settings_form() {
  $form = [];
  $form['modes'] = [
    '#type' => 'fieldset',
    '#title' => t('Select quote modes'),
  ];
  $form['modes']['quote_modes_quote_sel'] = [
    '#type' => 'checkbox',
    '#title' => t('Quote selected'),
    '#default_value' => variable_get('quote_modes_quote_sel', TRUE),
  ];
  $form['modes']['quote_modes_quote_all'] = [
    '#type' => 'checkbox',
    '#title' => t('Quote all'),
    '#default_value' => variable_get('quote_modes_quote_all', TRUE),
  ];
  $form['modes']['quote_modes_quote_reply_all'] = [
    '#type' => 'checkbox',
    '#title' => t('Quote and reply all'),
    '#default_value' => variable_get('quote_modes_quote_reply_all', TRUE),
  ];
  $form['modes']['quote_modes_quote_reply_sel'] = [
    '#type' => 'checkbox',
    '#title' => t('Quote and reply selected'),
    '#default_value' => variable_get('quote_modes_quote_reply_sel', FALSE),
    '#disabled' => TRUE,
  ];
  $types = node_type_get_types();
  $options = [];
  foreach ($types as $type => $info) {
    $options[$type] = $info->name;
  }
  $form['where'] = [
    '#type' => 'fieldset',
    '#title' => t('Allow quotes in the:'),
  ];
  $form['where']['quote_allow_types'] = [
    '#type' => 'checkboxes',
    '#title' => t('Content types'),
    '#options' => $options,
    '#default_value' => variable_get('quote_allow_types', []),
  ];
  $form['where']['quote_allow_comments'] = [
    '#type' => 'checkbox',
    '#title' => t('Comments'),
    '#description' => t('Checkbox works if node type allow quoting'),
    '#default_value' => variable_get('quote_allow_comments', TRUE),
  ];
  $form['ckeditor_support_set'] = [
    '#type' => 'fieldset',
    '#title' => t('CKEditor support'),
  ];
  $form['ckeditor_support_set']['quote_ckeditor_support'] = [
    '#type' => 'checkbox',
    '#title' => t('CKEditor support'),
    '#description' => t('If checkbox checked and CKEditor found on the page, CKEditor will have a priority'),
    '#default_value' => variable_get('quote_ckeditor_support', FALSE),
    '#disabled' => !module_exists('ckeditor'),
  ];
  $form['other'] = [
    '#type' => 'fieldset',
    '#title' => t('Other settings'),
  ];
  $form['other']['quote_selector'] = [
    '#type' => 'textfield',
    '#title' => t('CSS selector of your comment form textarea (where you write new comments)'),
    '#description' => t('By default it is: #edit-comment-body textarea'),
    '#default_value' => variable_get('quote_selector', '#edit-comment-body textarea'),
  ];
  $form['other']['quote_selector_comment_quote_all'] = [
    '#type' => 'textfield',
    '#title' => t('CSS selector of your comment body class (where you quote all)'),
    '#description' => t('By default it is: .field-name-comment-body'),
    '#default_value' => variable_get('quote_selector_comment_quote_all', '.field-name-comment-body'),
  ];
  $form['other']['quote_selector_node_quote_all'] = [
    '#type' => 'textfield',
    '#title' => t('CSS selector of your node body class (where you quote all)'),
    '#description' => t('By default it is: .field-name-body'),
    '#default_value' => variable_get('quote_selector_node_quote_all', '.field-name-body'),
  ];
  $form['other']['quote_limit'] = [
    '#type' => 'textfield',
    '#title' => t('Quote limit'),
    '#default_value' => variable_get('quote_limit', 400),
    '#attributes' => [
      ' type' => 'number',
    ],
  ];
  return system_settings_form($form);
}