]>
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(
27 require_once('./global.php');
29 $navbar = $controller->construct_breadcrumb();
31 // ###################################################################
33 $latest = $controller->cachev
->fetch_node();
35 $link['log'] = $controller->href_compound('log.php');
37 $show['head'] = ($latest['revision'] != $controller->revctx
);
40 $link['gohead'] = $controller->href_compound('view.php', null, Paths
::fetch_rev_str(false, 'HEAD'));
41 $link['diffhead'] = $controller->href_compound('diff.php', null, Paths
::fetch_rev_str(true, 'HEAD', $controller->revctx
));
44 $show['prev'] = ($prev = $controller->cachev
->fetch_prev_revision($controller->revctx
));
47 $link['diffprev'] = $controller->href_compound('diff.php', null, Paths
::fetch_rev_str(true, $controller->revctx
, $prev['revision']));
50 // ###################################################################
52 $logmsg = $controller->cachev
->fetch_revision($controller->revctx
);
53 unset($logmsg['files']);
55 $logmsg['message_clean'] = SVNCommon
::format_log_message($logmsg['message']);
56 $logmsg['date'] = SVNCommon
::format_date_string($logmsg['dateline']);
58 $catdata = implode("\n", $controller->library
->command('cat'));
60 // ###################################################################
62 $show['props'] = false;
64 if (sizeof($latest['properties']) > 0)
66 $show['props'] = true;
67 foreach ($latest['properties'] AS $propname => $propval)
69 $data = sprintf($lang->string('Property <strong>%1$s</strong> set to <em>%2$s</em>'), $propname, $propval);
70 eval('$proplist .= "' . $template->fetch('property') . '";');
74 // ###################################################################
76 // get language information
77 require_once('./includes/file_types.php');
78 $extension = $funct->fetch_extension($controller->path
);
79 $language = (isset($filetypes["$extension"]) ? $filetypes["$extension"] : null);
82 $mtstart = microtime();
83 require_once('./includes/geshi/geshi.php');
84 $geshi = new Geshi($catdata, $language[MIMES_GESHI_LANGUAGE
]);
87 $geshi->enable_classes();
90 $geshi->set_header_type(GESHI_HEADER_DIV
);
93 $urls = (isset($geshi->language_data
['URLS']) ? array_keys($geshi->language_data
['URLS']) : array());
94 foreach ($urls AS $key)
96 $geshi->set_url_for_keyword_group($key, '');
99 // don't do anything stupid
100 $geshi->set_case_keywords(GESHI_CAPS_NO_CHANGE
);
103 $geshi->set_encoding('UTF-8');
106 $geshi->set_tab_width(5);
109 $catdata = $geshi->parse_code();
111 $viewsvn->debug("time in GeSHi = " . $funct->fetch_microtime_diff($mtstart));
113 // ###################################################################
115 eval('$template->flush("' . $template->fetch('view') . '");');
117 /*=====================================================================*\
118 || ###################################################################
121 || ###################################################################
122 \*=====================================================================*/