'. t('The GeSHi filter module provides a filter for syntax highlighting of inline source code or blocks of source code based on the PHP library !GeSHi.', array('!GeSHi' => l('GeSHi (Generic Syntax Highlighter)', 'http://qbnz.com/highlighter/'))) .'

'; if ($path == 'admin/help#geshifilter') { $output .= '

'. t('The GeSHi filter module for Drupal requires the GeSHi library (version 1.0.x) to work. The GeSHi filter is actually just a Drupal wrapper module around the GeSHi library. Because of drupal.org repository policies however, the GeSHi library is not included in the GeSHi filter package, so you should download and install the GeSHi library separately.', array( '!repositorypolicies' => url('http://drupal.org/node/66113'), '!geshi' => url('http://qbnz.com/highlighter/'), )) .'

'; $output .= t('

Quick overview of how to set up and use the GeSHi filter:

', array( '!geshifilter_settings' => url('admin/config/content/geshifilter'), '!geshifilter_languages' => url('admin/config/content/geshifilter/languages/all'), '!inputformats' => l(t('text formats'), 'admin/config/content/formats'), '!filterconflicts' => l(t('filter conflicts'), 'admin/config/content/geshifilter/filterconflicts'), '!filtertips' => l(t('filter tips'), 'filter/tips'), )); } return $output; break; case 'admin/config/content/geshifilter/languages': case 'admin/config/content/geshifilter/languages/enabled': case 'admin/config/content/geshifilter/languages/all': case 'admin/config/content/geshifilter/languages/disabled': $output = '

'. t('Here you can enable/disable the desired languages to use. It is suggested to disable languages that are not relevant for you site not only to avoid unnecessary cluttering of the GeSHi filter configuration pages and the !filtertips, but also to make the GeSHi filter processing lighter.', array('!filtertips' => l(t('filter tips'), 'filter/tips'))) .'

'; if (!geshifilter_use_format_specific_options()) { $output .= '

'. t('You can also define the language specific tags here.') .'

'; } return $output; break; } } /** * Implementation of hook_menu(). */ function geshifilter_menu() { $items = array(); $items['admin/config/content/geshifilter'] = array( 'title' => 'GeSHi Filter', 'description' => 'Configure the GeSHi filter.', 'file' => 'geshifilter.admin.inc', 'page callback' => 'drupal_get_form', 'page arguments' => array('geshifilter_admin_general_settings'), 'access arguments' => array('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/config/content/geshifilter/general'] = array( 'title' => 'General settings', 'description' => 'General GeSHi filter settings.', 'access arguments' => array('administer site configuration'), 'type' => MENU_DEFAULT_LOCAL_TASK, ); $items['admin/config/content/geshifilter/filterconflicts'] = array( 'title' => 'Filter conflicts', 'description' => 'Information on possible conflicts with other filters.', 'file' => 'geshifilter.conflicts.inc', 'page callback' => 'geshifilter_admin_filter_conflicts', 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 10, ); // language settings $items['admin/config/content/geshifilter/languages'] = array( 'title' => 'Languages', 'description' => 'Enable the desired languages and configure their settings.', 'file' => 'geshifilter.admin.inc', 'page callback' => 'drupal_get_form', 'page arguments' => array('geshifilter_admin_per_language_settings'), 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, ); $items['admin/config/content/geshifilter/languages/enabled'] = array( 'title' => 'Enabled', 'description' => 'Show the enabled languages', 'access arguments' => array('administer site configuration'), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => 3, ); $items['admin/config/content/geshifilter/languages/all'] = array( 'title' => 'All', 'description' => 'Show all the available languages', 'page arguments' => array('geshifilter_admin_per_language_settings', 4), 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 1, ); $items['admin/config/content/geshifilter/languages/disabled'] = array( 'title' => 'Disabled', 'description' => 'Show the disabled languages', 'page arguments' => array('geshifilter_admin_per_language_settings', 4), 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 6, ); // Callback for generating CSS rules. $items['admin/config/content/geshifilter/generate_css'] = array( 'page callback' => 'geshifilter_generate_language_css_rules', 'access arguments' => array('administer site configuration'), 'type' => MENU_CALLBACK, ); return $items; } /** * Implementation of hook_init(). */ function geshifilter_init() { // Since the filtered content is cached, it is not possible to know on which // pages the css file is actually needed. Thus it is included on all pages. if (variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE) == GESHIFILTER_CSS_CLASSES_AUTOMATIC) { drupal_add_css(file_directory_path() .'/geshifilter-languages.css'); } drupal_add_css(drupal_get_path('module', 'geshifilter') .'/geshifilter.css'); } /** * Filter-Tips callback. */ function geshifilter_filter_tips($delta, $format, $long = FALSE) { require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.filtertips.inc'; return _geshifilter_filter_tips($delta, $format, $long); } /** * Implements hook_filter_info(). */ function geshifilter_filter_info() { $filters = array(); $filters['geshifilter'] = array( 'title' => t('GeSHi filter'), 'description' => t('Enables syntax highlighting of inline/block source code using the GeSHi engine'), 'prepare callback' => 'geshifilter_prepare_callback', 'process callback' => 'geshifilter_process_callback', 'tips callback' => 'geshifilter_filter_tips', 'settings callback' => 'geshifilter_filter_settings_callback', 'default settings' => array( 'allowed_html' => '