You are here

function ctools_custom_content_ui::edit_form in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php \ctools_custom_content_ui::edit_form()

Provide the actual editing form.

Overrides ctools_export_ui::edit_form

File

ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php, line 5

Class

ctools_custom_content_ui

Code

function edit_form(&$form, &$form_state) {
  parent::edit_form($form, $form_state);
  $form['category'] = array(
    '#type' => 'textfield',
    '#title' => t('Category'),
    '#description' => t('What category this content should appear in. If left blank the category will be "Miscellaneous".'),
    '#default_value' => $form_state['item']->category,
  );
  $form['title'] = array(
    '#type' => 'textfield',
    '#default_value' => $form_state['item']->settings['title'],
    '#title' => t('Title'),
  );
  $form['body_field']['body'] = array(
    '#title' => t('Body'),
    '#type' => 'textarea',
    '#default_value' => $form_state['item']->settings['body'],
  );
  $parents[] = 'format';
  $form['body_field']['format'] = filter_form($form_state['item']->settings['format'], 1, $parents);
  $form['substitute'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use context keywords'),
    '#description' => t('If checked, context keywords will be substituted in this content.'),
    '#default_value' => !empty($form_state['item']->settings['substitute']),
  );
}