You are here

function geshinode_form in GeSHi Filter for syntax highlighting 5.2

Same name and namespace in other branches
  1. 6 geshinode.module \geshinode_form()

Implementation of hook_form().

File

./geshinode.module, line 67

Code

function geshinode_form(&$node, &$param) {
  require_once './' . drupal_get_path('module', 'geshifilter') . '/geshifilter.inc';
  $type = node_get_types('type', $node);

  // We need to define form elements for the node's title and body.
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => check_plain($type->title_label),
    '#required' => TRUE,
    '#default_value' => $node->title,
    '#weight' => -5,
  );
  $form['body'] = array(
    '#type' => 'textarea',
    '#title' => t('Source code'),
    '#default_value' => $node->body,
    '#rows' => 20,
    '#required' => TRUE,
  );
  $form['language'] = array(
    '#type' => 'select',
    '#title' => t('Syntax highlighting mode'),
    '#default_value' => $node->language ? $node->language : variable_get('geshinode_default_language', 'php'),
    '#options' => _geshifilter_get_enabled_languages(),
    '#description' => t('Select the syntax highlighting mode to use.'),
  );
  return $form;
}