diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-06-09 16:34:40 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-06-09 16:34:40 +0000 |
commit | bcad40a05ab2dc2a341a3227e30b96668bce4500 (patch) | |
tree | 6fca27588d53a1b24705bd2834e9e643bb729bd1 /templates/show_songs.inc | |
download | ampache-bcad40a05ab2dc2a341a3227e30b96668bce4500.tar.gz ampache-bcad40a05ab2dc2a341a3227e30b96668bce4500.tar.bz2 ampache-bcad40a05ab2dc2a341a3227e30b96668bce4500.zip |
New Import
Diffstat (limited to 'templates/show_songs.inc')
-rw-r--r-- | templates/show_songs.inc | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/templates/show_songs.inc b/templates/show_songs.inc new file mode 100644 index 00000000..13819f3e --- /dev/null +++ b/templates/show_songs.inc @@ -0,0 +1,150 @@ +<?php +/* + + Copyright (c) 2001 - 2005 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. + +*/ +$web_path = conf('web_path'); +?> + + +<form name="songs" method="post" enctype="multipart/form-data"> +<table border="0"> + <tr><td colspan="2"> + <table class="border" cellspacing="0" cellpadding="0" border="0"> + <tr class="table-header"> + <th> <a href="#" onclick="check_songs(); return false;">Select</a></th> + <?php if (isset($playlist_id) && $playlist_id != 0 && ($user->id == $pluser->id || $user->has_access('100'))) { $tab = 1; ?> <th><?php echo _("Track"); ?></th> <?php } ?> + <th><?php echo _("Song title"); ?></th> + <th><?php echo _("Artist"); ?></th> + <th><?php echo _("Album"); ?></th> + <th><?php echo _("Track"); ?></td> + <th><?php echo _("Time"); ?></th> + <th><?php echo _("Size"); ?></th> + <th><?php echo _("Bitrate"); ?></th> + <th><?php echo _("Genre"); ?></th> + <th><?php echo _("Flag"); ?></th> + <th><?php echo _("Action"); ?></th> + </tr> + <?php + foreach ($song_ids as $song_id) { + + unset($text_class); + $song = new Song($song_id); + $song->format_song(); + + // Still needed crap + $totalsize += $song->size; + $totaltime += $song->time; + if ($song->status == "disabled") { $text_class = "class=\"disabled\""; } + ?> + <tr class="<?php echo flip_class(); ?>"> + <td align="center"> + <input type="checkbox" name="song[]" value="<?php echo $song->id; ?>" id="song_<?php echo $song->id; ?>"></input> + </td> + <?php + if (isset($playlist_id) && $playlist_id != 0 && ($user->id == $pluser->id || $user->has_access('100'))) { + $tracknum = get_playlist_track_from_song($playlist_id, $song->id); + ?> + <td> + <input type="text" tabindex="<?php echo $tab; ?>" size="3" name="<?php echo "tr_" . $song->id; ?>" value="<?php echo $tracknum ?>" onchange="<?php echo "document.getElementById('song_" . $song->id . "').checked='checked';"; ?>" /> + </td> + <?php + $tab++; + } + ?> + <td> + <a href="<?php echo $web_path; ?>/song.php?action=m3u&song=<?php echo $song->id; ?>" title="<?php echo $song->title; ?>" <?php echo $text_class; ?>> <?php echo $song->f_title; ?> </a> + </td> + <td> + <a href="<?php echo $web_path; ?>/artists.php?action=show&artist=<?php echo $song->artist; ?>" title="<?php echo $song->f_artist_full; ?>" <?php echo $text_class; ?>> <?php echo $song->f_artist; ?> </a> + </td> + <td> + <a href="<?php echo $web_path; ?>/albums.php?album=<?php echo $song->album; ?>" title="<?php echo $song->f_album_full; ?>" <?php echo $text_class; ?>> <?php echo $song->f_album; ?> </a> + </td> + <td align="right"> + <?php echo $song->track; ?> + </td> + <td align="right"> + <?php echo $song->f_time; ?> + </td> + <td align="right" nowrap> + <?php echo $song->f_size; ?> MB + </td> + <td align="right"> + <?php echo $song->f_bitrate; ?> + </td> + <td> + <?php echo $song->f_genre; ?> + </td> + <td <?php echo $song->f_style; ?> title="<?php echo $song->flagcomment; ?>"> + <?php echo $song->flagtype; ?> + </td> + <td> + <?php if ($user->has_access('100')) { ?> + <a href="<?php echo $web_path; ?>/admin/song.php?action=edit&song=<?php echo $song->id; ?>">Edit</a> | <a href="<?php echo $web_path; ?>/flag.php?song=<?php echo $song->id; ?>&action=flag">Flag</a> | + <?php if ($song->status === 'enabled') { ?> + <a href="<?php echo $web_path; ?>/admin/song.php?action=disable&song_ids=<?php echo $song->id; ?>">Disable</a> + <?php } else { ?> + <a href="<?php echo $web_path; ?>/admin/song.php?action=enabled&song_ids=<?php echo $song->id; ?>">Enable</a> + <?php } //status ?> + <?php } else { ?> + <a href="<?php echo $web_path; ?>/flag.php?song=<?php echo $song->id; ?>&action=flag">Flag</a> + <?php } //access ?> + <?php if ($user->prefs['download']) { ?> + | <a href="<?php echo $web_path; ?>/download/index.php?action=download&song_id=<?php echo $song->id; ?>&fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Download"); ?></a> + <?php } ?> + <?php if ($user->prefs['direct_link']) { ?> + | <a href="<?php echo $web_path; ?>/play/index.php?song=<?php echo $song->id; ?>&uid=<?php echo $user->id . "&sid=" . session_id(); ?>&fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"> + <?php echo _("Direct Link"); ?> + <?php } ?> + </a> + </td> + </tr> + <? + }// foreach loop + + // + // Another here doc + // + $time = floor($totaltime/60) . ":" . sprintf("%02d", ($totaltime%60) ); + $megs = sprintf("%.2f", ($totalsize/1048576)); + $num = count($song_ids); + + ?> + <tr class="table-header"> + <td></td> + <?php if (isset($playlist_id) && $playlist_id != 0 && ($user->id == $pluser->id || $user->access === 'admin')) { ?> <td></td> <?php } ?> + <td><?php echo _("Total"); ?>:</td> + <td nowrap><?php echo $num; ?> song(s)</td> + <td></td> + <td></td> + <td align="right" nowrap><?php echo $time; ?></td> + <td align="right" nowrap><?php echo $megs; ?> MB</td> + <td></td> + <td></td> + <td></td> + <td colspan="2"></td> + </tr> + </table> +</td></tr> +</table> +<br /> +<?php show_play_selected(); ?> +</form> + |