You are here

function _geshifilter_general_highlight_tags_settings in GeSHi Filter for syntax highlighting 6

Same name and namespace in other branches
  1. 5.2 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
General settings form for the GeSHi filter.
_geshifilter_filter_settings in ./geshifilter.admin.inc
Form (items) for filter settings.

File

./geshifilter.admin.inc, line 384

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.'),
  );

  // Container tag styles.
  $form["geshifilter_tag_styles{$f}"] = array(
    '#type' => 'checkboxes',
    '#title' => t('Container tag style'),
    '#options' => array(
      GESHIFILTER_BRACKETS_ANGLE => '<code>' . check_plain('<foo> ... </foo>') . '</code>',
      GESHIFILTER_BRACKETS_SQUARE => '<code>' . check_plain('[foo] ... [/foo]') . '</code>',
      GESHIFILTER_BRACKETS_DOUBLESQUARE => '<code>' . check_plain('[[foo]] ... [[/foo]]') . '</code>',
      GESHIFILTER_BRACKETS_PHPBLOCK => t('PHP style source code blocks: !php and !percent', array(
        '!php' => '<code>' . check_plain('<?php ... ?>') . '</code>',
        '!percent' => '<code>' . check_plain('<% ... %>') . '</code>',
      )),
    ),
    '#default_value' => _geshifilter_tag_styles($format),
    '#description' => t('Select the container tag styles that should trigger GeSHi syntax highlighting.'),
  );
  return $form;
}