*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* http://www.gnu.org/copyleft/gpl.html
*/
/**
* @addtogroup Extensions
* @author John Pye
*
* This extension wraps the Andre Simon highlighter: http://www.andre-simon.de/
*
* Modelled closely on the sourcecode for the GeSHi highlighter for
* mediawiki, by Brion Vibber http://www.mediawiki.org/
*
* A language is specified like:
$out"; return $out; } } /** Return a syntax help message @param string $error HTML error message */ function ashighlightHelp( $error = false ) { return ashighlightError( ( $error ? "
$error
" : '' ) . '' . wfMsg( 'ashighlight-specify' ) . ' ' . '<source lang="html">...</source>
' . '' . wfMsg( 'ashighlight-supported' ) . '
' . ashighlightFormatList( ashighlightLanguageList() ) ); } /** * Put a red-bordered div around an HTML message * @param string $contents HTML error message * @return HTML */ function ashighlightError( $contents ) { return "' . implode( ', ', array_map( 'ashighlightListItem', $list ) ) . '
'; } function ashighlightListItem( $item ) { return "" . htmlspecialchars( $item ) . ""; } function ashighlightLanguageList() { $langs = array(); $langroot = @opendir( ASHIGHLIGHT_LANG_ROOT ); if( $langroot ) { while( $item = readdir( $langroot ) ) { if( preg_match( '/^(.*)\\.lang$/', $item, $matches ) ) { $langs[] = $matches[1]; } } closedir( $langroot ); } sort( $langs ); return $langs; } function ashighlightCss(&$out){ //foreach($ASH_CSS as $css){ // $out.=$css."\n\n"; //} $out.="kwa{font:bold}"; return true; } ?>