Updating view.php to work
[viewsvn.git] / view.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # ViewSVN [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
6 || #
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.
10 || #
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
14 || # more details.
15 || #
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 \*=====================================================================*/
21
22 $fetchtemplates = array(
23 'view',
24 'property'
25 );
26
27 define('SVN', '$Id$');
28
29 require_once('./global.php');
30
31 $navbar = ConstructNavbar();
32
33 // ###################################################################
34
35 $revision = new Revision($input->in['repos'], $input->in['rev']);
36
37 // ###################################################################
38
39 /*$logmsg = $controller->cachev->fetch_revision($controller->revctx);
40 unset($logmsg['files']);
41
42 $logmsg['message_clean'] = SVNCommon::format_log_message($logmsg['message']);
43 $logmsg['date'] = SVNCommon::format_date_string($logmsg['dateline']);*/
44
45 $catdata = $lib->run('cat -r' . $revision->revision . ' ' . $lib->arg($repos->fetchPath($input->in['repos']) . $input->in['path']), true);
46
47 // ###################################################################
48
49 $show['props'] = false;
50 $proplist = '';
51 if (sizeof($latest['properties']) > 0)
52 {
53 $show['props'] = true;
54 foreach ($latest['properties'] AS $propname => $propval)
55 {
56 $data = sprintf($lang->string('Property <strong>%1$s</strong> set to <em>%2$s</em>'), $propname, $propval);
57 eval('$proplist .= "' . $template->fetch('property') . '";');
58 }
59 }
60
61 // ###################################################################
62
63 // get language information
64 require_once('./includes/file_types.php');
65 $extension = BSFunctions::FetchExtension($input->in['path']);
66 $language = (isset($filetypes["$extension"]) ? $filetypes["$extension"] : null);
67
68 // initialize GeSHi
69 $mtstart = microtime();
70 require_once('./includes/geshi/geshi.php');
71 $geshi = new Geshi($catdata, $language[MIMES_GESHI_LANGUAGE]);
72
73 // use CSS
74 $geshi->enable_classes();
75
76 // header
77 $geshi->set_header_type(GESHI_HEADER_DIV);
78
79 // disable links
80 $urls = (isset($geshi->language_data['URLS']) ? array_keys($geshi->language_data['URLS']) : array());
81 foreach ($urls AS $key)
82 {
83 $geshi->set_url_for_keyword_group($key, '');
84 }
85
86 // don't do anything stupid
87 $geshi->set_case_keywords(GESHI_CAPS_NO_CHANGE);
88
89 // encoding
90 $geshi->set_encoding('UTF-8');
91
92 // tab width
93 $geshi->set_tab_width(5);
94
95 // parse the code
96 $catdata = $geshi->parse_code();
97
98 BSRegister::Debug("time in GeSHi = " . BSFunctions::FetchMicrotimeDiff($mtstart));
99
100 // ###################################################################
101
102 eval('$template->flush("' . $template->fetch('view') . '");');
103
104 /*=====================================================================*\
105 || ###################################################################
106 || # $HeadURL$
107 || # $Id$
108 || ###################################################################
109 \*=====================================================================*/
110 ?>