- added header
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 12 Sep 2005 00:02:01 +0000 (00:02 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 12 Sep 2005 00:02:01 +0000 (00:02 +0000)
- added repository switcher
- added footer

global.php
repository.php [new file with mode: 0644]
templates/default/footer.tpl
templates/default/header.tpl
templates/default/main.css
templates/default/select_option.tpl [new file with mode: 0644]

index ffd567aaef1d754a4b5eee16c3076fea778f6254..d49de7051407496ec90dc6cfeb65917ebb44ecff 100644 (file)
 
 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 (file)
index 0000000..7522ecb
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # ViewSVN [#]version[#]
+|| # Copyright ©2002-[#]year[#] Iris Studios, Inc.
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version [#]gpl[#] of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+define('PATH_OVERRIDE', 1);
+
+require_once('./global.php');
+
+// ###################################################################
+
+if ($viewsvn->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
index 5d5509f48a3c33cbe87f9e119d787c039d4154c0..9c1f94699dbe0aa2981bc078c92bba74f100ca67 100644 (file)
@@ -1 +1,8 @@
+<div class="footer">
+       <!-- please leave this copyright notice in place -->
+       <div>Powered by ViewSVN [#]version[#]</div>
+       <div>Copyright &copy;2002-$year, <a href="http://www.iris-studios.com" target="_blank">Iris Studios, Inc.</a></div>
+       <!-- / please leave this copyright notice in place -->
+</div>
+
 </body>
\ No newline at end of file
index 1e952ee24a4022cb3bd12fea5676db8c8319ee83..d303e1a03054e04f9b332e77205f5b5896fed415 100644 (file)
@@ -1 +1,13 @@
-<body>
\ No newline at end of file
+<body>
+
+<h1 style="display: inline">ViewSVN</h1>
+
+<form style="float: right" name="jumper" method="post" action="$viewsvn->path/repository.php">
+       Repository: <select name="repository">
+       $options
+       </select>
+       
+       <input type="submit" name="submit" value="Go" />
+</form>
+
+<br />
\ No newline at end of file
index fa5471c950968585e9c5822c548fb276503d2ff0..1d3672cb552e0fde0fdea87eef9a90844565d654 100644 (file)
@@ -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 (file)
index 0000000..a949a6d
--- /dev/null
@@ -0,0 +1 @@
+               <option value="$value"<if condition="$selected"> selected="selected"</if>>$display</option>