summaryrefslogtreecommitdiffstats
path: root/templates/show_duplicates.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'templates/show_duplicates.inc.php')
-rw-r--r--templates/show_duplicates.inc.php94
1 files changed, 63 insertions, 31 deletions
diff --git a/templates/show_duplicates.inc.php b/templates/show_duplicates.inc.php
index 731016ad..f93bbf83 100644
--- a/templates/show_duplicates.inc.php
+++ b/templates/show_duplicates.inc.php
@@ -1,13 +1,12 @@
<?php
/*
- Copyright (c) 2001 - 2005 Ampache.org
+ Copyright (c) 2001 - 2007 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.
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,35 +18,68 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
-$web_path = conf('web_path');
?>
-<?php show_box_top(_('Find Duplicates')); ?>
-<form name="duplicates" action="<?php echo conf('web_path'); ?>/admin/duplicates.php" method="post" enctype="multipart/form-data" >
-<table cellspacing="0" cellpadding="3" width="450">
- <tr>
- <td valign="top"><?php echo _('Search Type'); ?>:</td>
- <td>
- <?php
- $name = 'check_' . $_REQUEST['search_type'];
- ${$name} = ' checked="checked" ';
+<?php show_box_top(_('Duplicate Songs')); ?>
+<form method="post" enctype="multipart/form-data" action="<?php echo $web_path; ?>/admin/flag.php?action=disable">
+<table class="tabledata" cellpadding="0" cellspacing="0">
+<colgroup>
+ <col id="col_disable" />
+ <col id="col_song" />
+ <col id="col_artist" />
+ <col id="col_album" />
+ <col id="col_length" />
+ <col id="col_bitrate" />
+ <col id="col_size" />
+ <col id="col_filename" />
+</colgroup>
+<tr class="th-top">
+ <th class="cel_disable"><?php echo _('Disable'); ?></th>
+ <th class="cel_song"><?php echo _('Song'); ?></th>
+ <th class="cel_artist"><?php echo _('Artist'); ?></th>
+ <th class="cel_album"><?php echo _('Album'); ?></th>
+ <th class="cel_length"><?php echo _('Length'); ?></th>
+ <th class="cel_bitrate"><?php echo _('Bitrate'); ?></th>
+ <th class="cel_size"><?php echo _('Size'); ?></th>
+ <th class="cel_filename"><?php echo _('Filename'); ?></th>
+</tr>
+<?php
+ foreach ($duplicates as $item) {
+ // Gather the duplicates
+ $songs = Catalog::get_duplicate_info($item,$search_type);
+
+ foreach ($songs as $key=>$song_id) {
+ $song = new Song($song_id);
+ $song->format();
+ $row_key = 'duplicate_' . $song_id;
+ $current_class = ($key == '0') ? 'row-highlight' : flip_class();
+ $button = $song->enabled ? 'disable' : 'enable';
?>
- <input type="radio" name="search_type" value="title"<?php echo $check_title; ?>/><?php echo _('Title'); ?><br />
- <input type="radio" name="search_type" value="artist_title"<?php echo $check_artist_title; ?>/><?php echo _('Artist and Title'); ?><br />
- <input type="radio" name="search_type" value="artist_album_title"<?php echo $check_artist_album_title; ?>/><?php echo _('Artist, Album and Title'); ?><br />
- </td>
- </tr>
- <tr>
- <td>&nbsp;</td>
- <td>
- <?php if ($_REQUEST['auto']) { $auto_check = ' checked="checked"'; } ?>
- <input type="checkbox" name="auto" value="1" <?php echo $auto_check; ?>/><?php echo _('Select Best Guess'); ?>
- </td>
- </tr>
+<tr id="<?php echo $row_key; ?>" class="<?php echo $current_class; ?>">
+ <td class="cel_disable">
+ <?php echo Ajax::button('?page=song&action=flip_state&song_id=' . $song_id,$button,_(ucfirst($button)),'flip_state_' . $song_id); ?>
+ </td>
+ <td class="cel_song"><?php echo $song->f_link; ?></td>
+ <td class="cel_artist"><?php echo $song->f_artist_link; ?></td>
+ <td class="cel_album"><?php echo $song->f_album_link; ?></td>
+ <td class="cel_length"><?php echo $song->f_time; ?></td>
+ <td class="cel_bitrate"><?php echo $song->f_bitrate; ?></td>
+ <td class="cel_size"><?php echo $song->f_size; ?>MB</td>
+ <td class="cel_filename"><?php echo scrub_out($song->file); ?></td>
+</tr>
+<?php
+ } // end foreach ($dinfolist as $dinfo)
+ } // end foreach ($flags as $flag)
+?>
+<tr class="th-bottom">
+ <th class="cel_disable"><?php echo _('Disable'); ?></th>
+ <th class="cel_song"><?php echo _('Song'); ?></th>
+ <th class="cel_artist"><?php echo _('Artist'); ?></th>
+ <th class="cel_album"><?php echo _('Album'); ?></th>
+ <th class="cel_length"><?php echo _('Length'); ?></th>
+ <th class="cel_bitrate"><?php echo _('Bitrate'); ?></th>
+ <th class="cel_size"><?php echo _('Size'); ?></th>
+ <th class="cel_filename"><?php echo _('Filename'); ?></th>
+</tr>
</table>
-<div class="formValidation">
- <input type="hidden" name="action" value="search" />
- <input type="submit" value="<?php echo _('Search'); ?>" />
-</div>
</form>
<?php show_box_bottom(); ?>