[phpcvsview-cvs-updates] phpcvsview config.php,1.5,1.6 func_FileView.php,1.7,1.8
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Brian C. <bch...@us...> - 2004-12-19 03:01:40
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3146 Modified Files: config.php func_FileView.php Log Message: - Integrated the GeSHi projects Syntax Highlighting into func_FileView.php Index: config.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/config.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.php 5 Oct 2004 17:41:47 -0000 1.5 --- config.php 19 Dec 2004 03:00:46 -0000 1.6 *************** *** 1,36 **** ! <?php ! ! /** ! * This source code is distributed under the terms as layed out in the ! * GNU General Public License. ! * ! * Purpose: To store the configuration for this instance of phpCVSView ! * ! * @author Brian A Cheeseman <bch...@us...> ! * @version $Id$ ! * @copyright 2003-2004 Brian A Cheeseman ! **/ ! ! // The CVSROOT path to access. For sourceforge you need the usual expansion ! // of the path based on the project name. ! $config['cvsroot'] = "/cvsroot/phpcvsview"; ! ! // The hostname (or IP Address) of the server providing the PServer services. ! $config['pserver'] = "cvs.sourceforge.net"; ! ! // The username to pass to the PServer for authentication purposes. ! $config['username'] = "anonymous"; ! ! // The password associated with the username above for authentication process. ! $config['password'] = ""; ! ! // The HTMLTitle and HTMLHeading are used purely for the generation of the ! // resultant web pages. ! $config['html_title'] = "phpCVSView Source Code Library"; ! $config['html_header'] = "phpCVSView Source Code Library"; ! ! $config['html_tbl_head_bg'] = "#CCCCCC"; ! $config['html_tbl_cell_one'] = "#FFFFFF"; ! $config['html_tbl_cell_two'] = "#CCCCEE"; ! ! ?> --- 1,41 ---- ! <?php ! ! /** ! * This source code is distributed under the terms as layed out in the ! * GNU General Public License. ! * ! * Purpose: To store the configuration for this instance of phpCVSView ! * ! * @author Brian A Cheeseman <bch...@us...> ! * @version $Id$ ! * @copyright 2003-2004 Brian A Cheeseman ! **/ ! ! // The CVSROOT path to access. For sourceforge you need the usual expansion ! // of the path based on the project name. ! $config['cvsroot'] = "/cvsroot/phpcvsview"; ! ! // The hostname (or IP Address) of the server providing the PServer services. ! $config['pserver'] = "cvs.sourceforge.net"; ! ! // The username to pass to the PServer for authentication purposes. ! $config['username'] = "anonymous"; ! ! // The password associated with the username above for authentication process. ! $config['password'] = ""; ! ! // The HTMLTitle and HTMLHeading are used purely for the generation of the ! // resultant web pages. ! $config['html_title'] = "phpCVSView Source Code Library"; ! $config['html_header'] = "phpCVSView Source Code Library"; ! ! $config['html_tbl_head_bg'] = "#CCCCCC"; ! $config['html_tbl_cell_one'] = "#FFFFFF"; ! $config['html_tbl_cell_two'] = "#CCCCEE"; ! ! // Setup whether to use GeSHi project code for syntax highlighting or not. ! $config['UseGeSHi'] = true; ! $config['GeSHiPath'] = "geshi"; ! $config['GeSHiHighlightersPath'] = "geshi/geshi"; ! ! ?> Index: func_FileView.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileView.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** func_FileView.php 11 Oct 2004 05:27:57 -0000 1.7 --- func_FileView.php 19 Dec 2004 03:00:49 -0000 1.8 *************** *** 12,15 **** --- 12,19 ---- **/ + if ($config['UseGeSHi']) { + include_once($config['GeSHiPath'].'/geshi.php'); + } + function DisplayFileContents($File, $Revision = "") { *************** *** 49,65 **** echo GetQuickLinkBar($env['mod_path'], "Code view for: ", true, true, $Revision); - // Display the file contents. echo "<hr />\n"; - $search = array('<', '>', '\n', '\t'); - $replace = array("<", ">", "", " "); - $content = str_replace($search, $replace, $CVSServer->FILECONTENTS); - $source = explode("\n", $content); - $soure_size = sizeof($source); ! echo "<pre>\n"; ! for($i = 1; $i <= $soure_size; $i++) { ! echo '<a name="'.$i.'" class="numberedLine">'.str_repeat(' ', strlen($soure_size) - strlen($i)). $i.':</a> ' . $source[$i-1] . "\n"; } ! echo "</pre>\n"; // Close the connection. --- 53,87 ---- echo GetQuickLinkBar($env['mod_path'], "Code view for: ", true, true, $Revision); echo "<hr />\n"; ! if ($config['UseGeSHi']) { ! // 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 ! { ! $search = array('<', '>', '\n', '\t'); ! $replace = array("<", ">", "", " "); ! $content = str_replace($search, $replace, $CVSServer->FILECONTENTS); ! $source = explode("\n", $content); ! $soure_size = sizeof($source); ! ! echo "<pre>\n"; ! for($i = 1; $i <= $soure_size; $i++) { ! echo '<a name="'.$i.'" class="numberedLine"> '.str_repeat(' ', strlen($soure_size) - strlen($i)). $i.'.</a> ' . $source[$i-1] . "\n"; ! } ! echo "</pre>\n"; ! } ! echo "<hr />"; // Close the connection. |