summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/footer.inc4
-rw-r--r--templates/header.inc141
-rw-r--r--templates/show_search.inc3
-rw-r--r--templates/show_users.inc8
-rw-r--r--templates/sidebar.inc.php126
-rw-r--r--templates/style.inc77
-rw-r--r--templates/subnavbar.inc.php39
7 files changed, 284 insertions, 114 deletions
diff --git a/templates/footer.inc b/templates/footer.inc
index 819bd9b8..dd59cf83 100644
--- a/templates/footer.inc
+++ b/templates/footer.inc
@@ -1,3 +1,5 @@
-<br /><br />
+ </td>
+</tr>
+</table>
</body>
</html>
diff --git a/templates/header.inc b/templates/header.inc
index d5b64b45..d1eceb4a 100644
--- a/templates/header.inc
+++ b/templates/header.inc
@@ -21,7 +21,7 @@
*/
$htmllang = str_replace("_","-",conf('lang'));
-
+$location = get_location();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
@@ -30,111 +30,42 @@ $htmllang = str_replace("_","-",conf('lang'));
<link rel="shortcut icon" href="<?php echo conf('web_path'); ?>/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo conf('site_charset'); ?>" />
<?php show_template('style'); ?>
-<title><?php echo conf('site_title'); ?></title>
+<title><?php echo conf('site_title'); ?> - <?php echo $location['title']; ?></title>
</head>
<body>
-<script type="text/javascript" language="javascript">
-<!-- Begin
-function disableField(element) {
- var element_id = document.getElementById(element);
- element_id.disabled=true;
- element_id.value='';
- element_id.checked=false;
-}
-function enableField(element) {
- var element_id = document.getElementById(element);
- element_id.disabled=false;
-
-}
-function flipField(element) {
- var element_id = document.getElementById(element);
- if (element_id.disabled == false) {
- element_id.disabled=true;
- }
- else {
- element_id.disabled=false;
- }
-}
-function selectField(element)
-{
- var element_id = document.getElementById(element);
- element_id.focus();
-}
- var checkflag_song = "false";
-
- function check_songs() {
- if (checkflag_song == "false") {
- if (document.forms.songs.elements["song[]"].length == undefined) {
- document.forms.songs.elements["song[]"].checked = true;
- }
- else {
- for (i = 0; i < document.forms.songs.elements["song[]"].length; i++) {
- document.forms.songs.elements["song[]"][i].checked = true;
- }
- }
- checkflag_song = "true";
- return "Unselect All";
- }
- else {
- if (document.forms.songs.elements["song[]"].length == undefined) {
- document.forms.songs.elements["song[]"].checked = false;
- }
- else {
- for (i = 0; i < document.forms.songs.elements["song[]"].length; i++) {
- document.forms.songs.elements["song[]"][i].checked = false;
- }
- }
- checkflag_song = "false";
- return "Select All";
- }
- }
-
- function invert_songs() {
- for( i = 0; i < document.forms.songs.elements["song[]"].length; ++i ) {
- document.forms.songs.elements["song[]"][i].checked = !document.forms.songs.elements["song[]"][i].checked
- }
- }
+<script src="<?php echo conf('web_path'); ?>/lib/general.js" language="javascript"></script>
- var checkflag_results = "false";
- function check_results() {
- if (checkflag_results == "false") {
- if (document.results.elements["results[]"].length == undefined) {
- document.results.elements["results[]"].checked = true;
- }
- else {
- for (i = 0; i < document.results.elements["results[]"].length; i++) {
- document.results.elements["results[]"][i].checked = true;
- }
- }
- checkflag_results = "true";
- return "Unselect All";
- }
- else {
- if (document.results.elements["results[]"].length == undefined) {
- document.results.elements["results[]"].checked = false;
- }
- else {
- for (i = 0; i < document.results.elements["results[]"].length; i++) {
- document.results.elements["results[]"][i].checked = false;
- }
- }
- checkflag_results = "false";
- return "Select All";
- }
- }
-// End -->
-</script>
-
-<div id="pageheader">
-<a href="http://www.ampache.org">
- <img class="pageheader" src="<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache.gif" border="0" title="Ampache: For the love of music" alt="Ampache: For the love of music" />
-</a>
-</div>
-<?php
- if( isset( $_REQUEST['amp_error'] ) ) {
- $msg = scrub_in( $_REQUEST['amp_error'] );
- echo( "<font class=\"error\">Error:\t$msg</font><br><br>" );
- if (conf('debug')) { log_event($_SESSION['userdata']['username'],' general_error ',"Error: $msg"); }
- }
-?>
+<table border="0" cellpadding="0" cellspacing="0" style="margin:0px;" width="100%" >
+<!-- This is the topbar row -->
+<tr id="pageheader">
+ <td colspan="2">
+ <div style="float:left;margin-top:3px;">
+ <a href="http://www.ampache.org">
+ <img class="pageheader" src="<?php echo conf('web_path'); ?><?php echo conf('theme_path'); ?>/images/ampache.gif" border="0" title="Ampache: For the love of music" />
+ </a>
+ </div>
+ <div style="float:right;">
+ <a href="http://www.ampache.org/index.php">Ampache v.<?php echo conf('version'); ?></a><br />
+ <b><?php echo _("You are currently logged in as") . " " . $GLOBALS['user']->username; ?></b>
+ <br />
+ <?php echo _("Browse"); ?>:
+ <form method="post" action="<?php echo conf('web_path'); ?>/browse.php" enctype="multipart/form-data" style="Display:inline;">
+ <select name="action">
+ <option value="album">Album</option>
+ <option value="artist">Artist</option>
+ <option value="genre">Genre</option>
+ </select>
+ <input type="submit" value="<?php echo _("Go!"); ?>" class="button" />
+ </form>
+ </div>
+ </td>
+</tr>
+<!-- This is the row for body + sidebar -->
+<tr>
+ <!-- This is the sidebar -->
+ <td valign="top" class="sidebar">
+ <?php require_once(conf('prefix') . '/templates/sidebar.inc.php'); ?>
+ </td>
+ <td width="100%" valign="top" style="padding-top:10px;padding-left:10px;">
+ <!-- Start Main Page -->
diff --git a/templates/show_search.inc b/templates/show_search.inc
index fdb1aed1..ba0c9906 100644
--- a/templates/show_search.inc
+++ b/templates/show_search.inc
@@ -58,8 +58,9 @@ $final_javascript .= " // END-->\n </script>";
<td>
<input type="checkbox" name="search_object[]" value="all" onclick="flipField('all_string');" <?php echo $check_all; ?> />
<input type="text" id="all_string" name="all_string" value="<?php echo scrub_out($_REQUEST['all_string']); ?>" disabled="disabled" />
+ <?php $GLOBALS['error']->print_error('keyword'); ?>
</td>
- <td></td>
+ <td>&nbsp;</td>
</tr>
<tr class="<?php echo flip_class(); ?>">
<td><?php echo _("Title"); ?></td>
diff --git a/templates/show_users.inc b/templates/show_users.inc
index aaebf778..edb5cfd5 100644
--- a/templates/show_users.inc
+++ b/templates/show_users.inc
@@ -36,11 +36,11 @@ $admin_menu = "admin/";
</tr>
<tr class="table-header">
<td align="center">
- <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=username&amp;sort_order=0">
- <b><?php echo _("Username"); ?></b>
- </a>
<a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=fullname&amp;sort_order=0">
- <b>(<?php echo _("Fullname"); ?>)</b>
+ <b><?php echo _("Fullname"); ?></b>
+ </a>
+ <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=username&amp;sort_order=0">
+ <b>(<?php echo _("Username"); ?>)</b>
</a>
</td>
<td align="center">
diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php
new file mode 100644
index 00000000..ea8d9525
--- /dev/null
+++ b/templates/sidebar.inc.php
@@ -0,0 +1,126 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2006 Ampache.org
+ All rights reserved.
+
+ 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; either version 2
+ of the License, or (at your option) any later version.
+
+ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+/**
+ * This is kind of the wrong place to do this, but let's define the different submenu's that could possibly be
+ * displayed on this page, this calls the show_submenu($items); function which takes an array of items
+ * that have ['title'] ['url'] and ['active'] url assumes no conf('web_path')
+ */
+
+$admin_items[] = array('title'=>'Users','url'=>'admin/users.php','active'=>'');
+$admin_items[] = array('title'=>'Mail Users','url'=>'admin/mail.php','active'=>'');
+$admin_items[] = array('title'=>'Catalog','url'=>'admin/catalog.php','active'=>'');
+$admin_items[] = array('title'=>'Site Preferences','url'=>'admin/preferences.php','active'=>'');
+$admin_items[] = array('title'=>'Access List','url'=>'admin/access.php','active'=>'');
+
+$browse_items[] = array('title'=>'Albums','url'=>'albums.php','active'=>'');
+$browse_items[] = array('title'=>'Artists','url'=>'artists.php','active'=>'');
+$browse_items[] = array('title'=>'Genre','url'=>'browse.php?action=genre','active'=>'');
+//$browse_items[] = array('title'=>'File','url'=>'files.php','active'=>'');
+
+?>
+<div id="navcontainer">
+ <ul id="navlist">
+ <li id="active">
+ <a href="<?php echo conf('web_path'); ?>/index.php" id="current"><?php echo _("Home"); ?></a>
+ </li>
+ <?php if ($GLOBALS['user']->has_access(100)) { ?>
+ <li>
+ <a href="<?php echo conf('web_path'); ?>/admin/index.php"><?php echo _("Admin"); ?></a>
+ </li>
+ <?php if ($location['section'] == 'admin') { show_submenu($admin_items); } ?>
+ <? } ?>
+ <li>
+ <a href="<?php echo conf('web_path'); ?>/preferences.php"><?php echo _("Preferences"); ?></a>
+ </li>
+ <li>
+ <a href="<?php echo conf('web_path'); ?>/browse.php"><?php echo _("Browse"); ?></a>
+ </li>
+ <?php if ($location['section'] == 'browse') { show_submenu($browse_items); } ?>
+ <?php if ($GLOBALS['user']->prefs['upload']) { ?>
+ <li>
+ <a href="<?php echo conf('web_path'); ?>/upload.php"><?php echo _("Upload"); ?></a>
+ </li>
+ <?php } ?>
+ <li>
+ <a href="<?php echo conf('web_path'); ?>/playlist.php"><?php echo _("Playlists"); ?></a>
+ </li>
+ <?php if ($GLOBALS['user']->prefs['play_type'] == 'mpd') { ?>
+ <li>
+ <a href="<?php echo conf('web_path'); ?>/mpd.php"><?php echo _("Local Play"); ?></a>
+ </li>
+ <?php } ?>
+ <li>
+ <a href="<?php echo conf('web_path'); ?>/search.php"><?php echo _("Search"); ?></a>
+ </li>
+ <ul id="subnavside">
+ <li class="subnavbutton">
+ <form name="search" method="post" action="<?php echo conf('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline">
+ <input type="text" name="search_string" value="<?php echo scrub_out($_REQUEST['search_string']); ?>" size="8" />
+ <input class="smallbutton" type="submit" value="<?php echo _("Search"); ?>" />
+ <input type="hidden" name="action" value="quick_search" />
+ <input type="hidden" name="method" value="fuzzy" />
+ <input type="hidden" name="object_type" value="song" />
+ <input type="hidden" name="search_object[]" value="all" />
+ </form>
+ </li>
+ </ul>
+ <li>
+ <a href="<?php echo conf('web_path'); ?>/randomplay.php"><?php echo _("Random Play"); ?></a>
+ </li>
+ <ul id="subnavside">
+ <li class="subnavbutton">
+ <form name="random" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ?>/song.php" style="Display:inline">
+ <input type="hidden" name="action" value="m3u" />
+ <select name="random" style="width:110px;">
+ <option value="1">1</option>
+ <option value="5">5</option>
+ <option value="10">10</option>
+ <option value="20">20</option>
+ <option value="30">30</option>
+ <option value="50">50</option>
+ <option value="100">100</option>
+ <option value="500">500</option>
+ <option value="1000">1000</option>
+ <option value="-1"><?php echo _("All"); ?></option>
+ </select>
+ <br />
+ <select name="Quantifier" style="width:110px;">
+ <option value="Songs"><?php echo _("Songs"); ?></option>
+ <option value="Minutes"><?php echo _("Minutes"); ?></option>
+ <option value="Artists"><?php echo _("Artists"); ?></option>
+ <option value="Albums"><?php echo _("Albums"); ?></option>
+ <option value="Less Played"><?php echo _("Less Played"); ?></option>
+ </select>
+ <br />
+ <?php show_catalog_pulldown('catalog','width:110px;'); ?>
+ <br />
+ <input type="hidden" name="aaction" value="Play!" />
+ <input class="smallbutton" type="submit" name="aaction" value="<?php echo _("Enqueue"); ?>" />
+ </form>
+ </li>
+ </ul>
+ <?php if (conf('use_auth')) { ?>
+ <li><a href="<?php echo conf('web_path'); ?>/logout.php">Logout</a></li>
+ <?php } ?>
+ </ul>
+</div>
diff --git a/templates/style.inc b/templates/style.inc
index e6810f0e..d0da2923 100644
--- a/templates/style.inc
+++ b/templates/style.inc
@@ -30,7 +30,10 @@
<!--
body
{
- padding-top: 5px;
+ padding-top: 0px;
+ margin-top: 0px;
+ margin-left: 0px;
+ margin-right: 0px;
background: <?php echo conf('bg_color1'); ?>;
font-family: <?php echo conf('font') ?>;
font-size: <?php echo conf('font_size'); ?>px;
@@ -181,7 +184,7 @@
/*************** END Main Menu *************/
/*************** Page Header *********************/
#pageheader {
- background: <?php echo conf('bg_color1');?>;
+ background: #8B8B8B;
}
/*************** END Page Header *****************/
.header1
@@ -251,6 +254,74 @@
font-size: <?php echo conf('font_size'); ?>px;
font-weight: normal;
}
+ .smallbutton
+ {
+ border:0px;
+ padding-left:1px;
+ padding-right:1px;
+ font-size: <?php echo conf('font_size') - 1; ?>px;
+ }
+ .sidebar
+ {
+ margin-left:0px;
+ margin-top:0px;
+ margin-right:0px;
+ padding-right:0px;
+ padding-top: 0px;
+ padding-left: 0px;
+ width:160px;
+ background: <?php echo conf('base_color2'); ?>;
+ }
+
+ #sidecontainer
+ {
+ margin-left: 0px;
+ }
+
+ #navcontainer ul
+ {
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ font-family: verdana, arial, Helvetica, sans-serif;
+ }
+
+ #navcontainer li { margin: 0 0 1px 0; }
+
+ #navcontainer a, .navbutton
+ {
+ display: block;
+ padding: 5px 10px;
+ width: 140px;
+ color: #000;
+ background-color: #666;
+ text-decoration: none;
+ }
+
+ #navcontainer a:hover
+ {
+ color: #000;
+ background-color: #ccc;
+ text-decoration: none;
+ }
+
+ #navcontainer ul ul li { margin: 0 0 1px 0; }
+
+ #navcontainer ul ul a, .subnavbutton
+ {
+ display: block;
+ padding: 5px 5px 5px 30px;
+ width: 125px;
+ color: #000;
+ background-color: #ccc;
+ text-decoration: none;
+ }
+
+ #navcontainer ul ul a:hover
+ {
+ color: #000;
+ background-color: #ddd;
+ text-decoration: none;
+ }
-->
</style>
-
diff --git a/templates/subnavbar.inc.php b/templates/subnavbar.inc.php
new file mode 100644
index 00000000..a7064fd3
--- /dev/null
+++ b/templates/subnavbar.inc.php
@@ -0,0 +1,39 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2006 Ampache.org
+ All rights reserved.
+
+ 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; either version 2
+ of the License, or (at your option) any later version.
+
+ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+/**
+ * This file expect an array of 'items' which have ['0']['url'] ['0']['title']
+ * and a ['0']['active'] == true/false this is called from show_submenu($items);
+ */
+
+?>
+ <ul id="subnavside">
+<?php
+ foreach ($items as $item) {
+ if ($item['active']) {
+ $li_id = "id=\"subactive\"";
+ $a_id = "id=\"subcurrent\"";
+ }
+?>
+ <li <?php echo $li_id; ?>><a href="<?php echo conf('web_path') . "/" . $item['url']; ?>" <?php echo $a_id; ?>><?php echo $item['title']; ?></a></li>
+<?php unset($li_id,$a_id); } ?>
+ </ul>