diff options
-rw-r--r-- | lib/class/album.class.php | 10 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 25 | ||||
-rw-r--r-- | templates/basestyle.inc.php | 4 | ||||
-rw-r--r-- | templates/show_admin_tools.inc.php | 14 | ||||
-rw-r--r-- | templates/show_artist.inc | 14 | ||||
-rw-r--r-- | templates/show_artist_box.inc.php | 16 | ||||
-rw-r--r-- | templates/show_play_selected.inc.php | 66 | ||||
-rw-r--r-- | templates/show_playlist_box.inc.php | 14 | ||||
-rw-r--r-- | templates/show_playlists.inc.php | 9 | ||||
-rw-r--r-- | templates/show_songs.inc | 2 |
10 files changed, 72 insertions, 102 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php index 5e8ea565..50d7d490 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -261,7 +261,7 @@ class Album { if (!is_resource($handle)) { echo "<font class=\"error\">" . _("Error: Unable to open") . " $dir</font><br />\n"; - if (conf('debug')) { log_event($GLOBALS['user']->username,'read',"Error: Unable to open $dir for album art read"); } + debug_event('read',"Error: Unable to open $dir for album art read",'2'); } /* Recurse through this dir and create the files array */ @@ -458,9 +458,7 @@ class Album { do { $search_results = array_merge($search_results, $amazon->search(array('artist' => $artist, 'album' => $albumname, 'keywords' => $keywords))); $pages_to_search = min($max_pages_to_search, $amazon->_maxPage); - if(conf('debug')){ - log_event($GLOBALS['user']->username,'amazon-xml', "Searched results page " . ($amazon->_currentPage+1) . "/" . $pages_to_search); - } + debug_event('amazon-xml', "Searched results page " . ($amazon->_currentPage+1) . "/" . $pages_to_search,'5'); $amazon->_currentPage++; } while($amazon->_currentPage < $pages_to_search); @@ -470,9 +468,7 @@ class Album { } /* Log this if we're doin debug */ - if (conf('debug')) { - log_event($GLOBALS['user']->username,'amazon-xml',"Searched using $keywords with " . conf('amazon_developer_key') . " as key " . count($final_results) . " results found"); - } + debug_event('amazon-xml',"Searched using $keywords with " . conf('amazon_developer_key') . " as key " . count($final_results) . " results found",'5'); } // end foreach } // if no cover diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 5faa77ce..55630719 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -263,13 +263,10 @@ class Catalog { if(!$this->check_local_mp3($filename,$gather_type)) { $this->insert_local_song($filename,$file_size); } - elseif (conf('debug')) { - log_event($GLOBALS['user']->username, 'add_file', "Error: File exists",'ampache-catalog'); - } + debug_event('add_file', "Error: File exists",'2','ampache-catalog'); } // if valid file - elseif (conf('debug')) { - log_event($GLOBALS['user']->username, 'add_file', "Error: File doesn't match pattern",'ampache-catalog'); - } + + debug_event('add_file', "Error: File doesn't match pattern",'2','ampache-catalog'); } // add_file @@ -673,12 +670,12 @@ class Catalog { echo _("Written") . " $i. . . <br />\n"; flush(); } //echos song count - if (conf('debug')) { log_event($_SESSION['userdata']['username'],'art_write',"$album->name Art written to $file"); } + debug_event('art_write',"$album->name Art written to $file",'5'); } fclose($file_handle); } // end if fopen else { - if (conf('debug')) { log_event($_SESSION['userdata']['username'],'art_write',"Unable to open $file for writting"); } + debug_event('art_write',"Unable to open $file for writting",'5'); echo "<font class=\"error\">" . _("Error unable to open file for writting") . " [$file] </font><br />\n"; } @@ -868,7 +865,7 @@ class Catalog { function update_song_from_tags($song) { - if (conf('debug')) { log_event($_SESSION['userdata']['username'],' tag-read ',"Reading Tags from $song->file",'ampache-catalog'); } + debug_event('tag-read',"Reading Tags from $song->file",'5','ampache-catalog'); $info = new Audioinfo(); $results = $info->Info($song->file); @@ -916,11 +913,11 @@ class Catalog { $info = $song->compare_song_information($song,$new_song); if ($info['change']) { - if (conf('debug')) { log_event($_SESSION['userdata']['username'],' update ',"$song->file difference found, updating database",'ampache-catalog'); } + debug_event('update',"$song->file difference found, updating database",'5','ampache-catalog'); $song->update_song($song->id,$new_song); } else { - if (conf('debug')) { log_event($_SESSION['userdata']['username'],' update ',"$song->file no difference found returning",'ampache-catalog'); } + debug_event('update',"$song->file no difference found returning",'5','ampache-catalog'); } return $info; @@ -1008,7 +1005,7 @@ class Catalog { /* Make sure the xmlrpc lib is loaded */ if (!class_exists('xmlrpc_client')) { - if (conf('debug')) { log_event($_SESSION['userdata']['username'],'xmlrpc',"Unable to load XMLRPC library"); } + debug_event('xmlrpc',"Unable to load XMLRPC library",'1'); echo "<font class=\"error\"><b>" . _("Error") . "</b>: " . _("Unable to load XMLRPC library, make sure XML-RPC is enabled") . "<br />\n"; return false; } // end check for class @@ -1049,7 +1046,7 @@ class Catalog { } // if we didn't get an error else { $error_msg = _("Error connecting to") . " " . $server . " " . _("Code") . ": " . $response->faultCode() . " " . _("Reason") . ": " . $response->faultString(); - if (conf('debug')) { log_event($_SESSION['userdata']['username'],' xmlrpc-client ',$error_msg,'ampache-catalog'); } + debug_event('xmlrpc-client',$error_msg,'1','ampache-catalog'); echo "<p class=\"error\">$error_msg</p>"; return; } @@ -1100,7 +1097,7 @@ class Catalog { } else { $error_msg = _("Error connecting to") . " " . $server . " " . _("Code") . ": " . $response->faultCode() . " " . _("Reason") . ": " . $response->faultString(); - if (conf('debug')) { log_event($_SESSION['userdata']['username'],' xmlrpc-client ',$error_msg,'ampache-catalog'); } + debug_event('xmlrpc-client',$error_msg,'1','ampache-catalog'); echo "<p class=\"error\">$error_msg</p>"; } diff --git a/templates/basestyle.inc.php b/templates/basestyle.inc.php index ff8dc0f2..8e2f49e1 100644 --- a/templates/basestyle.inc.php +++ b/templates/basestyle.inc.php @@ -260,9 +260,11 @@ border-left:2px solid <?php echo conf('bg_color2'); ?>; border-top:2px solid <?php echo conf('bg_color2'); ?>; } - .text-action { + .text-action, .text-action li { margin-top:5px; + list-style: none; margin-bottom:5px; + padding-left:0px; } .text-action a { background: <?php echo conf('base_color2'); ?>; diff --git a/templates/show_admin_tools.inc.php b/templates/show_admin_tools.inc.php index 9f74394c..94a33932 100644 --- a/templates/show_admin_tools.inc.php +++ b/templates/show_admin_tools.inc.php @@ -26,15 +26,11 @@ $catalogs = Catalog::get_catalogs(); <span class="header1"><?php echo _('Catalogs'); ?></span> <div class="text-box"> <div class="text-action"> -<a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_add_catalog"><?php echo _('Add a Catalog'); ?></a> -<a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_clear_stats"><?php echo _('Clear Catalog Stats'); ?></a> -<a href="<?php echo $web_path; ?>/admin/catalog.php?action=gather_album_art"><?php echo _('Gather Album Art'); ?></a> </div> -<!-- Current Catalogs --> <table border="0" cellpadding="0" cellspacing="0"> <tr class="table-header"> - <td><?php echo _('Name'); ?></td> - <td align="center"><?php echo _('Action'); ?></td> + <th><?php echo _('Name'); ?></th> + <th align="center"><?php echo _('Action'); ?></th> </tr> <?php foreach ($catalogs as $catalog) { ?> <tr class="<?php echo flip_class(); ?>"> @@ -69,7 +65,11 @@ $catalogs = Catalog::get_catalogs(); <a href="<?php echo $web_path; ?>/admin/catalog.php?action=clean_all_catalogs"><?php echo _('Clean All'); ?></a> <a href="<?php echo $web_path; ?>/admin/catalog.php?action=update_all_catalogs"><?php echo _('Verify All'); ?></a> <a href="<?php echo $web_path; ?>/admin/catalog.php?action=add_to_all_catalogs"><?php echo _('Add to All'); ?></a> -<a href="<?php echo $web_path; ?>/admin/catalog.php?action=full_service"><?php echo _('Update All'); ?></a> +<a href="<?php echo $web_path; ?>/admin/catalog.php?action=full_service"><?php echo _('Update All'); ?></a> <hr height="5px" /> +<a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_add_catalog"><?php echo _('Add a Catalog'); ?></a> +<a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_clear_stats"><?php echo _('Clear Catalog Stats'); ?></a> +<a href="<?php echo $web_path; ?>/admin/catalog.php?action=gather_album_art"><?php echo _('Gather Album Art'); ?></a> + </div> </div><br /> <span class="header1"><?php echo _('Other Tools'); ?></span><br /> diff --git a/templates/show_artist.inc b/templates/show_artist.inc index 2c6b4364..bd8a6e31 100644 --- a/templates/show_artist.inc +++ b/templates/show_artist.inc @@ -29,17 +29,17 @@ $web_path = conf('web_path'); <?php require (conf('prefix') . '/templates/show_artist_box.inc.php'); ?> <!-- *** Multi-Album Art Display Thx MrBlahh Updated by clader *** --> <br /> -<form name="songs" method="post" enctype="multipart/form-data" action="artists.php"> +<form id="songs" method="post" enctype="multipart/form-data" action="artists.php"> <table class="border" cellspacing="0" cellpadding="0" border="0"> <tr class="table-header"> <th align="center"> - <a href="#" onclick="check_songs(); return false;"><?php echo _("Select"); ?></a> + <a href="#" onclick="check_songs(); return false;"><?php echo _('Select'); ?></a> </th> - <th><?php echo _("Cover"); ?></th> - <th><?php echo _("Album Name"); ?></th> - <th><?php echo _("Album Year"); ?></th> - <th><?php echo _("Total Tracks"); ?></th> - <th><?php echo _("Action"); ?></th> + <th><?php echo _('Cover'); ?></th> + <th><?php echo _('Album Name'); ?></th> + <th><?php echo _('Album Year'); ?></th> + <th><?php echo _('Total Tracks'); ?></th> + <th><?php echo _('Action'); ?></th> </tr> <?php foreach ($albums as $album) { diff --git a/templates/show_artist_box.inc.php b/templates/show_artist_box.inc.php index 8c9779f4..fdbedc82 100644 --- a/templates/show_artist_box.inc.php +++ b/templates/show_artist_box.inc.php @@ -21,21 +21,17 @@ */ $web_path = conf('web_path'); ?> -<table class="text-box"> -<tr> - <td> - <span class="header1"><?php echo _("Albums by") . " " . $artist->full_name; ?></span> - <br /><?php if (conf('ratings')) { show_rating($artist->id, 'artist'); } // end if ratings ?><br /> - <ul> +<div class="text-box"> + <span class="header1"><?php echo _('Albums by') . " " . $artist->full_name; ?></span> + <br /><?php if (conf('ratings')) { show_rating($artist->id, 'artist'); } // end if ratings ?> + <ul class="text-action"> <li><a href="<?php echo $web_path; ?>/artists.php?action=show_all_songs&artist=<?php echo $artist_id; ?>"><?php echo _("Show All Songs By") . " " . $artist->full_name; ?></a></li> <li><a href="<?php echo $web_path; ?>/song.php?action=m3u&artist=<?php echo $artist_id; ?>"><?php echo _("Play All Songs By") . " " . $artist->full_name; ?></a></li> <li><a href="<?php echo $web_path; ?>/song.php?action=m3u&artist_random=<?php echo $artist_id; ?>"><?php echo _("Play Random Songs By") . " " . $artist->full_name; ?></a></li> - <?php if ($user->has_access('100')) { ?> + <?php if ($GLOBALS['user']->has_access('100')) { ?> <li><a href="<?php echo $web_path; ?>/artists.php?action=update_from_tags&artist=<?php echo $artist_id; ?>"><?php echo _("Update from tags"); ?></a></li> <li><a href="<?php echo $web_path; ?>/artists.php?action=show_rename&artist=<?php echo $artist_id; ?>"><?php echo _("Rename Artist"); ?></a></li> <li><a href="<?php echo $web_path; ?>/artists.php?action=show_similar&artist=<?php echo $artist_id; ?>"><?php echo _("Find duplicate artists"); ?></a></li> <?php } ?> </ul> - </td> -</tr> -</table> +</div> diff --git a/templates/show_play_selected.inc.php b/templates/show_play_selected.inc.php index 5b5bd334..53cc42d4 100644 --- a/templates/show_play_selected.inc.php +++ b/templates/show_play_selected.inc.php @@ -20,61 +20,33 @@ */ ?> -<script type="text/javascript" language="javascript"> -<!-- -function ToPlaylist(action) -{ - document.songs.action = "<?php echo conf('web_path'); ?>/playlist.php?action=" + action; - document.songs.submit(); // Submit the page - return true; -} - -function ToSong(action) -{ - document.songs.action = "<?php echo conf('web_path'); ?>/song.php?action=" + action; - document.songs.submit(); // Submit the page - return true; -} -function ToBatch(action) -{ - document.songs.action = "<?php echo conf('web_path'); ?>/batch.php?action=" + action; - document.songs.submit(); - return true; -} ---> -</script> <table border="0" cellpadding="14" cellspacing="0" class="text-box"> <tr align="left"> - <td> - <input class="button" type="button" name="super_action" value="<?php echo _("Play Selected"); ?>" onclick="return ToSong('play_selected');" /> - <?php if (batch_ok()) { ?> - - <input class="button" type="button" name="super_action" value="<?php echo _("Download Selected"); ?>" onclick="return ToBatch('download_selected');" /> - <?php } ?> -<!-- - <input class="button" type="button" name="super_action" value="<?php echo _("Flag Selected"); ?>" /> - <input class="button" type="button" name="super_action" value="<?php echo _("Edit Selected"); ?>" /> ---> - </td> +<td> + <input class="button" type="button" value="<?php echo _('Play Selected'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/song.php?action=play_selected');" /> + <?php if (batch_ok()) { ?> + + <input class="button" type="button" value="<?php echo _('Download Selected'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/batch.php?action=download_selected');" /> + <?php } ?> +</td> </tr> <?php if (is_object($GLOBALS['playlist'])) { ?> <tr> - <td> - <input type="hidden" name="playlist_id" value="<?php echo $GLOBALS['playlist']->id; ?>" /> - <input class="button" type="button" name="super_action" value="<?php echo _("Set Track Numbers"); ?>" onclick="return ToPlaylist('set_track_numbers');" /> - <input class="button" type="button" name="super_action" value="<?php echo _("Remove Selected Tracks"); ?>" onclick="return ToPlaylist('remove_song');" /> - </td> +<td> + <input type="hidden" name="playlist_id" value="<?php echo $GLOBALS['playlist']->id; ?>" /> + <input class="button" type="button" value="<?php echo _('Set Track Numbers'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/playlist.php?action=set_track_numbers');" /> + <input class="button" type="button" value="<?php echo _('Remove Selected Tracks'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/playlist.php?action=remove_song');" /> +</td> </tr> -<?php -} else { ?> +<?php } else { ?> <tr align="center"> - <td colspan="2"> - <?php echo _("Playlist"); ?>: <input type="button" name="super_action" value="<?php echo _("Add to"); ?>" onclick="return ToPlaylist('add_to');" /> - <?php show_playlist_dropdown($GLOBALS['playlist_id']); ?> - <input class="button" type="button" name="super_action" value="<?php echo _("View"); ?>" onclick="return ToPlaylist('view');" /> - <input class="button" type="button" name="super_action" value="<?php echo _("Edit"); ?>" onclick="return ToPlaylist('edit');" /> - </td> +<td colspan="2"> + <?php echo _('Playlist'); ?>: <input type="button" value="<?php echo _('Add to'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/playlist.php?action=add_to');" /> + <?php show_playlist_dropdown($GLOBALS['playlist_id']); ?> + <input class="button" type="button" value="<?php echo _('View'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/playlist.php?action=view');" /> + <input class="button" type="button" value="<?php echo _('Edit'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/playlist.php?action=edit');" /> +</td> </tr> <?php } ?> </table> diff --git a/templates/show_playlist_box.inc.php b/templates/show_playlist_box.inc.php index d010bc34..6e595743 100644 --- a/templates/show_playlist_box.inc.php +++ b/templates/show_playlist_box.inc.php @@ -33,14 +33,16 @@ $playlist_id = scrub_out($_REQUEST['playlist_id']); <tr> <td> <span class="header1"><?php echo _('Playlist Actions'); ?></span><br /> - <a href="<?php echo $web_path; ?>/playlist.php?action=new"><?php echo _('Create New Playlist'); ?></a><br /> - <a href="<?php echo $web_path; ?>/playlist.php"><?php echo _('View All Playlists'); ?></a><br /> - <a href="<?php echo $web_path; ?>/playlist.php?action=show_import_playlist"><?php echo _('Import From File'); ?></a><br /> + <ul class="text-action"> + <li><a href="<?php echo $web_path; ?>/playlist.php?action=new"><?php echo _('Create New Playlist'); ?></a></li> + <li><a href="<?php echo $web_path; ?>/playlist.php"><?php echo _('View All Playlists'); ?></a></li> + <li><a href="<?php echo $web_path; ?>/playlist.php?action=show_import_playlist"><?php echo _('Import From File'); ?></a></li> <?php if ($_REQUEST['playlist_id']) { ?> - <a href="<?php echo $web_path; ?>/playlist.php?action=normalize_tracks&playlist_id=<?php echo $playlist_id; ?>"><?php echo _('Normalize Tracks'); ?></a><br /> - <a href="<?php echo $web_path; ?>/song.php?action=play_selected&playlist_id=<?php echo $playlist_id; ?>"><?php echo _('Play This Playlist'); ?></a><br /> - <a href="<?php echo $web_path; ?>/playlist.php?action=show_delete_playlist&playlist_id=<?php echo $playlist_id; ?>"><?php echo _('Delete This Playlist'); ?></a><br /> + <li><a href="<?php echo $web_path; ?>/playlist.php?action=normalize_tracks&playlist_id=<?php echo $playlist_id; ?>"><?php echo _('Normalize Tracks'); ?></a></li> + <li><a href="<?php echo $web_path; ?>/song.php?action=play_selected&playlist_id=<?php echo $playlist_id; ?>"><?php echo _('Play This Playlist'); ?></a></li> + <li><a href="<?php echo $web_path; ?>/playlist.php?action=show_delete_playlist&playlist_id=<?php echo $playlist_id; ?>"><?php echo _('Delete This Playlist'); ?></a></li> <?php } ?> + </ul> </td> </tr> </table><!-- End Playlist Table --> diff --git a/templates/show_playlists.inc.php b/templates/show_playlists.inc.php index 9c251b8b..c8feb382 100644 --- a/templates/show_playlists.inc.php +++ b/templates/show_playlists.inc.php @@ -66,14 +66,19 @@ foreach ($playlists as $playlist) { | <a href="<?php echo $web_path; ?>/song.php?action=playlist_random&playlist_id=<?php echo $playlist->id; ?>"> <?php echo _('Random'); ?> </a> - <?php } ?> <?php if (batch_ok()) { ?> | <a href="<?php echo $web_path; ?>/batch.php?action=pl&id=<?php echo $playlist->id; ?>"> <?php echo _('Download'); ?> </a> <?php } ?> - | + <?php } ?> + | </td> </tr> <?php } // end foreach ($playlists as $playlist) ?> +<?php if (!count($playlists)) { ?> +<tr class="<?php echo flip_class(); ?>"> + <td colspan="4"><?php echo _('No Playlists Found'); ?></td> +</tr> +<?php } ?> </table> <!-- End Playlist Table --> diff --git a/templates/show_songs.inc b/templates/show_songs.inc index 1297d2b3..be31f8da 100644 --- a/templates/show_songs.inc +++ b/templates/show_songs.inc @@ -28,7 +28,7 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G } ?> -<form name="songs" method="post" enctype="multipart/form-data" action="#" style="Display:inline;"> +<form id="songs" method="post" enctype="multipart/form-data" action="#" style="Display:inline;"> <table class="border" cellspacing="0" cellpadding="0" border="0"> <tr class="table-header"> <th> <a href="#" onclick="check_songs(); return false;">Select</a></th> |