You are here

function total_control_overview_content_content_type_edit_form in Total Control Admin Dashboard 6

Same name and namespace in other branches
  1. 6.2 plugins/content_types/overview_content.inc \total_control_overview_content_content_type_edit_form()
  2. 7.2 plugins/content_types/overview_content.inc \total_control_overview_content_content_type_edit_form()

File

plugins/content_types/overview_content.inc, line 74

Code

function total_control_overview_content_content_type_edit_form(&$form, &$form_state) {
  $conf = $form_state['conf'];
  $types = node_get_types('types');
  $type_options = array();
  $type_defaults = array();
  $comment_defaults = array();
  foreach ($types as $type => $object) {
    $type_options[$type] = $object->name;
    $type_defaults[] = $type;
    if ($type == 'blog' || $type == 'forum topic') {
      $comment_defaults[] = $type;
    }
  }
  $form['types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Include Stats on Content Types'),
    '#options' => $type_options,
    '#default_value' => $type_defaults,
  );
  $form['comments'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Include Comment Stats for Content Types'),
    '#options' => $type_options,
    '#default_value' => $comment_defaults,
  );
  $spam_options = array(
    0 => t('no'),
    1 => t('Include Spam Comment count'),
  );
  $form['spam'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include Spam Comment count'),
    '#options' => $spam_options,
    '#default_value' => $form_state['op'] == 'add' ? TRUE : $conf['spam'],
  );

  //print_r($form);exit;
  return $form;
}