Fixing the browser (mostly)
[viewsvn.git] / global.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 require_once('./includes/init.php');
23
24 require_once('./includes/functions.php');
25 require_once('./includes/class_revision.php');
26
27 // ###################################################################
28 // define the path variables
29 $atpos = strpos($input->in['path'], '@');
30 $input->in['rev'] = $input->clean(substr($input->in['path'], $atpos + 1), TYPE_UINT);
31 if ($atpos !== false)
32 {
33 $input->in['path'] = substr($input->in['path'], 0, strpos($input->in['path'], '@'));
34 }
35
36 // ###################################################################
37 // setup the SVN library
38 require_once('./includes/class_libsvn.php');
39 BSRegister::Register('lib', $lib = new LibSVN($conf['paths']['svn']));
40
41 $fetchtemplates[] = 'header';
42 $fetchtemplates[] = 'footer';
43 $fetchtemplates[] = 'doctype';
44 $fetchtemplates[] = 'headinclude';
45
46 $show['reposchooser'] = false;
47 if ($viewsvn->repos->container AND $dochooser)
48 {
49 $show['reposchooser'] = true;
50 $fetchtemplates[] = 'select_option';
51 }
52
53 $template->cache((array)$fetchtemplates);
54
55 $options = '';
56 if ($show['reposchooser'])
57 {
58 $html = '';
59 $options = $viewsvn->repos->fetch_list();
60 foreach ($options AS $option)
61 {
62 $value = $option;
63 $display = $option;
64 $selected = ($controller->repos == $option ? true : false);
65 eval('$html .= "' . $template->fetch('select_option') . '";');
66 }
67 $options = $html;
68 }
69
70 $year = date('Y');
71
72 eval('$header = "' . $template->fetch('header') . '";');
73 eval('$footer = "' . $template->fetch('footer') . '";');
74 eval('$doctype = "' . $template->fetch('doctype') . '";');
75 eval('$headinclude = "' . $template->fetch('headinclude') . '";');
76
77 /*=====================================================================*\
78 || ###################################################################
79 || # $HeadURL$
80 || # $Id$
81 || ###################################################################
82 \*=====================================================================*/
83 ?>