You are here

function _geshifilter_general_highlight_tags_settings in GeSHi Filter for syntax highlighting 5.2

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

Helper function for some settings form fields usable as general and specific settings

2 calls to _geshifilter_general_highlight_tags_settings()
_geshifilter_admin_general_settings in ./geshifilter.admin.inc
Menu callback for admin settings
_geshifilter_filter_settings in ./geshifilter.admin.inc
Form (items) for filter settings.

File

./geshifilter.admin.inc, line 334

Code

function _geshifilter_general_highlight_tags_settings($format = NULL) {
  $form = array();
  $f = $format === NULL ? '' : "_{$format}";

  // generic tags
  $form["geshifilter_tags{$f}"] = array(
    '#type' => 'textfield',
    '#title' => t('Generic syntax highlighting tags'),
    '#default_value' => geshifilter_tags($format),
    '#description' => t('Tags that should activate the GeSHi syntax highlighting. Specify a space-separated list of tagnames.'),
  );

  // tag style
  $form["geshifilter_brackets{$f}"] = array(
    '#type' => 'select',
    '#title' => t('Tag style'),
    '#options' => array(
      GESHIFILTER_BRACKETS_ANGLE => '<foo>',
      GESHIFILTER_BRACKETS_SQUARE => '[foo]',
      GESHIFILTER_BRACKETS_BOTH => t('!angle or !square', array(
        '!angle' => '<foo>',
        '!square' => '[foo]',
      )),
    ),
    '#default_value' => _geshifilter_brackets($format),
    '#description' => t('Select which brackets should be used for the source code container tags.'),
  );

  // PHP specific delimiters
  $form['geshifilter']["geshifilter_enable_php_delimiters{$f}"] = array(
    '#type' => 'checkbox',
    '#title' => t('Also apply syntax highlighting to &lt;?php ... ?&gt; style PHP source code blocks.'),
    '#description' => t('When enabled, PHP source code enclosed in &lt;?php...?&gt; or &lt;%...%&gt; will also be processed.'),
    '#default_value' => _geshifilter_php_delimeters($format),
  );
  return $form;
}