You are here

function contentanalysis_admin_settings in Content Analysis 8

Same name and namespace in other branches
  1. 6 contentanalysis.admin.inc \contentanalysis_admin_settings()
  2. 7 contentanalysis.admin.inc \contentanalysis_admin_settings()

Displays the form for the standard settings tab.

Return value

array A structured array for use with Forms API.

1 string reference to 'contentanalysis_admin_settings'
contentanalysis_menu in ./contentanalysis.module
Implements hook_menu().

File

./contentanalysis.admin.inc, line 13
Admin include file.

Code

function contentanalysis_admin_settings() {
  $params = array(
    'title' => t('Default analyzers'),
    'description' => t('Select the analyzers you want enabled by default.'),
  );
  $form['contentanalysis_default_analyzers'] = contentanalysis_get_analyzer_form_element($params);
  $form['contentanalysis_analyzerchecklist'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable analyzer checklist report'),
    '#default_value' => variable_get('contentanalysis_analyzerchecklist', 1),
  );
  $form['contentanalysis_node_edit_form_collapsed'] = array(
    '#type' => 'checkbox',
    '#title' => t('Collapse the content analysis fieldset on the node edit form'),
    '#default_value' => variable_get('contentanalysis_node_edit_form_collapsed', 0),
  );
  $options = array(
    'both' => t('Display both dialog and inline reports.'),
    'dialog' => t('Display dialog report only.'),
    'inline' => t('Display inline reports only.'),
    'multibutton' => t('Provide buttons to enable the user to select report options.'),
  );
  $form['contentanalysis_node_report_display'] = array(
    '#type' => 'radios',
    '#title' => t('Node edit report style'),
    '#options' => $options,
    '#default_value' => variable_get('contentanalysis_node_report_display', 'both'),
    '#description' => t('Choose the style of report you would like when launching from the node edit form. Dialog is the standard modal report. Inline inserts recommendations directly into the node edit form.'),
  );
  $form['contentanalysis_node_parse_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Node parsing options'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['contentanalysis_node_parse_options']['contentanalysis_node_parse_nodetitle_prepend'] = array(
    '#type' => 'checkbox',
    '#title' => t('Prepend node title to body'),
    '#default_value' => variable_get('contentanalysis_node_parse_nodetitle_prepend', CONTENTANALYSIS_NODE_PARSE_NODETITLE_PREPEND_DEFAULT),
    '#description' => t('Most Drupal sites format node views by putting the node title as a page header above the node body. If your site is formatted this way, check this box. If node titles are not used as headers, uncheck the option.'),
  );
  $form['contentanalysis_node_parse_options']['contentanalysis_node_parse_nodetitle_tags'] = array(
    '#type' => 'textfield',
    '#title' => t('Node title tags'),
    '#default_value' => variable_get('contentanalysis_node_parse_nodetitle_tags', CONTENTANALYSIS_NODE_PARSE_NODETITLE_TAGS_DEFAULT),
    '#description' => t('If your node title is included on node views, include any formating tags it is enclosed within. Default is <h2>[node_title]</h2>'),
  );

  //Add the system buttons to the form
  $form = system_settings_form($form);

  //Overide the theme function back to our own one
  return $form;
}