[phpcvsview-cvs-updates] phpcvsview func_FileView.php,1.8,1.9
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Brian C. <bch...@us...> - 2004-12-22 11:06:38
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8352 Modified Files: func_FileView.php Log Message: - Further cleanup of default theme. - Altered GeSHi code to add a basic highlighter detection. - Optimised some of the XHTML output from the theme. Index: func_FileView.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileView.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** func_FileView.php 19 Dec 2004 03:00:49 -0000 1.8 --- func_FileView.php 22 Dec 2004 11:05:59 -0000 1.9 *************** *** 58,71 **** // Create the GeSHi instance and parse the output. // TODO: setup code to auto identify the highlighting class to use for current file. ! $geshi = new GeSHi($CVSServer->FILECONTENTS, "php", $config['GeSHiHighlightersPath']); $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); $geshi->set_line_style('background: #fcfcfc;'); $geshi->set_tab_width(4); ! $geshi->enable_classes(); ! $geshi->set_overall_class('geshi'); $hlcontent = $geshi->parse_code(); // Display the file contents. echo $hlcontent; } else --- 58,79 ---- // Create the GeSHi instance and parse the output. // TODO: setup code to auto identify the highlighting class to use for current file. ! $FileExt = substr($File, strrpos($File, ".")+1); ! $Language = guess_highlighter($FileExt); ! if (is_array($Language)) { ! $Language = $Language[0]; ! } ! ! $geshi = new GeSHi($CVSServer->FILECONTENTS, $Language, $config['GeSHiHighlightersPath']); $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); $geshi->set_line_style('background: #fcfcfc;'); $geshi->set_tab_width(4); ! // $geshi->enable_classes(); ! // $geshi->set_overall_class('geshi2'); $hlcontent = $geshi->parse_code(); // Display the file contents. + echo "<table class=\"source\"><tr><td>"; echo $hlcontent; + echo "</td></tr></table>"; } else |