]>
src.bluestatic.org Git - viewsvn.git/blob - view.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # ViewSVN [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 $fetchtemplates = array(
26 require_once('./global.php');
28 $navbar = $viewsvn->paths
->construct_breadcrumb($path);
30 // ###################################################################
32 $link['log'] = $viewsvn->paths
->out('log.php' . $viewsvn->paths
->fetch_rev_str(), $path);
34 $show['head'] = ($viewsvn->svn
->common
->fetch_head_rev($path) != $viewsvn->paths
->fetch_rev_num() AND $viewsvn->paths
->fetch_rev_num() != 'HEAD');
37 $link['gohead'] = $viewsvn->paths
->out('browse.php' . $viewsvn->paths
->fetch_rev_str(false, 'HEAD'), $path);
38 $link['diffhead'] = $viewsvn->paths
->out('diff.php' . $viewsvn->paths
->fetch_rev_str(true, 'HEAD', $viewsvn->paths
->fetch_rev_num()), $path);
41 $show['prev'] = (($prev = $viewsvn->svn
->common
->fetch_prev_rev($path, $viewsvn->paths
->fetch_rev_num())) != -1 ? true : false);
44 $link['diffprev'] = $viewsvn->paths
->out('diff.php' . $viewsvn->paths
->fetch_rev_str(true, $viewsvn->paths
->fetch_rev_num(), $prev), $path);
47 // ###################################################################
49 $logmsg = $viewsvn->svn
->common
->fetch_log($path, $viewsvn->paths
->fetch_rev_num());
50 unset($logmsg['files']);
52 $logmsg['message_clean'] = nl2br(htmlspecialchars($logmsg['message']));
54 $catdata = $data = implode("\n", $viewsvn->svn
->cat($repos, $relpath, $viewsvn->paths
->fetch_rev_num()));
57 $mtstart = microtime();
58 require_once('./includes/geshi/geshi.php');
59 $geshi = new Geshi($catdata, 'php');
62 $geshi->enable_classes();
65 $geshi->set_header_type(GESHI_HEADER_NONE
);
68 $urls = array_keys($geshi->language_data
['URLS']);
69 foreach ($urls AS $key)
71 $geshi->set_url_for_keyword_group($key, '');
75 $geshi->set_overall_class('code');
77 // don't do anything stupid
78 $geshi->set_case_keywords(GESHI_CAPS_NO_CHANGE
);
81 $geshi->set_encoding('UTF-8');
84 $geshi->set_tab_width(5);
87 $catdata = $geshi->parse_code();
89 $viewsvn->debug("time in GeSHi = " . $funct->fetch_microtime_diff($mtstart));
91 // ###################################################################
93 eval('$template->flush("' . $template->fetch('view') . '");');
95 /*=====================================================================*\
96 || ###################################################################
99 || ###################################################################
100 \*=====================================================================*/