From: Roman Bazalevsky <rvb@rvb.name> Date: Thu, 29 Sep 2016 15:33:48 +0000 (+0300) Subject: Вычищение старых конструкций PHP + многочисленная доводка по мелочи. X-Git-Url: https://git.rvb.name/mpd-web.git/commitdiff_plain/refs/heads/master Вычищение старых конструкций PHP + многочисленная доводка по мелочи. --- diff --git a/ajax/editplaylist.php b/ajax/editplaylist.php index a4764c9..31c6697 100644 --- a/ajax/editplaylist.php +++ b/ajax/editplaylist.php @@ -18,7 +18,7 @@ $dir = $_REQUEST['dir']; <table> <tr> <td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td> - <td><span class="button" onclick="return confirm('ÐобавиÑÑ Ð²Ñе. ÐÑ ÑвеÑенÑ?') ? PlaylistEditCommand('addall','<?php echo escapePhpString($dir);?>') : false;" ><img width="20" src="images/addall.png"></span><td> + <td><span class="button" onclick="return confirm('Add all to the list, are you sure?') ? PlaylistEditCommand('addall','<?php echo escapePhpString($dir);?>') : false;" ><img width="20" src="images/addall.png"></span><td> <td><span class="button" onclick="PlaylistEditItemsCommand('addselected','<?php echo escapePhpString($dir);?>')"><img width="20" src="images/addselected.png"></span><td> </tr> </table> @@ -26,7 +26,7 @@ $dir = $_REQUEST['dir']; <div id="items"> <table> <tr id="items_heading"> - <td></td><td>Ðазвание</td><th colspan="2">УпÑавление</th> + <td></td><td>Title</td><th colspan="2">Controls</th> </tr> <?php $dirs=$mpd->GetDir($dir); @@ -65,7 +65,7 @@ $dir = $_REQUEST['dir']; <table> <tr> <td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td> - <td><span class="button" onclick="return confirm('ÐобавиÑÑ Ð²Ñе. ÐÑ ÑвеÑенÑ?') ? PlaylistEditCommand('addall','<?php echo escapePhpString($dir);?>') : false;" ><img width="20" src="images/addall.png"></span><td> + <td><span class="button" onclick="return confirm('Add all to the list, are you sure?') ? PlaylistEditCommand('addall','<?php echo escapePhpString($dir);?>') : false;" ><img width="20" src="images/addall.png"></span><td> <td><span class="button" onclick="PlaylistEditItemsCommand('addselected','<?php echo escapePhpString($dir);?>')"><img width="20" src="images/addselected.png"></span><td> </tr> </table> diff --git a/ajax/mpd.js b/ajax/mpd.js index 3717603..1be85a6 100644 --- a/ajax/mpd.js +++ b/ajax/mpd.js @@ -132,7 +132,7 @@ req.send(); function SavePlayList() { -var name=window.prompt('ÐÐ¼Ñ ÑпиÑка',''); +var name=window.prompt('List name',''); var req = new XMLHttpRequest(); @@ -152,8 +152,6 @@ function DelPlayList(item) { var req = new XMLHttpRequest(); -//if (! window.alert("УдалиÑÑ ÑпиÑок "+item+"?")) return; - req.onreadystatechange = function () { if (this.readyState != 4 || this.status != 200) return; RefreshPageStatus(); diff --git a/ajax/mpd.php b/ajax/mpd.php index 86ea78e..dd4df8e 100644 --- a/ajax/mpd.php +++ b/ajax/mpd.php @@ -7,7 +7,7 @@ include('../system/helper.php'); $mpd = new mpd($mpd_host,$mpd_port,$mpd_password); if($mpd->connected != 1){ - echo "ÐÐµÑ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ ÑеÑвеÑом!"; + echo "Server not available!"; exit(1); } diff --git a/ajax/playlist.php b/ajax/playlist.php index 8050bba..09d06e1 100644 --- a/ajax/playlist.php +++ b/ajax/playlist.php @@ -9,7 +9,7 @@ $playlist= $mpd->playlist; <div id="items"> <table> <tr id="items_heading"> - <td></td><td>Ðазвание</td><th colspan="4">УпÑавление</th> + <td></td><td>Title</td><th colspan="4">Controls</th> </tr> <?php for($i=0;$i<count($playlist);$i++) { diff --git a/ajax/playlists.php b/ajax/playlists.php index 23066cf..91e386e 100644 --- a/ajax/playlists.php +++ b/ajax/playlists.php @@ -7,7 +7,7 @@ include('mpd.php'); <table> <tr> <td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td> - <td><span class="button" onclick="confirm('ÐÑиÑÑиÑÑ ÑпиÑок. ÐÑ ÑвеÑенÑ?') ? PlaylistCommandRefStatus('clear') : false;" ><img width="20" src="images/removeall.png"></span><td> + <td><span class="button" onclick="confirm('Clear current playlist, are you sure?') ? PlaylistCommandRefStatus('clear') : false;" ><img width="20" src="images/removeall.png"></span><td> </tr> </table> </div> @@ -17,7 +17,7 @@ include('mpd.php'); <tr id="items_heading"> <td></td><td>Ðазвание</td><td>УпÑавление</td> </tr> -<? +<?php $playlists = $mpd->playlists; @@ -26,11 +26,13 @@ for($i=0;$i<count($playlists);$i++) { ?> <tr id="item<?php if($i%2==0) { echo "Even";}else{echo "Odd";}?>"> <td id="track_number"><a name="<?php echo $i;?>"></a></td> - <td id="file"><span class="button" onclick="PlaylistEditCommandRefFull('load','<?php echo $playlists[$i]['name'];?>')"><? echo $playlists[$i]['name'];?></td> - <td id="controls"><span class="button" onclick="confirm('УдалиÑÑ ÑпиÑок <?php echo $playlists[$i]['name'];?>. ÐÑ ÑвеÑенÑ?') ? DelPlayList('<?php echo $playlists[$i]['name'];?>') : false;"><img width="20" src="images/minus.png"></span></td> + <td id="file"><span class="button" onclick="PlaylistEditCommandRefFull('load','<?php echo $playlists[$i]['name'];?>')"><?php echo $playlists[$i]['name'];?></td> + <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> </tr> <?php + } + ?> </table> @@ -40,7 +42,7 @@ for($i=0;$i<count($playlists);$i++) { <table> <tr> <td><span class="button" onclick="RefreshPlaylist()"><img width="20" src="images/playlist.png"></span><td> - <td><span class="button" onclick="return confirm('ÐÑиÑÑиÑÑ ÑпиÑок. ÐÑ ÑвеÑенÑ?') ? PlaylistCommand('clear') : false;" ><img width="20" src="images/removeall.png"></span><td> + <td><span class="button" onclick="confirm('Clear current playlist, are you sure?') ? PlaylistCommandRefStatus('clear') : false;" ><img width="20" src="images/removeall.png"></span><td> </tr> </table> </div> diff --git a/ajax/trackinfo.php b/ajax/trackinfo.php index f1c4b36..ef86893 100644 --- a/ajax/trackinfo.php +++ b/ajax/trackinfo.php @@ -20,7 +20,7 @@ if($cur_track !=-1) { } else { echo "<div class=\"trackno\">#-/$playlist_count</div>"; - echo "<div class=\"trackname\">ТÑек не вÑбÑан</div>"; + echo "<div class=\"trackname\">No track selected</div>"; } ?> diff --git a/ajax/trackname.php b/ajax/trackname.php index 49cc01d..d12955b 100644 --- a/ajax/trackname.php +++ b/ajax/trackname.php @@ -18,7 +18,7 @@ if($cur_track !=-1) { } } else { - echo "ТÑек не вÑбÑан"; + echo "No track selected"; } ?> diff --git a/config/config.php b/config/config.php index fecc1f6..25f4c38 100644 --- a/config/config.php +++ b/config/config.php @@ -2,6 +2,6 @@ $mpd_host ="localhost"; $mpd_port = "6600"; -$mpd_password = "mypassword" +$mpd_password = "mypassword"; ?> diff --git a/index.php b/index.php index 7ed34f3..ddf52bf 100644 --- a/index.php +++ b/index.php @@ -6,7 +6,7 @@ include('system/helper.php'); $mpd = new mpd($mpd_host,$mpd_port,$mpd_password); if($mpd->connected != 1){ - echo "ÐÐµÑ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ ÑеÑвеÑом!"; + echo "Server not available!"; exit(1); } diff --git a/view/default/tmpl/playlistmenu.php b/view/default/tmpl/playlistmenu.php index 45c8857..fdf2157 100644 --- a/view/default/tmpl/playlistmenu.php +++ b/view/default/tmpl/playlistmenu.php @@ -4,7 +4,7 @@ <td><span class="button" onclick="EditPlayList()"><img width="20" src="images/songs.png"></span><td> <td><span class="button" onclick="LoadPlayList()"><img width="20" src="images/lists.png"></span><td> <td><span class="button" onclick="SavePlayList()"><img width="20" src="images/save.png"></span><td> - <td><span class="button" onclick="return confirm('ÐÑиÑÑиÑÑ ÑпиÑок. ÐÑ ÑвеÑенÑ?') ? PlaylistCommand('clear') : false;" ><img width="20" src="images/removeall.png"></span><td> + <td><span class="button" onclick="return confirm('Clear current playlist, are you sure?') ? PlaylistCommand('clear') : false;" ><img width="20" src="images/removeall.png"></span><td> <td><span class="button" onclick="PlaylistItemsCommand('removeselected')"><img width="20" src="images/removeselected.png"></span><td> </tr> </table> diff --git a/view/player/tmpl/default.php b/view/player/tmpl/default.php index 2f0126b..6287a0a 100644 --- a/view/player/tmpl/default.php +++ b/view/player/tmpl/default.php @@ -2,7 +2,7 @@ <div id="nowplaying_heading"> <table id="heading_tbl"> <tr> - <td id="left">ÐÑоигÑÑваеÑÑÑ</td><td id="right"><span onclick="RefreshPageContent()"><img class="button" align="right" width="20" src="images/update.png"></span></td> + <td id="left">Now playing</td><td id="right"><span onclick="RefreshPageContent()"><img class="button" align="right" width="20" src="images/update.png"></span></td> </tr> </table> </div>