]>
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 = $controller->construct_breadcrumb();
30 // ###################################################################
32 $latest = $controller->cachev
->fetch_node();
34 $link['log'] = $controller->href_compound('log.php');
36 $show['head'] = ($latest['revision'] != $controller->revnum
AND $controller->revnum
!= 'HEAD');
39 $link['gohead'] = $controller->href_compound('browse.php', null, Paths
::fetch_rev_str(false, 'HEAD'));
40 $link['diffhead'] = $controller->href_compound('diff.php', null, Paths
::fetch_rev_str(true, 'HEAD', $controller->revnum
));
43 $show['prev'] = ($prev = $controller->cachev
->fetch_prev_revision($controller->revnum
));
46 $link['diffprev'] = $controller->href_compound('diff.php', null, Paths
::fetch_rev_str(true, $viewsvn->paths
->revnum
, $prev));
49 // ###################################################################
51 $logmsg = $controller->cachev
->fetch_revision($latest['revision']);
52 unset($logmsg['files']);
54 $logmsg['message_clean'] = SVNCommon
::format_log_message($logmsg['message']);
55 $logmsg['date'] = SVNCommon
::format_date_string($logmsg['dateline']);
57 $catdata = implode("\n", $controller->library
->command('cat'));
59 // get language information
60 require_once('./includes/file_types.php');
61 $extension = $funct->fetch_extension($controller->path
);
62 $language = (isset($filetypes["$extension"]) ? $filetypes["$extension"] : null);
65 $mtstart = microtime();
66 require_once('./includes/geshi/geshi.php');
67 $geshi = new Geshi($catdata, $language[MIMES_GESHI_LANGUAGE
]);
70 $geshi->enable_classes();
73 $geshi->set_header_type(GESHI_HEADER_DIV
);
76 $urls = (isset($geshi->language_data
['URLS']) ? array_keys($geshi->language_data
['URLS']) : array());
77 foreach ($urls AS $key)
79 $geshi->set_url_for_keyword_group($key, '');
82 // don't do anything stupid
83 $geshi->set_case_keywords(GESHI_CAPS_NO_CHANGE
);
86 $geshi->set_encoding('UTF-8');
89 $geshi->set_tab_width(5);
92 $catdata = $geshi->parse_code();
94 $viewsvn->debug("time in GeSHi = " . $funct->fetch_microtime_diff($mtstart));
96 // ###################################################################
98 eval('$template->flush("' . $template->fetch('view') . '");');
100 /*=====================================================================*\
101 || ###################################################################
104 || ###################################################################
105 \*=====================================================================*/