From c9e0720c2b54cdc22904dd7ebe39e6d6fd7a7b03 Mon Sep 17 00:00:00 2001
From: Robert Sesek
Date: Mon, 12 Sep 2005 00:02:01 +0000
Subject: [PATCH] - added header - added repository switcher - added footer
---
global.php | 27 +++++++++++++++++
repository.php | 45 +++++++++++++++++++++++++++++
templates/default/footer.tpl | 7 +++++
templates/default/header.tpl | 14 ++++++++-
templates/default/main.css | 9 ++++++
templates/default/select_option.tpl | 1 +
6 files changed, 102 insertions(+), 1 deletion(-)
create mode 100644 repository.php
create mode 100644 templates/default/select_option.tpl
diff --git a/global.php b/global.php
index ffd567a..d49de70 100644
--- a/global.php
+++ b/global.php
@@ -21,11 +21,14 @@
require_once('./includes/init.php');
+$dochooser = false;
if (!defined('PATH_OVERRIDE') OR PATH_OVERRIDE != 1)
{
$path = $viewsvn->paths->parse();
$repos = $viewsvn->paths->fetch_repos($path);
$relpath = $viewsvn->paths->fetch_path($path);
+
+ $dochooser = true;
}
$fetchtemplates[] = 'header';
@@ -33,8 +36,32 @@ $fetchtemplates[] = 'footer';
$fetchtemplates[] = 'doctype';
$fetchtemplates[] = 'headinclude';
+$show['reposchooser'] = false;
+if ($viewsvn->repos->container AND $dochooser)
+{
+ $show['reposchooser'] = true;
+ $fetchtemplates[] = 'select_option';
+}
+
$template->cache((array)$fetchtemplates);
+$options = '';
+if ($show['reposchooser'])
+{
+ $html = '';
+ $options = $viewsvn->repos->fetch_list();
+ foreach ($options AS $option)
+ {
+ $value = $option;
+ $display = $option;
+ $selected = ($repos == $option ? true : false);
+ eval('$html .= "' . $template->fetch('select_option') . '";');
+ }
+ $options = $html;
+}
+
+$year = date('Y');
+
eval('$header = "' . $template->fetch('header') . '";');
eval('$footer = "' . $template->fetch('footer') . '";');
eval('$doctype = "' . $template->fetch('doctype') . '";');
diff --git a/repository.php b/repository.php
new file mode 100644
index 0000000..7522ecb
--- /dev/null
+++ b/repository.php
@@ -0,0 +1,45 @@
+in['repository'])
+{
+ if (in_array($viewsvn->in['repository'], $viewsvn->repos->fetch_list()))
+ {
+ header('Location: ' . $viewsvn->path . '/' . $viewsvn->paths->out('browse.php', $viewsvn->in['repository'] . '/'));
+ exit;
+ }
+}
+
+header('Location: ' . $viewsvn->path . '/index.php');
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file
diff --git a/templates/default/footer.tpl b/templates/default/footer.tpl
index 5d5509f..9c1f946 100644
--- a/templates/default/footer.tpl
+++ b/templates/default/footer.tpl
@@ -1 +1,8 @@
+
+
\ No newline at end of file
+
+
+ViewSVN
+
+
+
+
\ No newline at end of file
diff --git a/templates/default/main.css b/templates/default/main.css
index fa5471c..1d3672c 100644
--- a/templates/default/main.css
+++ b/templates/default/main.css
@@ -112,6 +112,15 @@ a:hover
left: 35%;
}
+.footer
+{
+ margin-top: 10px;
+
+ text-align: right;
+
+ font-size: 10px;
+}
+
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
diff --git a/templates/default/select_option.tpl b/templates/default/select_option.tpl
new file mode 100644
index 0000000..a949a6d
--- /dev/null
+++ b/templates/default/select_option.tpl
@@ -0,0 +1 @@
+
--
2.43.5