From 78164aefef355b07df4b28f913f38fc0b0473508 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Thu, 23 Mar 2006 02:05:38 +0000 Subject: more interface tweaks, and a bunch of log_event cleanup --- lib/class/album.class.php | 10 ++---- lib/class/catalog.class.php | 25 ++++++-------- templates/basestyle.inc.php | 4 ++- templates/show_admin_tools.inc.php | 14 ++++---- templates/show_artist.inc | 14 ++++---- templates/show_artist_box.inc.php | 16 ++++----- templates/show_play_selected.inc.php | 66 +++++++++++------------------------- templates/show_playlist_box.inc.php | 14 ++++---- templates/show_playlists.inc.php | 9 +++-- 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 "" . _("Error: Unable to open") . " $dir
\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. . .
\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 "" . _("Error unable to open file for writting") . " [$file]
\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 "" . _("Error") . ": " . _("Unable to load XMLRPC library, make sure XML-RPC is enabled") . "
\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 "

$error_msg

"; 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 "

$error_msg

"; } 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 ; border-top:2px solid ; } - .text-action { + .text-action, .text-action li { margin-top:5px; + list-style: none; margin-bottom:5px; + padding-left:0px; } .text-action a { background: ; 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();
- - -
- - - + + @@ -69,7 +65,11 @@ $catalogs = Catalog::get_catalogs();       -  + 
+ + + +

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');
- +
- - - - - + + + + + -
-    +   
- - - -
- full_name; ?> -
id, 'artist'); } // end if ratings ?>
-
+
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 @@ */ ?> - - + - + - + - +
- " onclick="return ToSong('play_selected');" /> - -    - " onclick="return ToBatch('download_selected');" /> - - - + + +    + + +
- - " onclick="return ToPlaylist('set_track_numbers');" /> - " onclick="return ToPlaylist('remove_song');" /> - + + + +
- : " onclick="return ToPlaylist('add_to');" /> - - " onclick="return ToPlaylist('view');" /> - " onclick="return ToPlaylist('edit');" /> - + : + + + +
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']);
-     
-     
-     
+ 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) { | - | - | + + | + + + + + 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 } ?> - + -- cgit
  Select