diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-21 08:03:20 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-21 08:03:20 +0000 |
commit | 975bbcebe9c68ac729dd051b008cf6c615d443c2 (patch) | |
tree | 46737108023c5d65797d39f748c53cff0c160e10 | |
parent | 742f6bfa6a7b285db898da220e1799fbb9b79ded (diff) | |
download | ampache-975bbcebe9c68ac729dd051b008cf6c615d443c2.tar.gz ampache-975bbcebe9c68ac729dd051b008cf6c615d443c2.tar.bz2 ampache-975bbcebe9c68ac729dd051b008cf6c615d443c2.zip |
new interface which breaks all previous themes... and current themes, still under development
-rw-r--r-- | admin/access.php | 6 | ||||
-rw-r--r-- | admin/catalog.php | 12 | ||||
-rw-r--r-- | admin/index.php | 17 | ||||
-rw-r--r-- | admin/mail.php | 8 | ||||
-rw-r--r-- | admin/preferences.php | 7 | ||||
-rw-r--r-- | admin/users.php | 9 | ||||
-rw-r--r-- | albums.php | 11 | ||||
-rw-r--r-- | artists.php | 8 | ||||
-rw-r--r-- | browse.php | 43 | ||||
-rwxr-xr-x | docs/CHANGELOG | 12 | ||||
-rw-r--r-- | genre.php | 7 | ||||
-rw-r--r-- | index.php | 30 | ||||
-rw-r--r-- | lib/class/stream.class.php | 2 | ||||
-rw-r--r-- | lib/general.js | 88 | ||||
-rw-r--r-- | lib/stream.lib.php | 6 | ||||
-rw-r--r-- | lib/ui.lib.php | 100 | ||||
-rw-r--r-- | localplay.php | 4 | ||||
-rw-r--r-- | modules/init.php | 2 | ||||
-rw-r--r-- | modules/lib.php | 15 | ||||
-rw-r--r-- | mpd.php | 6 | ||||
-rw-r--r-- | play/index.php | 5 | ||||
-rw-r--r-- | playlist.php | 12 | ||||
-rw-r--r-- | preferences.php | 4 | ||||
-rw-r--r-- | randomplay.php | 4 | ||||
-rw-r--r-- | search.php | 11 | ||||
-rw-r--r-- | templates/footer.inc | 4 | ||||
-rw-r--r-- | templates/header.inc | 141 | ||||
-rw-r--r-- | templates/show_search.inc | 3 | ||||
-rw-r--r-- | templates/show_users.inc | 8 | ||||
-rw-r--r-- | templates/sidebar.inc.php | 126 | ||||
-rw-r--r-- | templates/style.inc | 77 | ||||
-rw-r--r-- | templates/subnavbar.inc.php | 39 | ||||
-rwxr-xr-x | themes/classic/images/ampache.gif | bin | 6343 -> 9492 bytes | |||
-rw-r--r-- | upload.php | 7 |
34 files changed, 571 insertions, 263 deletions
diff --git a/admin/access.php b/admin/access.php index ca7111e6..45896950 100644 --- a/admin/access.php +++ b/admin/access.php @@ -36,9 +36,6 @@ if (!$user->has_access(100)) { show_template('header'); -show_menu_items('Admin'); -show_admin_menu('Access Lists'); -show_clear(); if ( $action == 'show_confirm_delete' ) { show_confirm_action(_("Do you really want to delete this Access Record?"), "admin/access.php", "access_id=" . $_REQUEST['access_id'] . "&action=delete_host"); } @@ -73,7 +70,6 @@ else { $list = $access->get_access_list(); include(conf('prefix') ."/templates/show_access_list.inc"); } -echo "<br /><br />"; -show_page_footer ('Admin', 'Access Lists',$user->prefs['display_menu']); +show_footer(); ?> diff --git a/admin/catalog.php b/admin/catalog.php index c3bf3675..7716a0b4 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -38,12 +38,6 @@ $catalog = new Catalog($_REQUEST['catalog_id']); show_template('header'); -/* Generate the menus */ -show_menu_items('Admin'); -show_admin_menu('Catalog'); -show_clear(); - - /* Big switch statement to handle various actions */ switch ($_REQUEST['action']) { case 'fixed': @@ -285,6 +279,8 @@ switch ($_REQUEST['action']) { include(conf('prefix') . '/templates/catalog.inc'); } // end switch -echo "<br /><br />"; -show_page_footer ('Admin', 'Catalog',$user->prefs['display_menu']); + +/* Show the Footer */ +show_footer(); + ?> diff --git a/admin/index.php b/admin/index.php index 3467f2c5..dfc682b3 100644 --- a/admin/index.php +++ b/admin/index.php @@ -48,20 +48,6 @@ if ( $action == 'Update Preferences' ) { } show_template('header'); -show_menu_items('Admin'); - -if ( $action == 'show_site_preferences' ) { - show_admin_menu('Site Preferences'); -} -elseif ( ($action == 'show_users') || ($action == 'show_new_user')) { - show_admin_menu('Users'); -} -elseif ( $action == 'show_update_catalog' ) { - show_admin_menu('Catalog'); -} -else { - show_admin_menu('...'); -} if ( $action == 'Update Preferences' ) { $action = 'show_preferences'; @@ -88,6 +74,5 @@ else { require (conf('prefix') . "/templates/show_admin_index.inc"); } // if they didn't pick anything -show_clear(); -show_page_footer ('Admin', '',$user->prefs['display_menu']); +show_footer(); ?> diff --git a/admin/mail.php b/admin/mail.php index 2d5a0802..a69b0ead 100644 --- a/admin/mail.php +++ b/admin/mail.php @@ -83,10 +83,6 @@ if ( empty($subject) ) { } show_template('header'); - -show_menu_items('Admin'); -show_admin_menu('Mail Users'); -show_clear(); ?> <form name="mail" method="post" action="<?php echo conf('web_path'); ?>/admin/mail.php" enctype="multipart/form-data"> @@ -130,6 +126,4 @@ show_clear(); </form> <br /><br /> -<?php -show_page_footer ('Admin', 'Mail Users',$user->prefs['display_menu']); -?> +<?php show_footer(); ?> diff --git a/admin/preferences.php b/admin/preferences.php index 5e64be43..46f4e6fb 100644 --- a/admin/preferences.php +++ b/admin/preferences.php @@ -73,9 +73,6 @@ switch(scrub_in($_REQUEST['action'])) { // HEADER show_template('header'); -show_menu_items('Admin'); -show_admin_menu('Admin Preferences'); -show_clear(); // HEADER // Set Target @@ -86,5 +83,7 @@ require (conf('prefix') . "/templates/show_preferences.inc"); // FOOTER -show_page_footer ('Admin', 'Admin Preferences',$user->prefs['display_menu']); +show_footer(); + + ?> diff --git a/admin/users.php b/admin/users.php index 4a2f0ed6..b2d6da22 100644 --- a/admin/users.php +++ b/admin/users.php @@ -39,10 +39,6 @@ $action = scrub_in($_REQUEST['action']); show_template('header'); -show_menu_items('Admin'); -show_admin_menu('Users'); -show_clear(); - $user_id = scrub_in($_REQUEST['user']); $temp_user = new User($user_id); @@ -182,6 +178,7 @@ switch ($action) { } -echo "<br /><br />"; -show_page_footer ('Admin', 'Users',$user->prefs['display_menu']); +/* Show the footer */ +show_footer(); + ?> @@ -25,6 +25,8 @@ require_once("modules/init.php"); +show_template('header'); + // We'll set any input parameters here if(!isset($_REQUEST['match'])) { $_REQUEST['match'] = "Browse"; } if(isset($_REQUEST['match'])) $match = scrub_in($_REQUEST['match']); @@ -32,11 +34,6 @@ if(isset($_REQUEST['album'])) $album = scrub_in($_REQUEST['album']); if(isset($_REQUEST['artist'])) $artist = scrub_in($_REQUEST['artist']); $_REQUEST['artist_id'] = scrub_in($_REQUEST['artist_id']); -show_template('header'); -show_menu_items('Browse'); -show_browse_menu('Albums'); -show_clear(); - if ($_REQUEST['action'] === 'clear_art') { if (!$user->has_access('25')) { access_denied(); } $album = new Album($_REQUEST['album_id']); @@ -191,6 +188,7 @@ else { $sql = "SELECT id FROM album WHERE name LIKE 'a%'"; break; default: + //FIXME: This is the old way of doing it, move this to browse show_alphabet_list('albums','albums.php',$match); show_alphabet_form($match,_("Show Albums starting with"),"albums.php?action=match"); echo "<br /><br />"; @@ -219,6 +217,5 @@ else { } // else no album -show_clear(); -show_page_footer ('Albums', '',$user->prefs['display_menu']); +show_footer(); ?> diff --git a/artists.php b/artists.php index 75f1f2eb..4ff8fa22 100644 --- a/artists.php +++ b/artists.php @@ -30,9 +30,6 @@ if (!isset($_REQUEST['action'])) { $_REQUEST['action'] = "match"; } $action = scrub_in($_REQUEST['action']); show_template('header'); -show_menu_items('Browse'); -show_browse_menu('Artists'); -show_clear(); switch($action) { @@ -145,13 +142,12 @@ switch($action) { } break; default: + //FIXME: This is being moved to browse show_alphabet_list('artists','artists.php'); show_alphabet_form('',_("Show Artists starting with"),"artists.php?action=match"); show_artists('A'); break; } // end switch - -show_clear(); -show_page_footer ('Artists', '',$user->prefs['display_menu']); +show_footer(); ?> @@ -40,13 +40,44 @@ $action = scrub_in($_REQUEST['action']); /* Display the headers and menus */ show_template('header'); -show_menu_items('Browse'); -show_browse_menu($_REQUEST['action']); -show_clear(); switch($action) { + case 'file': case 'album': + show_alphabet_list('albums','albums.php',$match); + show_alphabet_form($match,_("Show Albums starting with"),"albums.php?action=match"); + + /* Get the results and show them */ + $sql = "SELECT id FROM album WHERE name LIKE '$match%'"; + + $view = new View(); + $view->import_session_view(); + + // if we are returning + if ($_REQUEST['keep_view']) { + $view->initialize(); + } + + // If we aren't keeping the view then initlize it + elseif ($sql) { + $db_results = mysql_query($sql, dbh()); + $total_items = mysql_num_rows($db_results); + if ($match != "Show_all") { $offset_limit = $_SESSION['userdata']['offset_limit']; } + $view = new View($sql, 'albums.php','name',$total_items,$offset_limit); + } + + else { $view = false; } + + if ($view->base_sql) { + $albums = get_albums($view->sql); + show_albums($albums,$view); + } + break; case 'artist': + show_alphabet_list('artists','artists.php'); + show_alphabet_form('',_("Show Artists starting with"),"artists.php?action=match"); + show_artists(); + break; case 'genre': /* Create the Needed Object */ $genre = new Genre(); @@ -74,6 +105,7 @@ switch($action) { } break; + case 'catalog': break; @@ -90,9 +122,6 @@ switch($action) { } // end Switch $action -show_clear(); - /* Show the Footer */ -show_page_footer('Browse', '',$user->prefs['display_menu']); - +show_footer(); ?> diff --git a/docs/CHANGELOG b/docs/CHANGELOG index e3ff703f..e65b1794 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,10 @@ -------------------------------------------------------------------------- v.3.3.2-Alpha4 + - Introduced initial new interface + - Fixed a problem where downsampled songs wouldn't get recorded + in stats due to their diminished size + - Fixed column typo on Admin User page - Fixed a problem with the no_symlinks setting which could cause some files to be missed regardless (Thx solarium_rider) @@ -29,7 +33,7 @@ v.3.3.2-Alpha3 11/29/2005 - Added marineam's patch to the Snoopy class which fixes a flaw in the new version which fails to escape single quotes - - Updated included Snoopy class due to vulenerability + - Updated included Snoopy class due to vulnerability http://seclists.org/lists/fulldisclosure/2005/Oct/0536.html (Thx marineam) - Fixed a problem where it would attempt to redirect back to the @@ -132,7 +136,7 @@ (Thx hongyi_gao) - Fixed refresh javascript for main page. - Fixed <html lang=> tag so that it validates (Thx XGizzmo) - - Added show_footer_menu() funciton and preference (Thx XGizzmo) + - Added show_footer_menu() function and preference (Thx XGizzmo) - Added localplay_menu config option that puts MPD on it's own page, will eventually control icecast,localplay,slimserver as well (Thx Nedko) @@ -161,7 +165,7 @@ breaks all previous themes. (Thx mkeadle) - Fixed problem with Color Boxes in IE (Thx rperkins) - Tweaked the Main page adding most popular albums as well as - spliting out the mpd control and now playing. + splitting out the mpd control and now playing. (Thx Nedko and reflous) - Fixed a problem with directories named '0' (Thx Protagonist) - Fixed lack of seeding of RAND() which would cause Pre PHP 4.2 @@ -270,7 +274,7 @@ when updating multiple songs from the same album where art has already been found. - Added Debug Script for Amazon Album Art search (in /bin) - - Cleaned up some dirty HTML, and redudant functions + - Cleaned up some dirty HTML, and redundant functions - Fixed lack of redirect to the Install page if no config file is found - Fixed login page so it respects the values set in the database @@ -27,9 +27,6 @@ require_once("modules/init.php"); show_template('header'); -show_menu_items('Browse'); -show_browse_menu('Genre'); -show_clear(); $action = scrub_in($_REQUEST['action']); @@ -58,9 +55,7 @@ switch($action) { -show_clear(); - /* Show the Footer */ -show_page_footer('Browse', '',$user->prefs['display_menu']); +show_footer(); ?> @@ -31,21 +31,15 @@ require_once("modules/init.php"); $myMpd = init_mpd(); show_template('header'); + + if (conf('refresh_limit') > 0) { show_template('javascript_refresh'); } -show_menu_items('Home'); -show_clear(); $action = scrub_in($_REQUEST['action']); ?> <p style="font-size: 8pt; font-weight: bold;"> <?php echo _("Welcome to"); ?> <a href="http://www.ampache.org/index.php">Ampache v.<?php echo conf('version'); ?></a> -<?php if (conf('use_auth')) { ?> - <?php echo _("you are currently logged in as") . " " . $user->fullname ." (". $user->username .")"; ?> -<?php } ?> -<?php if (conf('theme_name')) { ?> -<!-- Theme: <?php echo conf('theme_name'); ?> (<?php echo get_theme_author(conf('theme_name')); ?>) --> -<?php } ?> </p> <!-- Big Daddy Table --> <table style="padding-left:5px;padding-right:5px;padding-top:5px;padding-bottom:5px;" > @@ -75,17 +69,6 @@ $action = scrub_in($_REQUEST['action']); ?> </td> </tr> - <tr> - <td colspan="2" valign="top"> - <?php show_random_play_bar(); ?> - </td> - </tr> - <tr><td colspan="2"> </td></tr> - <tr> - <td colspan="2"> - <?php show_template('show_search_bar'); ?> - </td> - </tr> <tr><td colspan="2"> </td></tr> <?php @@ -130,13 +113,6 @@ $action = scrub_in($_REQUEST['action']); ?> </td> </tr> -<!-- <tr><td colspan="2"> </td></tr> - <tr> - <td colspan="2" valign="top"> - <?php show_template('show_random_play'); ?> - </td> - </tr> ---> </table> </td> <td valign="top"> @@ -160,4 +136,4 @@ $action = scrub_in($_REQUEST['action']); </tr> </table> -<?php show_page_footer ('Home', '', $user->prefs['display_menu']);?> +<?php show_footer(); ?> diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 283e0d32..16a7c722 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -270,7 +270,7 @@ class Stream { /* If we've added songs we should start playing */ $myMpd->Play(); - header ("Location: " . return_referer()); + header ("Location: " . conf('web_path') . "/index.php"); } // create_mpd diff --git a/lib/general.js b/lib/general.js new file mode 100644 index 00000000..f4ac76fb --- /dev/null +++ b/lib/general.js @@ -0,0 +1,88 @@ +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 + } + } + + 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"; + } +} diff --git a/lib/stream.lib.php b/lib/stream.lib.php index 50e9f22f..57be2fe3 100644 --- a/lib/stream.lib.php +++ b/lib/stream.lib.php @@ -250,7 +250,11 @@ function start_downsample($song,$now_playing_id=0,$song_name=0) { $fp = @popen($downsample_command, 'r'); - return ($fp); + /* We need more than just the handle here */ + $return_array['handle'] = $fp; + $return_array['size'] = $sample_ration*$song->size; + + return ($return_array); } // start_downsample diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 781dbe33..7722b251 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -218,10 +218,8 @@ function show_admin_menu ($admin_highlight) { */ function access_denied() { - show_template('style'); - show_footer(); echo "<br /><br /><br />"; - echo "<div class=\"fatalerror\">Error Access Denied</div>\n"; + echo "<div class=\"fatalerror\">" . _("Error Access Denied") . "</div>\n"; show_footer(); exit(); @@ -385,8 +383,9 @@ function truncate_with_ellipsis($text, $max=27) { * shows the footer of the page */ function show_footer() { - $class = "table-header"; - echo "<br /><br /><br /><div class=\"$class\" style=\"border: solid thin black;\"> </div>"; + + require_once(conf('prefix') . '/templates/footer.inc'); + } // show_footer /** @@ -758,4 +757,95 @@ function show_artist_pulldown ($artist_id,$select_name='artist') { echo "</select>\n"; } // show_artist_pulldown + +/** + * show_submenu + * This shows the submenu mojo for the sidebar, and I guess honestly anything + * else you would want it to... takes an array of items which have ['url'] ['title'] + * and ['active'] + */ +function show_submenu($items) { + + require (conf('prefix') . '/templates/subnavbar.inc.php'); + +} // show_submenu + + +/** + * get_location + * This function gets the information about said persons currently location + * this is used for A) Sidebar highlighting & submenu showing and B) Titlebar information + * it returns an array of information about what they are currently doing + * Possible array elements + * ['title'] Text name for the page + * ['page'] actual page name + * ['section'] name of the section we are in, admin, browse etc (submenu control) + * @package General + */ +function get_location() { + + $location = array(); + + /* Sanatize the $_SERVER['PHP_SELF'] variable */ + $location['page'] = preg_replace("/^\/(.+\.php)\/?.*/","$1",$_SERVER['PHP_SELF']); + + switch ($location['page']) { + case 'index.php': + $location['title'] = 'Home'; + break; + case 'search.php': + $location['title'] = 'Search'; + break; + case 'preferences.php': + $location['title'] = 'Preferences'; + break; + case 'admin/index.php': + $location['title'] = 'Admin'; + $location['section'] = 'admin'; + break; + case 'admin/catalog.php': + $location['title'] = 'Catalog'; + $location['section'] = 'admin'; + break; + case 'admin/users.php': + $location['title'] = 'User Management'; + $location['section'] = 'admin'; + break; + case 'admin/mail.php': + $location['title'] = 'Mail Users'; + $location['section'] = 'admin'; + break; + case 'admin/access.php': + $location['title'] = 'Manage Access Lists'; + $location['section'] = 'admin'; + break; + case 'admin/preferences.php': + $location['title'] = 'Site Preferences'; + $location['section'] = 'admin'; + break; + case 'browse.php': + $location['title'] = 'Browse Music'; + $location['section'] = 'browse'; + break; + case 'albums.php': + $location['title'] = 'Albums'; + $location['section'] = 'browse'; + break; + case 'artists.php': + $location['title'] = 'Artists'; + $location['section'] = 'browse'; + break; + case 'genre.php': + $location['title'] = 'Genre'; + $location['section'] = 'browse'; + break; + default: + $location['title'] = ''; + break; + } // switch on raw page location + + return $location; + +} // get_location + ?> diff --git a/localplay.php b/localplay.php index 7edeb3ae..9dda39cc 100644 --- a/localplay.php +++ b/localplay.php @@ -37,7 +37,9 @@ if (conf('demo_mode')) { $web_path = conf('web_path'); if($user->prefs['play_type'] != 'local_play') { - echo "You dont have local play enabled!"; + show_template('header'); + echo "<span align=\"center\" class=\"fatalerror\">Localplay Currently Disabled</span>"; + show_footer(); exit; } diff --git a/modules/init.php b/modules/init.php index 69d3480c..adc87ac6 100644 --- a/modules/init.php +++ b/modules/init.php @@ -83,7 +83,7 @@ if (!$results['conf']['allow_stream_playback']) { } $results['conf']['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['conf']['web_path']; -$results['conf']['version'] = '3.3.2-Alpha4 (Build 002)'; +$results['conf']['version'] = '3.3.2-Alpha4 (Build 003)'; $results['conf']['catalog_file_pattern']= 'mp3|mpc|m4p|m4a|mp4|aac|ogg|rm|wma|asf|flac|spx'; $results['libglue']['local_table'] = 'session'; $results['libglue']['local_sid'] = 'id'; diff --git a/modules/lib.php b/modules/lib.php index 6a825255..162d60e3 100644 --- a/modules/lib.php +++ b/modules/lib.php @@ -125,21 +125,22 @@ function show_genre_pulldown ($genre, $complete, $lines= "'10' multiple='multipl } // show_genre_pulldown() -/* - * show_catalog_pulldown() - * - * Set complete=1 if you want the entire catalog list (including disabled) +/** + * show_catalog_pulldown + * This has been changed, first is the name of the + * dropdown select, the second is the style to be applied * */ -function show_catalog_pulldown ($catalog, $complete) { - global $settings; +function show_catalog_pulldown ($name='catalog',$style) { + + // find the genres we have in use $sql = "SELECT id,name FROM catalog ORDER BY name"; $db_result = mysql_query($sql, dbh()); - echo "\n<select name=\"catalog\">\n"; + echo "\n<select name=\"" . $name . "\" style=\"" . $style . "\">\n"; echo " <option value=\"-1\" selected=\"selected\">All</option>\n"; @@ -28,15 +28,11 @@ require_once("modules/init.php"); show_template('header'); if (conf('refresh_limit') > 0) { show_template('javascript_refresh'); } -show_menu_items('Local Play'); -show_clear(); if ($user->prefs['play_type'] == 'mpd') { show_mpd_control(); show_mpd_pl(); } -show_clear(); -show_page_footer('Local Play','',$user->prefs['display_menu'] ); - +show_footer(); ?> diff --git a/play/index.php b/play/index.php index b869901a..05d04d63 100644 --- a/play/index.php +++ b/play/index.php @@ -206,7 +206,10 @@ else { if ($user->prefs['play_type'] == 'downsample' || !$song->native_stream()) { - $fp = start_downsample($song,$lastid,$song_name); + $results = start_downsample($song,$lastid,$song_name); + + $fp = $results['handle']; + $song->size = $results['size']; } // end if downsampling diff --git a/playlist.php b/playlist.php index 9855f8c6..fd59a550 100644 --- a/playlist.php +++ b/playlist.php @@ -97,11 +97,6 @@ switch ($action) { show_template('header'); -show_menu_items('Playlists'); - -show_playlist_menu(); - - $playlist = new Playlist($playlist_id); if ( isset($playlist_id) && ($playlist_id != 0) && $_REQUEST['action'] != 'delete_playlist' ) { @@ -229,13 +224,12 @@ switch($action) { default: show_playlists(); -} //switch($action) +} //switch on action -echo "<br /><br />"; -show_page_footer ('Playlists', '',$user->prefs['display_menu']); +show_footer(); /* Function definitions for this file */ - +/* GET THIS OUTTA HERE!!!! FIXME */ /*************************/ function pl_update_selected() { diff --git a/preferences.php b/preferences.php index 732805d4..b43a52d4 100644 --- a/preferences.php +++ b/preferences.php @@ -55,8 +55,6 @@ else { // HEADER show_template('header'); -show_menu_items('Preferences'); -show_clear(); // HEADER // Set Target @@ -67,5 +65,5 @@ require (conf('prefix') . "/templates/show_preferences.inc"); // FOOTER -show_page_footer ('Preferences', '',$user->prefs['display_menu']); +show_footer(); ?> diff --git a/randomplay.php b/randomplay.php index 05a8c971..b6e76c8f 100644 --- a/randomplay.php +++ b/randomplay.php @@ -28,8 +28,6 @@ require_once("modules/init.php"); show_template('header'); init_mpd(); -show_menu_items('Home'); -show_clear(); $action = scrub_in($_REQUEST['action']); if (conf('refresh_interval')) { @@ -125,4 +123,4 @@ function show_random_play() { </td></tr> </table> -<?php show_page_footer ('Home', '', $user->prefs['display_menu']);?> +<?php show_footer(); ?> @@ -28,8 +28,6 @@ require_once("modules/init.php"); show_template('header'); -show_menu_items('Search'); -show_clear(); /* Import/Clean vars */ $action = scrub_in($_REQUEST['action']); @@ -43,6 +41,11 @@ switch ($action) { $string_name = $_REQUEST['search_object'][0] . '_string'; $_REQUEST[$string_name] = $_REQUEST['search_string']; unset($string_name); + if (strlen($_REQUEST['search_string']) < 1) { + $GLOBALS['error']->add_error('keyword',_("Error: No Keyword Entered")); + show_template('show_search'); + break; + } case 'search': show_template('show_search'); $results = run_search($_REQUEST); @@ -58,6 +61,6 @@ switch ($action) { break; } -show_clear(); -show_page_footer ('Search', '',$user->prefs['display_menu']); +/* Show the Footer */ +show_footer(); ?> 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> </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']; ?>&keep_view=true&sort_type=username&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']; ?>&keep_view=true&sort_type=fullname&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']; ?>&keep_view=true&sort_type=username&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> diff --git a/themes/classic/images/ampache.gif b/themes/classic/images/ampache.gif Binary files differindex fb110191..3e54f9ce 100755 --- a/themes/classic/images/ampache.gif +++ b/themes/classic/images/ampache.gif @@ -38,8 +38,6 @@ require_once( "modules/init.php" ); // Set page header show_template('header'); -show_menu_items('Upload'); -show_clear(); // Access Control if(!$user->prefs['upload'] || conf('demo_mode')) { @@ -225,7 +223,6 @@ if( $status ) { print( "</table>\n" ); } // end if any messages -show_clear(); -show_page_footer ('Upload', '',$user->prefs['display_menu']); - +/* Show the Page Footer */ +show_footer(); ?> |