You are here

function oa_widgets_add_content_edit_form in Open Atrium Core 7.2

Custom edit form to allow users to enable/disable selectable content types

1 string reference to 'oa_widgets_add_content_edit_form'
oa_widgets_add_content.inc in modules/oa_widgets/plugins/content_types/oa_widgets_add_content.inc

File

modules/oa_widgets/plugins/content_types/oa_widgets_add_content.inc, line 65

Code

function oa_widgets_add_content_edit_form($form, &$form_state) {
  $conf = $form_state['conf'];
  $nodes = oa_core_list_content_types();
  $options = array();
  foreach ($nodes as $node) {
    $options[$node->type] = check_plain($node->name);
  }
  $form['settings']['oa_widgets_types'] = array(
    '#title' => t('Enable content types'),
    '#type' => 'checkboxes',
    '#options' => $options,
    '#default_value' => isset($conf['oa_widgets_types']) ? $conf['oa_widgets_types'] : array_values($options),
    '#description' => t('Select which content types you would like to enable for this widget.'),
  );
  $form['button_class'] = array(
    '#title' => t('CSS class for links'),
    '#type' => 'textfield',
    '#default_value' => $conf['button_class'],
    '#description' => 'Enter CSS class for links, such as btn.',
  );
  $form['title_prefix'] = array(
    '#title' => t('Title Prefix'),
    '#type' => 'textfield',
    '#default_value' => $conf['title_prefix'],
    '#description' => 'Enter prefix text for link titles.',
  );
  return $form;
}