Вычищение старых конструкций PHP + многочисленная доводка по мелочи.
[mpd-web.git] / ajax / playlists.php
1 <?php
2
3 include('mpd.php');
4 ?>
5
6 <div id="playlist_menu">
7   <table>
8     <tr>
9       <td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td>
10       <td><span class="button" onclick="confirm('Clear current playlist, are you sure?') ? PlaylistCommandRefStatus('clear') : false;" ><img width="20" src="images/removeall.png"></span><td>
11     </tr>
12   </table>
13 </div>
14
15 <div id="items">
16   <table>
17     <tr id="items_heading">
18       <td></td><td>Название</td><td>Управление</td>
19     </tr>
20 <?php
21
22 $playlists = $mpd->playlists;
23
24 for($i=0;$i<count($playlists);$i++) {
25
26 ?>
27     <tr id="item<?php if($i%2==0) { echo "Even";}else{echo "Odd";}?>">
28       <td id="track_number"><a name="<?php echo $i;?>"></a></td>
29       <td id="file"><span class="button" onclick="PlaylistEditCommandRefFull('load','<?php echo $playlists[$i]['name'];?>')"><?php echo $playlists[$i]['name'];?></td>
30       <td id="controls"><span class="button" onclick="confirm('Delete playlist <?php echo $playlists[$i]['name'];?>, are you sure?') ? DelPlayList('<?php echo $playlists[$i]['name'];?>') : false;"><img width="20" src="images/minus.png"></span></td>
31     </tr>  
32 <?php
33
34 }
35
36 ?>
37
38   </table>
39 </div>
40
41 <div id="playlist_menu">
42   <table>
43     <tr>
44       <td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td>
45       <td><span class="button" onclick="confirm('Clear current playlist, are you sure?') ? PlaylistCommandRefStatus('clear') : false;" ><img width="20" src="images/removeall.png"></span><td>
46     </tr>
47   </table>
48 </div>