示例#1
0
<?php

Output::set_title("Import Music");
MainTemplate::set_subtitle("Add new music to the Digiplay system");
$basepath = FILE_ROOT . "uploads/";
$files = scandir($basepath);
require_once '/usr/share/php/getid3/getid3.php';
$getid3 = new getID3();
$acceptable_bitrates = array("wav" => 1, "mp3" => 256, "aac" => 192, "flac" => 1, "m4a" => 64, "ogg" => 192, "pcm" => 1, "wma" => 256);
echo "\r\n<script>\r\n\$(function() {\r\n\t\$('.file').click(function() {\r\n\t\tslider = \$(this).next('tr').first('td').find('.fileinfo');\r\n\t\tif(slider.is(':visible')) {\r\n\t\t\tslider.slideUp();\r\n\t\t\t\$(this).find('i').removeClass('icon-chevron-down').addClass('icon-chevron-right');\r\n\t\t} else {\r\n\t\t\tslider.slideDown();\r\n\t\t\t\$(this).find('i').removeClass('icon-chevron-right').addClass('icon-chevron-down');\r\n\t\t}\r\n\t});\r\n\r\n\t\$('.fileinfo:first').show();\r\n\t\$('.file:first').find('i').removeClass('icon-chevron-right').addClass('icon-chevron-down');\r\n\r\n\t\$('.delete').click(function() { \r\n\t\tevent.preventDefault();\r\n\t\telem = \$(this);\r\n\t\t\$.ajax({\r\n\t\t\ttype: 'DELETE',\r\n\t\t\turl: '" . LINK_ABS . "ajax/file-upload.php?file='+elem.parents('form').find('[name=filename]').attr('value'),\r\n\t\t\tdataType: 'json',\r\n\t\t\tsuccess: function(data) {\r\n\t\t\t\telem.parents('.panel').find('.glyphicon').removeClass('glyphicon-chevron-right').addClass('glyphicon-remove');\r\n\t\t\t\telem.parents('.panel').removeClass('panel-default').addClass('panel-danger');\r\n\t\t\t\telem.parents('.panel').find('.panel-body').slideUp('fast', function() { \$(this).remove() });\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\t\$('input').keyup(function(){\r\n\t\tclosest = \$(this).parents('form').find('.import');\r\n\t\tif(closest.hasClass('btn-warning')) closest.removeClass('btn-warning').addClass('btn-primary');\r\n\t});\r\n\r\n\t\$('.import').click(function(event) {\r\n\t\tevent.preventDefault();\r\n\t\telem = \$(this);\r\n\t\telem.button('loading');\r\n\t\tif(elem.hasClass('btn-primary')) {\r\n\t\t\t\$.ajax({\r\n\t\t\t\ttype: 'GET',\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/similar-tracks.php?artist='+elem.parents('form').find('[name=artist]').attr('value')+'&title='+elem.parents('form').find('[name=title]').attr('value'),\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t}).done(function(data) {\r\n\t\t\t\tif(data.response == 'fail') {\r\n\t\t\t\t\telem.button('reset');\r\n\t\t\t\t\telem.removeClass('btn-primary').addClass('btn-warning');\r\n\t\t\t\t\tif(data.tracks.length > 1) {\r\n\t\t\t\t\t\telem.parents('.panel-body').find('.warnings').append('" . Bootstrap::alert_message_basic("warning", "There are other songs in the database that look similar to this. <br />Check you aren\\'t importing a duplicate! <a href=\"" . LINK_ABS . "music/search/?q='+data.q+'\" target=\"_blank\">Click here to see the suggestions.</a><br /><strong>Click Import again to add the song anyway.</strong>", "Hold up!", true) . "');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\telem.parents('.panel-body').find('.warnings').append('" . Bootstrap::alert_message_basic("warning", "There is another song in the database that looks similar to this. <br />Check you aren\\'t importing a duplicate! <a href=\"" . LINK_ABS . "music/detail/'+data.tracks[0]+'\" target=\"_blank\">Click here to see the suggestion.</a><br /><strong>Click Import again to add the song anyway.</strong>", "Hold up!", true) . "');\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\timportTrack(elem.parents('form'),elem)\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\timportTrack(elem.parents('form'),elem);\r\n\t\t}\r\n\t});\r\n\r\n\tfunction importTrack(form,button) {\r\n\t\tconsole.log(\$(form).find('#artist').val());\r\n\t\tif (\$(form).find('#artist').val() == ''){\r\n\t\t\talert('Artist is empty please put one in!');\r\n\t\t\tbutton.button('reset');\r\n\t\t} else {\r\n\t\t\$.ajax({\r\n\t\t\ttype: 'GET',\r\n\t\t\turl: '" . LINK_ABS . "ajax/import-track.php',\r\n\t\t\tdataType: 'json',\r\n\t\t\tdata: form.serialize()\r\n\t\t}).done(function(data) {\r\n\t\t\tif(data.error == undefined) {\r\n\t\t\t\tform.parents('.panel').find('.glyphicon').removeClass('glyphicon-chevron-right').addClass('glyphicon-ok');\r\n\t\t\t\tform.parents('.panel').removeClass('panel-default').addClass('panel-success');\r\n\t\t\t\tform.parents('.panel').find('.panel-body').slideUp('fast', function() { \$(this).remove() });\r\n\t\t\t\tbutton.button('reset');\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(data);\r\n\t\t\t\tconsole.log(form.parentsUntil('.panel-body'));\r\n\t\t\t\tform.parents('.panel-body').find('.warnings').append('" . Bootstrap::alert_message_basic("danger", "There was an error when trying to upload this file.<br />'+data.error+'", "Oh no!", true) . "');\r\n\t\t\t\tbutton.button('reset');\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t}\r\n});\r\n</script>\r\n<div class=\"panel-group\" id=\"tracks\">";
foreach ($files as $file) {
    if (substr($file, 0, 1) == ".") {
        continue;
    }
    $tags = $getid3->analyze($basepath . $file);
    @getid3_lib::CopyTagsToComments($tags);
    $rand = mt_rand(0, 10000);
    $title = isset($tags["comments"]["title"]) ? implode(";", $tags["comments"]["title"]) : "";
    $artist = isset($tags["comments"]["artist"]) ? implode(";", $tags["comments"]["artist"]) : "";
    $album = isset($tags["comments"]["album"]) ? implode(";", $tags["comments"]["album"]) : "";
    $year = isset($tags["comments"]["recording_time"]) && strlen(implode($tags["comments"]["recording_time"])) == 4 ? $tags["comments"]["recording_time"][0] : date("Y");
    $length = isset($tags["playtime_string"]) ? $tags["playtime_string"] : "Unknown";
    $origin = Session::get_name() ? Session::get_name() : Session::get_username();
    $filetype = isset($tags["audio"]["dataformat"]) ? $tags["audio"]["dataformat"] : "Unknown";
    $codec = isset($tags["audio"]["codec"]) ? $tags["audio"]["codec"] : "Unknown";
    $bitrate = isset($tags["audio"]["bitrate"]) ? round($tags["audio"]["bitrate"] / 1000) : "Unknown";
    $lossless = $tags["audio"]["lossless"] === false ? false : true;
    $warnings = "";
    $acceptable_bitrate = isset($acceptable_bitrates[$filetype]) ? $acceptable_bitrates[$filetype] : null;
    $warnings .= !($bitrate >= $acceptable_bitrate) ? Bootstrap::alert_message_basic("warning", "File bitrate is below the recommended minimum.  Try and find a better quality version!", "Warning!", true) : "";
    echo "\r\n\t\t<div class=\"panel panel-default\">\r\n\t\t\t<div class=\"panel-heading\" data-toggle=\"collapse\" href=\"#track-" . $rand . "\">\r\n\t\t\t\t" . Bootstrap::glyphicon("chevron-right") . $file . "\r\n\t\t\t</div>\r\n\t\t\t<div id=\"track-" . $rand . "\" class=\"panel-collapse collapse\">\r\n\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t<div class=\"warnings\">" . $warnings . "</div>\r\n\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-sm-8\">\r\n\t\t\t\t\t\t\t<form class=\"form-horizontal\" action=\"#\" method=\"POST\" enctype=\"multipart/form-data\">\r\n\t\t\t\t\t\t\t\t\t<input class=\"form-control\" type=\"hidden\" name=\"filename\" value=\"" . $file . "\" />\r\n\t\t\t\t\t\t\t\t\t<input class=\"form-control\" type=\"hidden\" name=\"origin\" value=\"" . $origin . "\" />\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<label class=\"col-sm-2 control-label\" for=\"title\">Title</label>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-10\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input class=\"form-control\" type=\"text\" id=\"title\" name=\"title\" value=\"" . $title . "\" />\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<label class=\"col-sm-2 control-label\" for=\"artist\">Artist</label>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-10\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input class=\"form-control\" required type=\"text\" id=\"artist\" name=\"artist\" value=\"" . $artist . "\" />\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<label class=\"col-sm-2 control-label\" for=\"album\">Album</label>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-10\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input class=\"form-control\" type=\"text\" id=\"album\" name=\"album\" value=\"" . $album . "\" />\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<label class=\"col-sm-2 control-label\" for=\"year\">Year</label>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-10\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input class=\"form-control\" type=\"text\" id=\"year\" name=\"year\" value=\"" . $year . "\" />\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm-10 col-sm-offset-2\">\r\n\t\t\t\t\t\t\t\t\t\t\t<button class=\"import btn btn-primary\" data-loading=\"Loading...\">" . Bootstrap::glyphicon("ok icon-white") . " Import</button>\r\n\t\t\t\t\t\t\t\t\t\t\t<button class=\"delete btn btn-danger\" >" . Bootstrap::glyphicon("trash icon-white") . " Delete</button>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"col-sm-4\">\r\n\t\t\t\t\t\t\t<strong>Length: </strong>" . $length . "<br />\r\n\t\t\t\t\t\t\t<strong>Origin: </strong>" . $origin . "<br />\r\n\t\t\t\t\t\t\t<strong>Filetype: </strong>" . $filetype . "<br />\r\n\t\t\t\t\t\t\t<strong>Codec: </strong>" . $codec . "<br />\r\n\t\t\t\t\t\t\t<strong>Bitrate: </strong>" . $bitrate . " kbps" . ($lossless ? " (lossless)" : "") . "<br />\r\n\t\t\t\t\t\t\t<em><a href=\"" . LINK_ABS . "uploads/" . $file . "\" target=\"_blank\">" . Bootstrap::glyphicon("download-alt") . "Download file</a></em>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t\t";
示例#2
0
<?php

Output::set_title("Library Search");
$query = $_REQUEST["q"];
$index = isset($_REQUEST["i"]) ? explode(",", $_REQUEST["i"]) : array("title", "artist", "album");
$limit = isset($_GET["n"]) && is_numeric($_REQUEST["n"]) ? $_GET["n"] : 10;
$page = isset($_REQUEST["p"]) && is_numeric($_REQUEST["p"]) ? $_REQUEST["p"] : 1;
MainTemplate::set_subtitle("Find a track in the database, edit track details");
if ($query) {
    $search = Search::tracks($query, $index, $limit, ($page - 1) * $limit);
}
$tracks = $search["results"];
if ($tracks) {
    $pages = new Paginator();
    $pages->items_per_page = $limit;
    $pages->querystring = $query;
    $pages->index = implode(",", $index);
    $pages->mid_range = 5;
    $pages->items_total = $search["total"];
    $pages->paginate();
    $low = ($page - 1) * $limit + 1;
    $high = $low + $limit - 1 > $search["total"] ? $search["total"] : $low + $limit - 1;
    echo "<script>\r\n\t\t\$(function () {\r\n\t\t\t\$('.track-info').popover({\r\n\t\t\t\t'html': true, \r\n\t\t\t\t'trigger': 'hover',\r\n\t\t\t\t'title': function() { \r\n\t\t\t\t\treturn(\$(this).parent().parent().find('.title').html())\r\n\t\t\t\t},\r\n\t\t\t\t'content': function() {\r\n\t\t\t\t\treturn(\$(this).parent().find('.hover-info').html());\r\n\t\t\t\t}\r\n\t\t\t});\r\n" . (Session::is_group_user("Playlist Admin") ? "\r\n\t\tvar item;\r\n\t\t\$('.playlist-add').click(function() {\r\n\t\t\titem = \$(this).parent().parent();\r\n\t\t\tplaylists = \$(this).attr('data-playlists-in').split(',');\r\n\t\t\t\$('.playlist-select').parent().removeClass('active');\r\n\t\t\t\$('.playlist-select').find('span').removeClass('glyphicon-minus').addClass('glyphicon-plus');\r\n\t\t\t\$('.playlist-select').each(function() {\r\n\t\t\t\tif(\$.inArray(\$(this).attr('data-playlist-id'),playlists) > -1) {\r\n\t\t\t\t\t\$(this).find('span').removeClass('icon-plus').addClass('glyphicon-minus');\r\n\t\t\t\t\t\$(this).parent().addClass('active');\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t\t\$('.playlist-select').click(function() {\r\n\t\t\tobj = \$(this);\r\n\t\t\tif(\$(this).parent().hasClass('active')) {\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-minus').addClass('glyphicon-refresh');\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\r\n\t\t\t\t\tdata: 'trackid='+item.attr('id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=del',\r\n\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\tvalues = \$.parseJSON(data);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\r\n\t\t\t\t\t\tobj.parent().removeClass('active');\r\n\t\t\t\t\t\titem.find('.playlist-add').attr('data-playlists-in',values.playlists.join(','));\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-refresh');\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\r\n\t\t\t\t\tdata: 'trackid='+item.attr('id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=add',\r\n\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\tvalues = \$.parseJSON(data);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\r\n\t\t\t\t\t\tobj.parent().addClass('active');\r\n\t\t\t\t\t\titem.find('.playlist-add').attr('data-playlists-in',values.playlists.join(','));\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\$(this).parent().addClass('active');\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-minus');\r\n\t\t\t}\r\n\t\t});\t\t\r\n" : "") . (Session::is_group_user("Music Admin") ? "\r\n\t\tvar trackid;\r\n\t\t\$('.track-delete').click(function() {\r\n\t\t\t\$('.delete-track-title').html(\$(this).parent().parent().find('.title').html());\r\n\t\t\ttrackid = \$(this).attr('data-dps-id');\r\n\t\t});\r\n\r\n\t\t\$('.yes-definitely-delete').click(function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/delete-track.php',\r\n\t\t\t\tdata: 'id='+trackid,\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\talert(value.error);\r\n\t\t\t\t},\r\n\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n" : "") . "\t\t});\r\n\t</script>";
    $indexes = implode(", ", $index);
    echo "<h3>" . $search["total"] . " results for " . $query . "<small> searching in " . $indexes . "</small></h3>";
    echo "<div class=\"row\"><div class=\"col-lg-5\"><h5>Showing results " . $low . " to " . $high . "</h5></div><div class=\"pull-right\">" . $pages->display_jump_menu() . $pages->display_items_per_page() . "</div></div>";
    echo "<table class=\"table table-striped\" cellspacing=\"0\">\r\n\t<thead>\r\n\t\t<tr>\r\n\t\t\t<th class=\"icon\"> </th>\r\n\t\t\t<th class=\"artist\">Artist</th>\r\n\t\t\t<th class=\"title\">Title</th>\r\n\t\t\t<th class=\"album\">Album</th>\r\n\t\t\t<th class=\"length nowrap\">Length</th> \r\n\t\t\t" . (Session::is_group_user("Playlist Admin") ? "<th class=\"icon\"></th>" : "") . "\r\n\t\t\t" . (Session::is_group_user("Music Admin") ? "<th class=\"icon\"></th>" : "") . "\r\n\t\t</tr>\r\n\t</thead>";
    foreach ($tracks as $track_id) {
        $track = Tracks::get($track_id);
        echo "\r\n\t\t<tr id=\"" . $track->get_id() . "\">\r\n\t\t\t<td class=\"icon\">\r\n\t\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $track->get_id() . "\" class=\"track-info\">\r\n\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\r\n\t\t\t\t</a>\r\n\t\t\t\t<div class=\"hover-info\">\r\n\t\t\t\t\t<strong>Artist:</strong> " . $track->get_artists_str() . "<br />\r\n\t\t\t\t\t<strong>Album:</strong> " . $track->get_album()->get_name() . "<br />\r\n\t\t\t\t\t<strong>Year:</strong> " . $track->get_year() . "<br />\r\n\t\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($track->get_length()) . "<br />\r\n\t\t\t\t\t<strong>Origin:</strong> " . $track->get_origin() . "<br />\r\n\t\t\t\t\t" . ($track->get_reclibid() ? "<strong>Reclib ID:</strong> " . $track->get_reclibid() . "<br />" : "") . "\r\n\t\t\t\t\t<strong>Censored:</strong> " . ($track->is_censored() ? "Yes" : "No") . "<br /> \r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"artist\">" . $track->get_artists_str() . "</td>\r\n\t\t\t<td class=\"title\">" . $track->get_title() . "</td>\r\n\t\t\t<td class=\"album\">" . $track->get_album()->get_name() . "</td>\r\n\t\t\t<td class=\"length nowrap\">" . Time::format_succinct($track->get_length()) . "</td>";
        if (Session::is_group_user("Playlist Admin")) {
示例#3
0
<?php

$session = Session::get_user();
$aw = AudiowallSets::get_by_id(pg_escape_string($_REQUEST['setid']));
$sessionpermissions = $aw->get_user_permissions($session->get_id());
if ($sessionpermissions[2] == '1' || Session::is_group_user('Audiowalls Admin')) {
    $ownerid = DigiplayDB::select("user_id FROM aw_sets_owner WHERE set_id = '" . $aw->get_id() . "'");
    if (isset($ownerid)) {
        $user = Users::get_by_id($ownerid);
        $username = $user->get_display_name();
    } else {
        $username = "";
    }
    require_once 'pre.php';
    Output::add_script("../aw.js");
    Output::set_title("Audiowall Users");
    MainTemplate::set_subtitle("<span style=\"margin-right:20px;\">Set: " . $aw->get_name() . "</span><span style=\"margin-right:20px;\">Owner: " . $username . "</span><span id=\"editor_edit_buttons\"><a href=\"#\" class=\"btn btn-success\">Add Viewer</a></span>");
    echo "<style type=\"text/css\">\n\ttable { font-size:1.2em; }\n\tthead { display:none; }\n\t.description { font-size:0.8em; font-style:italic; }\n\t.hover-info { display:none; }\n\t.table tbody tr.success td { background-color: #DFF0D8; }\n\t</style>";
    echo "<table class=\"table table-striped\" cellspacing=\"0\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th></th>\n\t\t\t\t\t\t<th style=\"width:65px\"></th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead><tbody>";
    $aw_set = AudiowallSets::get_by_id($_REQUEST['setid']);
    $users = $aw_set->get_users_with_permissions();
    if (!is_null($users) && count($users) > 1) {
        foreach ($users as $user) {
            $userclass = Users::get_by_id($user->get_id());
            $username = $userclass->get_username();
            $permissions = $aw_set->get_user_permissions($user->get_id());
            if ($permissions[0] == "1" && $permissions[1] == '0') {
                echo "<tr><td><strong>" . $username . "</strong></td>";
                echo "<td class=\"delete-aw-btn\" style=\"width:65px\"><a href=\"#\" class=\"btn btn-danger\">Delete</a></td>";
                echo "</td></tr>";
            }
示例#4
0
<?php

Output::set_title("System Files");
MainTemplate::set_subtitle("Browse and manage files in the database");
Output::add_stylesheet(LINK_ABS . "css/ui.fancytree.css");
Output::add_script(LINK_ABS . "js/jquery-ui-1.10.3.custom.min.js");
Output::add_script(LINK_ABS . "js/jquery.fancytree.js");
Output::add_script(LINK_ABS . "js/jquery.fancytree.glyphicon.js");
echo "\n        <script>\n                \$().ready(function() {\n                        \$('#files').fancytree({\n                                source: { url: '" . LINK_ABS . "ajax/file-tree.php?id=1', cache: false },\n                                extensions: ['glyphicon'],\n                                lazyload: function(event, data) {\n                                        var node = data.node;\n                                        data.result = { url: '" . LINK_ABS . "ajax/file-tree.php?id='+node.data.id }\n                                }\n                        });\n                });\n        </script>\n\n        <div id=\"files\"></div>";
?>

示例#5
0
<?php

Output::set_title("Fault Reporting");
Output::add_stylesheet(LINK_ABS . "faults/style.css");
Output::add_stylesheet(LINK_ABS . "faults/status.css");
MainTemplate::set_subtitle("View updates and report faults");
echo Bootstrap::alert_message_basic("warning", "Most systems are operational", "System Status:", false);
echo "<ul class=\"serviceList\">";
$statuses = Statuses::get(NULL);
foreach ($statuses as $status) {
    $statusInfo = $status->get_status_info();
    echo "<li class=\"serviceList__item\">\r\n      <p class=\"serviceList__status\"><span class=\"serviceStatusTag\" style=\"color:#" . $statusInfo['colour'] . "\">" . $statusInfo['status'] . "</span></p>\r\n      <p class=\"serviceList__name\">\r\n        " . $status->get_name() . "\r\n        <span class=\"serviceList__description has-tooltip\" data-toggle=\"tooltip\" data-placement=\"right\" title=\"" . $status->get_description() . "\"></span>\r\n      </p>\r\n    </li>";
}
echo "</ul>";
示例#6
0
<?php

Output::set_title("Music Uploads");
$index = isset($_REQUEST["i"]) ? explode(",", $_REQUEST["i"]) : array("title", "artist", "album");
$limit = isset($_GET["n"]) && is_numeric($_REQUEST["n"]) ? $_GET["n"] : 10;
$page = isset($_REQUEST["p"]) && is_numeric($_REQUEST["p"]) ? $_REQUEST["p"] : 1;
MainTemplate::set_subtitle("See who has been uploading tracks");
$uploadStats = DigiplayDB::select("origin, count(origin) FROM audio GROUP BY origin ORDER BY count(origin) DESC", NULL, false);
echo "\n\t\t<table class=\"table table-striped table-bordered\">\n\t\t<thead>\n\t\t<tr>\n\t\t<th></th>\n\t\t<th>Member</th>\n\t\t<th>Songs Uploaded</th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t";
$i = 0;
foreach ($uploadStats as $uploadStat) {
    $uploader = $uploadStat['origin'];
    $count = $uploadStat['count'];
    // Filter out old entries
    //if (preg_match('/^Web -/', $uploader)) continue;
    //if (preg_match('/^Dropbox -/', $uploader)) continue;
    //if (preg_match('/^Mp3/', $uploader)) continue;
    //if ($uploader == "") continue;
    // Print row
    $i++;
    echo "\n\t\t<tr>\n\t\t\t<td>" . $i . "</td>\n\t\t\t<td>" . $uploader . "</td>\n\t\t\t<td>" . $count . "</td>\n\t\t</tr>\n\t";
}
echo "</tbody>\n\t\t</table>\n\t";
示例#7
0
<?php

Output::set_title("Administration");
MainTemplate::set_subtitle("Control every aspect of the Digiplay system");
$trash = Files::get_by_id(3, "dir");
echo "\n<div class=\"row\">\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "admin/music\">\n\t\t\t<div class=\"panel panel-info\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("volume-up icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . Tracks::get_total_tracks() . "</h2>\n\t\t\t\t\t\t\t<h4>tracks</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "admin/users\">\n\t\t\t<div class=\"panel panel-success\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("user icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . Users::count() . "</h2>\n\t\t\t\t\t\t\t<h4>users</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "showplans\">\n\t\t\t<div class=\"panel panel-default\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("tasks icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . Showplans::count() . "</h2>\n\t\t\t\t\t\t\t<h4>showplans</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n</div>\n<div class=\"row\">\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "audiowalls\">\n\t\t\t<div class=\"panel panel-default\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("th icon-huge\" style=\"margin-top: -4px;") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . AudiowallSets::count() . "</h2>\n\t\t\t\t\t\t\t<h4>audiowalls</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "email\">\n\t\t\t<div class=\"panel panel-warning\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("envelope icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . Emails::count_unread() . "</h2>\n\t\t\t\t\t\t\t<h4>e-mails</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "admin/trash\">\n\t\t\t<div class=\"panel panel-danger\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("trash icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . $trash->count() . "</h2>\n\t\t\t\t\t\t\t<h4>in trash</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n</div>";
示例#8
0
<?php

Output::set_title("Advert Manager");
Output::add_script(LINK_ABS . "js/jquery-ui-1.10.3.custom.min.js");
Output::add_stylesheet(LINK_ABS . "css/select2.min.css");
Output::add_script(LINK_ABS . "js/select2.min.js");
Output::require_group("Sustainer Admin");
MainTemplate::set_subtitle("Change the adverts on the sustainer service");
$adverts = Adverts::get_all();
echo "<div class=\"list-group\">";
foreach ($adverts as $advert) {
    if ($advert->get_sustainer() == 't') {
        echo "<div class=\"list-group-item active\" data-advert=\"" . $advert->get_id() . "\">" . $advert->get_title() . "</div>";
    } else {
        echo "<div class=\"list-group-item\" data-advert=\"" . $advert->get_id() . "\">" . $advert->get_title() . "</div>";
    }
}
echo "</div>";
echo "<p></p>";
echo "<script>\r\n  \$('.list-group-item').click(function(){\r\n    \$(this).toggleClass(\"active\");\r\n    \$.ajax({\r\n      url: '" . LINK_ABS . "ajax/update-sustainer-advert.php',\r\n      data: {advertid: \$(this).data(\"advert\")},\r\n      type: 'POST',\r\n      error: function(xhr, text, error) {\r\n        value = \$.parseJSON(xhr.responseText);\r\n        alert(value.error);\r\n      },\r\n      success: function(data, text, xhr) {\r\n        window.location.reload(true);\r\n      }\r\n    });\r\n  });\r\n  </script>";
示例#9
0
<?php

Output::set_title("Sue");
MainTemplate::set_subtitle("Song Countdown for the Masses!");
$trash = Files::get_by_id(3, "dir");
$latestsue = DigiplayDB::select("log.track_title, log.track_artist, log.audioid, log.datetime, audio.length_smpl FROM log INNER JOIN audio ON log.audioid = audio.id WHERE log.location = 0 ORDER BY log.datetime DESC LIMIT 5");
//var_dump($latestsue);
$timeremaining = $latestsue[0]['length_smpl'] / 44100 - (time() - $latestsue[0]['datetime']);
//echo time()." - ".$latestsue[0]['datetime']." = ".(time() - $latestsue[0]['datetime']);
//var_dump($timeremaining);
echo "\n<div class=\"row\">\n\t<div class=\"col-sm-12\">\n\t\t<a href=\"" . LINK_ABS . "music\">\n\t\t\t<div class=\"panel panel-info\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . $latestsue[0]['track_title'] . " - " . $latestsue[0]['track_artist'] . ":</h2><h2><span id=\"song-time-left\">" . $timeremaining . "</span> remaining</h2>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n</div>";
echo "\n<script>\n\t\$( document ).ready(function() {\n\t    setInterval(function() {\n\t    \tvar timeremaining = \$( '#song-time-left' ).html()\n\t    \ttimeremaining -= 0.01;\n\t    \tconsole.log(\$( '#song-time-left' ).html());\n\t    \t\$( '#song-time-left' ).html(timeremaining.toFixed(2));\n\t\t}, 10);\n\t});\n</script>\n";
示例#10
0
<?php

Output::set_title("Location Configuration");
MainTemplate::set_subtitle("View and edit configuration settings for each location");
$locations = Locations::get_all();
echo "<div class=\"panel-group\" id=\"accordion\">";
foreach ($locations as $location) {
    echo "\n\t<div class=\"panel panel-default\">\n\t\t<div class=\"panel-heading\" data-toggle=\"collapse\" href=\"#location-" . $location->get_id() . "\">\n\t\t\t<h4 class=\"panel-title\">\n\t\t\t\tLocation " . $location->get_id() . "\n\t\t\t</h4>\n\t\t</div>\n\t\t<div id=\"location-" . $location->get_id() . "\" class=\"panel-collapse collapse\">\n\t\t\t<table class=\"table table-striped table-hover\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"title\">Setting</th>\n\t\t\t\t\t\t<th class=\"icon\">Value</th>\n\t\t\t\t\t\t<th class=\"icon\"></th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>";
    $settings = Configs::get_by_location($location);
    foreach ($settings as $setting) {
        echo "<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $setting->get_parameter() . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<strong>" . $setting->get_val() . "</strong> <br />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"icon\">\n\t\t\t\t\t\t\t<span class='glyphicon glyphicon-edit'></span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
    }
    echo "\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t</div>";
}
echo "</div>";
示例#11
0
<?php

Output::set_title("Trash");
$index = isset($_REQUEST["i"]) ? explode(",", $_REQUEST["i"]) : array("title", "artist", "album");
$limit = isset($_GET["n"]) && is_numeric($_REQUEST["n"]) ? $_GET["n"] : 10;
$page = isset($_REQUEST["p"]) && is_numeric($_REQUEST["p"]) ? $_REQUEST["p"] : 1;
MainTemplate::set_subtitle("Find a track in the database, edit track details");
$tracks = Tracks::get_deleted($limit, ($page - 1) * $limit);
if ($tracks) {
    $pages = new Paginator();
    $pages->items_per_page = $limit;
    $pages->index = implode(",", $index);
    $pages->mid_range = 5;
    $pages->items_total = Tracks::count_deleted();
    $pages->paginate();
    $low = ($page - 1) * $limit + 1;
    $high = $low + $limit - 1 > Tracks::count_deleted() ? Tracks::count_deleted() : $low + $limit - 1;
    echo "<script>\n\t\t\$(function () {\n\t\t\t\$('.track-info').popover({\n\t\t\t\t'html': true, \n\t\t\t\t'trigger': 'hover',\n\t\t\t\t'title': function() { \n\t\t\t\t\treturn(\$(this).parent().parent().find('.title').html())\n\t\t\t\t},\n\t\t\t\t'content': function() {\n\t\t\t\t\treturn(\$(this).parent().find('.hover-info').html());\n\t\t\t\t}\n\t\t\t});\n" . (Session::is_group_user("Playlist Admin") ? "\n\t\tvar item;\n\t\t\$('.playlist-add').click(function() {\n\t\t\titem = \$(this).parent().parent();\n\t\t\tplaylists = \$(this).attr('data-playlists-in').split(',');\n\t\t\t\$('.playlist-select').parent().removeClass('active');\n\t\t\t\$('.playlist-select').find('span').removeClass('glyphicon-minus').addClass('glyphicon-plus');\n\t\t\t\$('.playlist-select').each(function() {\n\t\t\t\tif(\$.inArray(\$(this).attr('data-playlist-id'),playlists) > -1) {\n\t\t\t\t\t\$(this).find('span').removeClass('icon-plus').addClass('glyphicon-minus');\n\t\t\t\t\t\$(this).parent().addClass('active');\n\t\t\t\t}\n\t\t\t})\n\t\t});\n\n\t\t\$('.playlist-select').click(function() {\n\t\t\tobj = \$(this);\n\t\t\tif(\$(this).parent().hasClass('active')) {\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-minus').addClass('glyphicon-refresh');\n\t\t\t\t\$.ajax({\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\n\t\t\t\t\tdata: 'trackid='+item.attr('id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=del',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\n\t\t\t\t\t\talert(value.error);\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\t\tvalues = \$.parseJSON(data);\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\n\t\t\t\t\t\tobj.parent().removeClass('active');\n\t\t\t\t\t\titem.find('.playlist-add').attr('data-playlists-in',values.playlists.join(','));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-refresh');\n\t\t\t\t\$.ajax({\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\n\t\t\t\t\tdata: 'trackid='+item.attr('id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=add',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\n\t\t\t\t\t\talert(value.error);\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\t\tvalues = \$.parseJSON(data);\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\n\t\t\t\t\t\tobj.parent().addClass('active');\n\t\t\t\t\t\titem.find('.playlist-add').attr('data-playlists-in',values.playlists.join(','));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\$(this).parent().addClass('active');\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-minus');\n\t\t\t}\n\t\t});\t\t\n" : "") . (Session::is_group_user("Music Admin") ? "\n\t\tvar trackid;\n\t\t\$('.track-delete').click(function() {\n\t\t\t\$('.delete-track-title').html(\$(this).parent().parent().find('.title').html());\n\t\t\ttrackid = \$(this).attr('data-dps-id');\n\t\t});\n\n\t\t\$('.yes-definitely-delete').click(function() {\n\t\t\t\$.ajax({\n\t\t\t\turl: '" . LINK_ABS . "ajax/remove-track.php',\n\t\t\t\tdata: { id: trackid },\n\t\t\t\ttype: 'POST',\n\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\talert(value.error);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\twindow.location.reload(true); \n\t\t\t\t}\n\t\t\t});\n\t\t});\n" : "") . "\t\t});\n\t</script>";
    echo "<a href=\"#\" id=\"flag\" data-toggle=\"modal\" data-target=\"#empty-modal\" class=\"btn btn-danger btn-block\">" . Bootstrap::glyphicon("warning-sign") . " Empty Trash</a>";
    echo "<p></p>";
    echo "<h3>" . Tracks::count_deleted() . " results for deleted items.</small></h3>";
    echo "<div class=\"row\"><div class=\"col-lg-5\"><h5>Showing results " . $low . " to " . $high . "</h5></div><div class=\"pull-right\">" . $pages->display_jump_menu() . $pages->display_items_per_page() . "</div></div>";
    echo "<table class=\"table table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"icon\"> </th>\n\t\t\t<th class=\"artist\">Artist</th>\n\t\t\t<th class=\"title\">Title</th>\n\t\t\t<th class=\"album\">Album</th>\n\t\t\t<th class=\"length nowrap\">Length</th> \n\t\t\t" . (Session::is_group_user("Playlist Admin") ? "<th class=\"icon\"></th>" : "") . "\n\t\t\t" . (Session::is_group_user("Music Admin") ? "<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
    foreach ($tracks as $track) {
        echo "\n\t\t<tr id=\"" . $track->get_id() . "\">\n\t\t\t<td class=\"icon\">\n\t\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $track->get_id() . "\" class=\"track-info\">\n\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t\t</a>\n\t\t\t\t<div class=\"hover-info\">\n\t\t\t\t\t<strong>Artist:</strong> " . $track->get_artists_str() . "<br />\n\t\t\t\t\t<strong>Album:</strong> " . $track->get_album()->get_name() . "<br />\n\t\t\t\t\t<strong>Year:</strong> " . $track->get_year() . "<br />\n\t\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($track->get_length()) . "<br />\n\t\t\t\t\t<strong>Origin:</strong> " . $track->get_origin() . "<br />\n\t\t\t\t\t" . ($track->get_reclibid() ? "<strong>Reclib ID:</strong> " . $track->get_reclibid() . "<br />" : "") . "\n\t\t\t\t\t<strong>Censored:</strong> " . ($track->is_censored() ? "Yes" : "No") . "<br /> \n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<td class=\"artist\">" . $track->get_artists_str() . "</td>\n\t\t\t<td class=\"title\">" . $track->get_title() . "</td>\n\t\t\t<td class=\"album\">" . $track->get_album()->get_name() . "</td>\n\t\t\t<td class=\"length nowrap\">" . Time::format_succinct($track->get_length()) . "</td>";
        if (Session::is_group_user("Playlist Admin")) {
            $playlists = array();
            foreach ($track->get_playlists_in() as $playlist) {
                $playlists[] = $playlist->get_id();
            }
            echo "<td class=\"icon\"><a href=\"#\" data-toggle=\"modal\" data-target=\"#playlist-modal\" data-backdrop=\"true\" data-keyboard=\"true\" data-dps-id=\"" . $track->get_id() . "\" data-playlists-in=\"" . implode(",", $playlists) . "\" class=\"playlist-add\" title=\"Add to playlist\" rel=\"twipsy\">" . Bootstrap::glyphicon("plus-sign") . "</a></td>";
示例#12
0
<?php

Output::set_title("Studio Management");
Output::add_script(LINK_ABS . "js/moment.min.js");
Output::add_stylesheet(LINK_ABS . "css/studio.css");
Output::add_stylesheet(LINK_ABS . "css/ui.fancytree.css");
Output::add_script(LINK_ABS . "js/jquery-ui-1.10.3.custom.min.js");
Output::add_script(LINK_ABS . "js/jquery.fancytree.js");
Output::add_script(LINK_ABS . "js/jquery.fancytree.glyphicon.js");
MainTemplate::set_body_class('manage');
if (isset($_REQUEST["key"])) {
    $location = Locations::get_by_key($_REQUEST["key"]);
    $key = $_REQUEST["key"];
} else {
    if (isset($_REQUEST["location"])) {
        $location = Locations::get_by_id($_REQUEST["location"]);
        $key = $location->get_key();
    } else {
        exit("No location specified!");
    }
}
echo "\r\n\t\t<script>\r\n\t\t\tvar key = 'key=" . $key . "&';\r\n\t\t\tvar timers = [];\r\n\t\t\tvar connect_timeout;\r\n\t\t\tvar websocket;\r\n\t\t\tvar connection = false;\r\n\r\n\t\t\tfunction startWebsocket() {\r\n\t\t\t\tconsole.log('Starting websocket...');\r\n\t\t\t\twebsocket = new WebSocket('" . Configs::get_system_param("websocket_uri") . "');\r\n\t\t\t\twebsocket.onopen = function(e) { onOpen(e) };\r\n\t\t\t\twebsocket.onclose = function(e) { onClose(e) };\r\n\t\t\t\twebsocket.onmessage = function(e) { onMessage(e) };\r\n\t\t\t\twebsocket.onerror = function(e) { onError(e) };\r\n\t\t\t}\r\n\r\n\t\t\tfunction onOpen(e) {\r\n\t\t\t\tconnection = true;\r\n\t\t\t\tconsole.log('Websocket connection established.');\r\n\t\t\t\twebsocket.send(JSON.stringify({'ident':'" . $key . "'}));\r\n\t\t\t\tclearTimeout(connect_timeout);\r\n\t\t\t\t\$.each(timers, function(i, v) { clearInterval(v); });\r\n\t\t\t\ttimers = [];\r\n\t\t\t}\r\n\r\n\t\t\tfunction onClose(e) {\r\n\t\t\t\tconnection = false;\r\n\t\t\t\tconsole.log('Websocket connection lost.');\r\n\t\t\t\tconnect_timeout = setTimeout('setIntervals()', 5000);\r\n\t\t\t\tsetTimeout('startWebsocket()',5000);\r\n\t\t\t}\r\n\r\n\t\t\tfunction onMessage(e) {\r\n\t\t\t\tdata = JSON.parse(e.data);\r\n\t\t\t\tconsole.debug(data);\r\n\t\t\t\tswitch(data.channel) {\r\n\t\t\t\t\tcase 't_log':\r\n\t\t\t\t\t\treloadLog();\r\n\t\t\t\t\t\treloadPlaylists();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 't_messages':\r\n\t\t\t\t\t\treloadMessages();\r\n\t\t\t\t\t\tnewMessage();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 't_playlists':\r\n\t\t\t\t\t\treloadPlaylists();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 't_configuration':\r\n\t\t\t\t\t\tswitch(data.payload.parameter) {\r\n\t\t\t\t\t\t\tcase 'current_showitems_id':\r\n\t\t\t\t\t\t\t\t\$('#showplan .panel').removeClass('panel-primary').addClass('panel-default');\r\n\t\t\t\t\t\t\t\t\$('[data-item-id='+data.payload.val+']').removeClass('panel-default panel-info').addClass('panel-primary');\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'next_on_showplan':\r\n\t\t\t\t\t\t\t\tif(data.payload.val == '') {\r\n\t\t\t\t\t\t\t\t\tif(\$('#showplan .panel-primary').is(':last-child')) \$(this).removeClass('panel-primary').addClass('panel-default');\r\n\t\t\t\t\t\t\t\t\t\$('#showplan .panel-primary').removeClass('panel-primary').addClass('panel-default').next('.showplan-audio').dblclick();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 't_audiowall':\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 't_showitems':\r\n\t\t\t\t\t\treloadShowplan();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onError(e) {\r\n\t\t\t\tconsole.log(e);\r\n\t\t\t}\r\n\r\n\t\t\tfunction setIntervals() {\r\n\t\t\t\tif(timers.length == 0) {\r\n\t\t\t\t\tconsole.log('Setting manual refresh intervals.');\r\n\t\t\t\t\ttimers.push(setInterval('reloadShowplan()', 5000));\r\n\t\t\t\t\ttimers.push(setInterval('reloadInfo()', 60000));\r\n\t\t\t\t\ttimers.push(setInterval('reloadMessages()', 30000));\r\n\t\t\t\t\ttimers.push(setInterval('reloadPlaylists()', 60000));\r\n\t\t\t\t\ttimers.push(setInterval('reloadLog()', 30000));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\$(function() {\r\n\t\t\t\t\$('#yes-login').button();\r\n\t\t\t\tconnect_timeout = setTimeout('setIntervals()', 5000);\r\n\t\t\t\tstartWebsocket();\r\n\t\t\t\twindow.oncontextmenu = function(event) {\r\n  \t\t\t\t\tevent.preventDefault();\r\n    \t\t\t\tevent.stopPropagation();\r\n    \t\t\t\treturn false;\r\n\t\t\t\t};\r\n\r\n\t\t\t\t\$(document).keydown(function(e) {\r\n\t\t\t\t\tif((111 < e.which) && (e.which < 123)) e.preventDefault();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t</script>\r\n\t\t<div class=\"wrap\">\r\n\t\t\t<nav class=\"navbar navbar-default navbar-fixed-top\" id=\"header\">\r\n\t\t\t\t<script> \$(function() { setInterval(function() { \$('#now-next').load('functions.php?'+key+'action=now-next') }, 60000); \$('#now-next').load('functions.php?'+key+'action=now-next'); }); </script>\r\n\t\t\t\t<div id=\"now-next\">\r\n\t\t\t\t\t<div class=\"col-sm-6 navbar-brand\">On now: <span id=\"on-now\"></span></div>\r\n\t\t\t\t\t<div class=\"col-sm-6 navbar-brand\">On next: <span id=\"on-next\"></span></div>\r\n\t\t\t\t</div>\r\n\t\t\t</nav>\r\n\t\t\t<div class=\"container\">\r\n\t\t\t\t<div class=\"row\" id=\"main-panel\">\r\n\t\t\t\t\t<div class=\"col-md-7\" id=\"left-panel\">\r\n\t\t\t\t\t\t<ul class=\"nav nav-tabs nav-justified\" id=\"tabs\">\r\n\t\t\t\t\t\t\t<li class=\"active\"><a href=\"#info\" data-toggle=\"tab\">" . Bootstrap::glyphicon("info-sign") . " Info</a></li>\r\n\t\t\t\t\t\t\t<li><a href=\"#search\" data-toggle=\"tab\">" . Bootstrap::glyphicon("music") . " Music</a></li>\r\n\t\t\t\t\t\t\t<li><a href=\"#messages\" data-toggle=\"tab\">" . Bootstrap::glyphicon("envelope") . " Messages</a></li>\r\n\t\t\t\t\t\t\t<li " . (Session::is_user() ? "" : "class=\"disabled\"") . "><a href=\"#playlists\" " . (Session::is_user() ? "data-toggle=\"tab\"" : "") . ">" . Bootstrap::glyphicon("th-list") . " Playlists</a></li>\r\n\t\t\t\t\t\t\t<li " . (Session::is_user() ? "" : "class=\"disabled\"") . "><a href=\"#files\" " . (Session::is_user() ? "data-toggle=\"tab\"" : "") . ">" . Bootstrap::glyphicon("folder-open") . " Files</a></li>\r\n\t\t\t\t\t\t\t<li><a href=\"#logging\" data-toggle=\"tab\">" . Bootstrap::glyphicon("pencil") . " Logging</a></li>";
if ($location->get_id() == 1 || $location->get_id() == 2) {
    echo "<li id=\"reset\" class=\"btn btn-danger" . (Session::is_user() ? "" : "disabled") . "\">" . Bootstrap::glyphicon("refresh") . " Reset</li>";
}
echo "</ul>\r\n\t\t\t\t\t\t<div class=\"tab-content\" id=\"left-panel-content\">\r\n\t\t\t\t\t\t\t<div class=\"tab-pane active\" id=\"info\">\r\n\t\t\t\t\t\t\t\t<script>\r\n\t\t\t\t\t\t\t\t\tfunction reloadInfo() {\r\n\t\t\t\t\t\t\t\t\t\t\$('#info-content').load('functions.php?'+key+'action=info-content');\r\n\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t<script>\r\n\t\t\t\t\t\t\t\t\t\$('#reset').click(function(){\r\n\t\t\t\t\t\t\t\t\t\t\$('#reset-modal').modal(\"show\");\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t<div id=\"info-content\">\r\n\t\t\t\t\t\t\t\t\t" . Configs::get_system_param("info-content") . "\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"tab-pane\" id=\"search\">\r\n\t\t\t\t\t\t\t\t<script>\r\n\t\t\t\t\t\t\t\t\t\$(function() { \r\n\t\t\t\t\t\t\t\t\t\t\$('#search-form').submit(function(e) { \r\n\t\t\t\t\t\t\t\t\t\t\te.preventDefault(); \r\n\t\t\t\t\t\t\t\t\t\t\t\$('[name=submit-search]').addClass('disabled');\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#search-results').html('<h1 class=\"loading\">" . Bootstrap::glyphicon("refresh rotate") . " Searching...</h1>')\r\n\t\t\t\t\t\t\t\t\t\t\t\t.load('functions.php?'+key+'action=search&'+\$('#search-form').serialize(), function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\$('[name=submit-search]').removeClass('disabled');\r\n\t\t\t\t\t\t\t\t\t\t\t\t}) \r\n\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t<form class=\"form-horizontal\" id=\"search-form\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-10\" id=\"search-text\" >\r\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"search-text\" placeholder=\"Search...\">\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-2\" id=\"search-button\">\r\n\t\t\t\t\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary btn-block\" name=\"submit-search\">Search</button>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-12\" id=\"search-options\">\r\n\t\t\t\t\t\t\t\t\t\t\t<label class=\"checkbox-inline\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" id=\"search-title\" name=\"search-title\" checked>Titles</input>\r\n\t\t\t\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t\t\t\t\t<label class=\"checkbox-inline\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" id=\"search-artist\" name=\"search-artist\" checked>Artists</input>\r\n\t\t\t\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t\t\t\t\t<label class=\"checkbox-inline\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" id=\"search-album\" name=\"search-album\" checked>Albums</input>\r\n\t\t\t\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t\t<div id=\"search-results\">\r\n\t\t\t\t\t\t\t\t\t<h3>Enter something to search for in the box above.</h3>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"tab-pane\" id=\"messages\">\r\n\t\t\t\t\t\t\t\t<script>\r\n\t\t\t\t\t\t\t\t\tfunction reloadMessages() {\r\n\t\t\t\t\t\t\t\t\t\tvar active_message;\r\n\t\t\t\t\t\t\t\t\t\t\$.ajax('functions.php?'+key+'action=messages').done(function(data) {\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#message-list tr').each(function() { \r\n\t\t\t\t\t\t\t\t\t\t\t\tif(\$(this).hasClass('selected')) active_message = \$(this).attr('data-message-id');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#message-list').html(data);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$('[data-message-id='+active_message+']').addClass('selected');\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tfunction newMessage() {\r\n\t\t\t\t\t\t\t\t\t\tconsole.debug('lol message');\r\n\t\t\t\t\t\t\t\t\t\t\$('[href=#messages]').addClass('btn-primary new-message');\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\$(function() { \r\n\t\t\t\t\t\t\t\t\t\t\$('#message-list').load('functions.php?'+key+'action=messages');\r\n\r\n\t\t\t\t\t\t\t\t\t\t\$(document).on('click', '#message-list tbody tr', function() { \r\n\t\t\t\t\t\t\t\t\t\t\t\$('#message-content h4').html(\$(this).find('.subject').html());\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#message-content iframe').attr('src', 'functions.php?'+key+'action=message&id='+\$(this).attr('data-message-id')); \r\n\t\t\t\t\t\t\t\t\t\t\t\$(this).find('span').removeClass('glyphicon-envelope');\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\$(document).on('click', '[href=#messages]', function() { \$(this).removeClass('btn-primary new-message'); });\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t<div id=\"message-list\">\r\n\t\t\t\t\t\t\t\t\t<h1 class=\"loading\">" . Bootstrap::glyphicon("refresh rotate") . "</h1>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div id=\"message-content\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"panel-heading\"><h4>&nbsp;</h4></div>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"panel-body\"><iframe></iframe></div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"tab-pane\" id=\"playlists\">\r\n\t\t\t\t\t\t\t\t<script>\r\n\t\t\t\t\t\t\t\t\tfunction reloadPlaylists() {\r\n\t\t\t\t\t\t\t\t\t\tvar active_playlists = [];\r\n\t\t\t\t\t\t\t\t\t\t\$.ajax('functions.php?'+key+'action=playlists').done(function(data) {\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#playlists-list .panel-collapse').each(function() { \r\n\t\t\t\t\t\t\t\t\t\t\t\tif(\$(this).hasClass('in')) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactive_playlists.push(\$(this).attr('id'));\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#playlists-list').html(data);\r\n\t\t\t\t\t\t\t\t\t\t\t\$.each(active_playlists, function(key, value) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#'+value).addClass('in');\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\$(function() { \r\n\t\t\t\t\t\t\t\t\t\t\$('#playlists-list').load('functions.php?'+key+'action=playlists', function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#playlists-list .panel-collapse:first').addClass('in');\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t<div class=\"panel-group\" id=\"playlists-list\">\r\n\t\t\t\t\t\t\t\t\t<h1 class=\"loading\">" . Bootstrap::glyphicon("refresh rotate") . "</h1>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"tab-pane\" id=\"files\">\r\n\t\t\t\t\t\t\t\t\t<script>\r\n\t\t\t\t\t\t\t\t\t\tfunction createFileBrowser() {\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#files').append('<div id=\"file-browser\"></div>');\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#file-browser').fancytree({ \r\n\t\t\t\t\t\t\t\t\t\t\t\tsource: { url: '" . LINK_ABS . "ajax/file-tree.php?id=1', cache: false },\r\n\t\t\t\t\t\t\t\t\t\t\t\textensions: ['glyphicon'],\r\n\t\t\t\t\t\t\t\t\t\t\t\tlazyload: function(event, data) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar node = data.node;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata.result = {\turl: '" . LINK_ABS . "ajax/file-tree.php?id='+node.data.id }\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#file-browser').bind('fancytreedblclick', function(event, data) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(data.node.data.type == 'jingle' || data.node.data.type == 'advert' || data.node.data.type == 'music') {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\taddToShowplan(data.node.data.id);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(data.node.data.type == 'script') {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\taddScriptToShowplan(data.node.data.id);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(data.node.data.type == 'aw_set') {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tloadAudiowall(data.node.data.id);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\tfunction destroyFileBrowser() {\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#file-browser').remove();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t" . (Session::is_user() ? "\$(function() { createFileBrowser(); }); " : "") . "\r\n\t\t\t\t\t\t\t\t\t</script>\r\n\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"tab-pane\" id=\"logging\">\r\n\t\t\t\t\t\t\t\t<script>\r\n\t\t\t\t\t\t\t\t\tfunction reloadLog() {\r\n\t\t\t\t\t\t\t\t\t\t\$('#log').load('functions.php?'+key+'action=log');\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\$(function() { \r\n\t\t\t\t\t\t\t\t\t\t\$('#logging-form').submit(function(e) { \r\n\t\t\t\t\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t\t\t\t\t\$('[name=submit-log]').addClass('disabled');\r\n\t\t\t\t\t\t\t\t\t\t\t\$('#log').load('functions.php?'+key+'action=log&'+\$(this).serialize(), function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$('[name=artist]').val('').focus();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$('[name=title]').val('');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$('[name=submit-log]').removeClass('disabled');\r\n\t\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\$('#log').load('functions.php?'+key+'action=log');\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t\t\t<form class=\"form-inline\" id=\"logging-form\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"artist\" placeholder=\"Artist\">\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"title\" placeholder=\"Title\">\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\" name=\"submit-log\">Log</button>\r\n\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t\t<div id=\"log\">\r\n\t\t\t\t\t\t\t\t\t<h1 class=\"loading\">" . Bootstrap::glyphicon("refresh rotate") . "</h1>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"col-md-5 hidden-sm hidden-xs\" id=\"right-panel\">\r\n\t\t\t\t\t\t<script>\r\n\t\t\t\t\t\t\tfunction reloadShowplan() {\r\n\t\t\t\t\t\t\t\tvar expanded_items = [];\r\n\t\t\t\t\t\t\t\tvar previous_items = [];\r\n\t\t\t\t\t\t\t\tvar selected_item;\r\n\t\t\t\t\t\t\t\tvar current_audio;\r\n\t\t\t\t\t\t\t\t\$.ajax('functions.php?'+key+'action=showplan').done(function(data) {\r\n\t\t\t\t\t\t\t\t\t\$('#showplan .panel').each(function() { \r\n\t\t\t\t\t\t\t\t\t\tprevious_items.push(\$(this).attr('data-item-id'));\r\n\t\t\t\t\t\t\t\t\t\tif(\$(this).find('.panel-collapse').hasClass('in')) {\r\n\t\t\t\t\t\t\t\t\t\t\texpanded_items.push(\$(this).find('.panel-collapse').attr('id'));\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif(\$(this).hasClass('panel-info')) {\r\n\t\t\t\t\t\t\t\t\t\t\tselected_item = \$(this).attr('data-item-id');\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif(\$(this).hasClass('panel-primary')) {\r\n\t\t\t\t\t\t\t\t\t\t\tcurrent_audio = \$(this).attr('data-item-id');\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\$('#showplan').html(data);\r\n\t\t\t\t\t\t\t\t\t\$.each(expanded_items, function(key, value) {\r\n\t\t\t\t\t\t\t\t\t\t\$('#'+value).addClass('in');\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\tif(!\$('#showplan .panel-primary').length) {\r\n\t\t\t\t\t\t\t\t\t\t\$.each(\$('#showplan .panel'), function(key, value) {\r\n\t\t\t\t\t\t\t\t\t\t\tif(\$.inArray(\$(this).attr('data-item-id'), previous_items) == -1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$(this).dblclick();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif(!\$('[data-item-id='+current_audio+']').hasClass('panel-primary')) {\r\n\t\t\t\t\t\t\t\t\t\t\$('[data-item-id='+current_audio+']').next('.showplan-audio').dblclick();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif(typeof selected_item != 'undefined') {\r\n\t\t\t\t\t\t\t\t\t\t\$('[data-item-id='+selected_item+']').addClass('panel-info');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction addToShowplan(id) {\r\n\t\t\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\t\t\turl: 'functions.php?'+key+'action=showplan-append&id='+id,\r\n\t\t\t\t\t\t\t\t\tdataType: 'json'\r\n\t\t\t\t\t\t\t\t}).done(function(data) {\r\n\t\t\t\t\t\t\t\t\tif(!connection) reloadShowplan();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction addScriptToShowplan(id) {\r\n\t\t\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\t\t\turl: 'functions.php?'+key+'action=showplan-append-script&id='+id,\r\n\t\t\t\t\t\t\t\t\tdataType: 'json'\r\n\t\t\t\t\t\t\t\t}).done(function(data) {\r\n\t\t\t\t\t\t\t\t\tif(!connection) reloadShowplan();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfunction loadAudiowall(id) {\r\n\t\t\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\t\t\turl: 'functions.php?'+key+'action=set-user-audiowall&id='+id,\r\n\t\t\t\t\t\t\t\t\tdataType: 'json'\r\n\t\t\t\t\t\t\t\t}).done(function(data) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\$(function() { \r\n\t\t\t\t\t\t\t\t\$('#showplan').load('functions.php?'+key+'action=showplan');\r\n\r\n\t\t\t\t\t\t\t\t\$(document).on('dblclick', '#showplan .showplan-audio', function() {\r\n\t\t\t\t\t\t\t\t\t\$(this).find('.controls').hide();\r\n\t\t\t\t\t\t\t\t\t\$(this).find('.duration').show();\r\n\t\t\t\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\t\t\t\turl: 'functions.php?'+key+'action=set-current&id='+\$(this).attr('data-item-id'),\r\n\t\t\t\t\t\t\t\t\t\tdataType: 'json'\r\n\t\t\t\t\t\t\t\t\t}).done(function(data) {\r\n\t\t\t\t\t\t\t\t\t\tif(data.response == 'success') {\r\n\t\t\t\t\t\t\t\t\t\t\tif(!connection) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#showplan .panel').removeClass('panel-primary').addClass('panel-default');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\$('[data-item-id='+data.id+']').removeClass('panel-default panel-info').addClass('panel-primary');\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\$(document).on('click', 'tbody tr', function() { \r\n\t\t\t\t\t\t\t\t\t\$(this).parentsUntil('.tab-pane').find('tr').removeClass('selected');\r\n\t\t\t\t\t\t\t\t\t\$(this).addClass('selected');\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\$(document).on('click', '#showplan .panel', function() { \r\n\t\t\t\t\t\t\t\t\t\$(this).parent().find('.panel:not(.panel-primary)').removeClass('panel-info').addClass('panel-default');\r\n\t\t\t\t\t\t\t\t\tif(!\$(this).hasClass('panel-primary')) {\r\n\t\t\t\t\t\t\t\t\t\t\$(this).addClass('panel-info');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\$(document).on('dblclick', '.track', function() {\r\n\t\t\t\t\t\t\t\t\taddToShowplan(\$(this).attr('data-track-id'));\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\$(document).on('mouseenter', '#showplan .panel:not(.panel-primary)', function() {\r\n\t\t\t\t\t\t\t\t\t\$(this).find('.duration').hide();\r\n\t\t\t\t\t\t\t\t\t\$(this).find('.controls').show();\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\$(document).on('mouseleave', '#showplan .panel:not(.panel-primary)', function() {\r\n\t\t\t\t\t\t\t\t\t\$(this).find('.controls').hide();\r\n\t\t\t\t\t\t\t\t\t\$(this).find('.duration').show();\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\$(document).on('click', '.controls .glyphicon-remove', function() {\r\n\t\t\t\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\t\t\t\turl: 'functions.php?'+key+'action=showplan-remove&id='+\$(this).parents('.panel').attr('data-item-id'),\r\n\t\t\t\t\t\t\t\t\t\tdataType: 'json'\r\n\t\t\t\t\t\t\t\t\t}).done(function(data) {\r\n\t\t\t\t\t\t\t\t\t\treloadShowplan();\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t</script>\r\n\r\n\t\t\t\t\t\t<h2 id=\"showplan-title\"><span>Showplan</span><div class=\"pull-right clear-showplan\" data-toggle=\"modal\" data-target=\"#clear-showplan-modal\">" . Bootstrap::glyphicon("trash") . "</div></h2>\r\n\t\t\t\t\t\t<div class=\"list-group\" id=\"showplan\">\r\n\t\t\t\t\t\t\t<h1 class=\"loading\">" . Bootstrap::glyphicon("refresh rotate") . "</h1>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<nav class=\"navbar navbar-default navbar-fixed-bottom\" id=\"footer\">\r\n\t\t\t\t<script>\r\n\t\t\t\t\t\$(function() { \r\n\t\t\t\t\t\tsetInterval(function () { \r\n\t\t\t\t\t\t\t\$('#clock .time').html(moment().format('h:mm:ss a'));\r\n\t\t\t\t\t\t\t\$('#clock .date').html(moment().format('dddd Do MMMM YYYY'));\r\n\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t}); \r\n\t\t\t\t</script>\r\n\t\t\t\t<img src=\"" . LINK_ABS . "img/footer_logo.png\" alt=\"RaW 1251AM\" id=\"logo\" class=\"hidden-xs hidden-sm\" />\r\n\t\t\t\t<div class=\"col-sm-3 navbar-brand\">\r\n\t\t\t\t\t<div id=\"clock\">\r\n\t\t\t\t\t\t<span class=\"time\">00:00:00</span><br />\r\n\t\t\t\t\t\t<span class=\"date\">1st January 1970</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"col-sm-3 pull-right\">\r\n\t\t\t\t<a href=\"#\" data-toggle=\"modal\" data-target=\"#logout-modal\" class=\"btn btn-primary btn-lg btn-block\" " . (Session::is_user() ? "" : "style=\"display:none\"") . ">Log Out</a>\r\n\t\t\t\t<a href=\"#\" data-toggle=\"modal\" data-target=\"#login-modal\" class=\"btn btn-primary btn-lg btn-block\" " . (Session::is_user() ? "style=\"display:none\"" : "") . ">Log In</a>\r\n\t\t\t\t\t</div>\r\n\r\n\t\t\t\t<div class=\"col-sm-3 pull-right\" id=\"contact\">\r\n\t\t\t\t\t" . Bootstrap::glyphicon("phone") . " " . Configs::get_system_param("contact_sms") . "<br />\r\n\t\t\t\t\t" . Bootstrap::glyphicon("earphone") . " " . Configs::get_system_param("contact_phone") . "<br />\r\n\t\t\t\t\t" . Bootstrap::glyphicon("envelope") . " " . Configs::get_system_param("contact_email") . "\r\n\t\t\t\t</div>\r\n\t\t\t</nav>\r\n\t\t\t<script>\r\n\t\t\t\t\$(function() {\r\n\t\t\t\t\t\$('#yes-login').click(function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\$(this).button('loading');\r\n\t\t\t\t\t\t\$('#username').parent().removeClass('has-error');\r\n\t\t\t\t\t\t\$('#password').parent().removeClass('has-error');\r\n\t\t\t\t\t\t\$('#login-modal').find('small').remove();\r\n\t\t\t\t\t\t\$('#login-modal').find('h1').find('span').removeClass('glyphicon-play-circle').addClass('glyphicon-refresh rotate');\r\n\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\turl: 'functions.php?'+key+'action=login',\r\n\t\t\t\t\t\t\tdata: 'username='******'#username').val()+'&password='******'#password').val(),\r\n\t\t\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\t\t\tdataType: 'json'\r\n\t\t\t\t\t\t}).done(function(data) {\r\n\t\t\t\t\t\t\t\$('#login-modal').find('h1').find('span').removeClass('glyphicon-refresh rotate').addClass('glyphicon-play-circle');\r\n\t\t\t\t\t\t\tif(data.response == 'success') {\r\n\t\t\t\t\t\t\t\t\$('li.disabled').removeClass('disabled').find('a').attr('data-toggle','tab');\r\n\t\t\t\t\t\t\t\tcreateFileBrowser();\r\n\t\t\t\t\t\t\t\t\$('[data-target=#logout-modal]').show();\r\n\t\t\t\t\t\t\t\t\$('[data-target=#login-modal]').hide();\r\n\t\t\t\t\t\t\t\t\$('#login-modal').modal('hide');\r\n\t\t\t\t\t\t\t\t\$('#yes-login').button('reset');\r\n\t\t\t\t\t\t\t\t\$('#login-modal input').val('');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\$('#login-modal').find('h1').append(' <small>invalid username or password</small>');\r\n\t\t\t\t\t\t\t\t\$('#username').parent().addClass('has-error');\r\n\t\t\t\t\t\t\t\t\$('#password').parent().addClass('has-error');\r\n\t\t\t\t\t\t\t\t\$('#yes-login').button('reset');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\$('#login-modal').on('shown.bs.modal', function() {\r\n\t\t\t\t\t\t\$('#username').focus();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\$('#login-modal input').keypress(function(e) {\r\n\t\t\t\t\t\te.preventDefault;\r\n\t\t\t\t\t\tif(e.which == 13) \$('#yes-login').click();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\$('#yes-logout').click(function(e) {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\$.ajax('functions.php?'+key+'action=logout').done(function() {\r\n\t\t\t\t\t\t\tif(typeof key == 'undefined') {\r\n\t\t\t\t\t\t\t\twindow.location('" . LINK_ABS . "?refer=studio/manage/');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\$('[href=#info]').tab('show');\r\n\t\t\t\t\t\t\t\$('[href=#playlists]').removeAttr('data-toggle').parent().addClass('disabled');\r\n\t\t\t\t\t\t\t\$('[href=#files]').removeAttr('data-toggle').parent().addClass('disabled');\r\n\t\t\t\t\t\t\t\$('#reset').addClass('disabled');\r\n\t\t\t\t\t\t\tdestroyFileBrowser();\r\n\t\t\t\t\t\t\t\$('[data-target=#logout-modal]').hide();\r\n\t\t\t\t\t\t\t\$('[data-target=#login-modal]').show();\r\n\t\t\t\t\t\t\t\$('#logout-modal').modal('hide');\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\$(document).on('click', '#yes-clear-showplan', function() {\r\n\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\turl: 'functions.php?'+key+'action=showplan-clear',\r\n\t\t\t\t\t\t\tdataType: 'json'\r\n\t\t\t\t\t\t}).done(function(data) {\r\n\t\t\t\t\t\t\treloadShowplan();\r\n\t\t\t\t\t\t\t\$('#clear-showplan-modal').modal('hide');\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t</script>\r\n\t\t\t" . Bootstrap::modal("clear-showplan-modal", "<h1>" . Bootstrap::glyphicon("trash") . "Clear showplan?</h1>", NULL, "\r\n\t\t\t\t<a href=\"#\" class=\"btn btn-primary btn-lg\" id=\"yes-clear-showplan\">Yes</a>\r\n\t\t\t\t<a href=\"#\" class=\"btn btn-default btn-lg\" id=\"no-clear-showplan\" data-dismiss=\"modal\">No</a>") . "\r\n\t\t\t" . Bootstrap::modal("logout-modal", "<h1>" . Bootstrap::glyphicon("remove-circle") . " Log out?</h1>", NULL, "\r\n\t\t\t\t<a href=\"#\" class=\"btn btn-primary btn-lg\" id=\"yes-logout\">Yes</a>\r\n\t\t\t\t<a href=\"#\" class=\"btn btn-default btn-lg\" id=\"no-logout\" data-dismiss=\"modal\">No</a>") . "\r\n\t\t\t" . Bootstrap::modal("reset-modal", "\r\n\t\t\t\tThis will turn the touchscreen off and on again, stopping any currently playing audio! Only use as a last resort whilst talking!", "<span id=\"reset-icon\">" . Bootstrap::glyphicon("refresh") . "</span> Reset Playout " . $location->get_id() . "?", "\r\n\t\t\t\t<a href=\"#\" class=\"btn btn-primary btn-lg\" id=\"yes-reset\">Yes</a>\r\n\t\t\t\t<a href=\"#\" class=\"btn btn-default btn-lg\" id=\"no-reset\" data-dismiss=\"modal\">No</a>") . "\r\n\t\t\t" . Bootstrap::modal("login-modal", "<h1>" . Bootstrap::glyphicon("play-circle") . " Log In</h1>", NULL, "\r\n\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t<div class=\"input-group\">\r\n\t\t\t\t\t\t<span class=\"input-group-addon\">" . Bootstrap::glyphicon("user") . "</span>\r\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control input-lg\" placeholder=\"Username\" id=\"username\" autocomplete=\"off\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t<div class=\"input-group\">\r\n\t\t\t\t\t\t<span class=\"input-group-addon\">" . Bootstrap::glyphicon("lock") . "</span>\r\n\t\t\t\t\t\t<input type=\"password\" class=\"form-control input-lg\" placeholder=\"Password\" id=\"password\" autocomplete=\"off\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<a href=\"#\" class=\"btn btn-primary btn-lg\" id=\"yes-login\" data-role=\"button\" data-loading-text=\"Log in\">Log in</a>\r\n\t\t\t\t<a href=\"#\" class=\"btn btn-default btn-lg\" id=\"no-login\" data-dismiss=\"modal\">Cancel</a>") . "\r\n\t\t</div>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\t\$('#yes-reset').click(function(){\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '../../ajax/restart_playout" . $location->get_id() . ".php',\r\n\t\t\t\t\tbeforeSend: function() {\r\n    \t\t\t\t\t\$('#yes-reset').html(\"Resetting...\");\r\n \t\t\t\t\t},\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\treturn(false);\r\n\t\t\t});\r\n\t\t</script>\r\n\t";
示例#13
0
<?php

Output::set_title("Jingle Packages");
MainTemplate::set_subtitle("Create and manage groups of jingles");
Output::add_script(LINK_ABS . 'js/bootbox.min.js');
Output::add_script(LINK_ABS . 'js/bootstrap.typeahead.min.js');
Output::require_group("Files Admin");
if (isset($_GET['archive']) && ($package = JinglePackages::get_by_id($_GET['archive']))) {
    if ($package->get_archived() == false) {
        $package->set_archived(true);
    } else {
        $package->set_archived(false);
    }
    $package->save();
} else {
    if (isset($_GET['delete']) && ($package = JinglePackages::get_by_id($_GET['delete']))) {
        $package->delete();
    }
}
if (isset($_GET['show_archived']) && $_GET['show_archived'] == 'true') {
    $show_archived = true;
} else {
    $show_archived = false;
}
?>
<script>

$().ready(function() {
	<?php 
echo $show_archived ? 'var archive_str = \'&show_archived=true\';' : 'var archive_str = \'\';';
?>
示例#14
0
<?php

Output::set_title("Music Library");
echo "<script>\r\n\t\$(function () {\r\n\t\t\$('.track-info').popover({\r\n\t\t\t'html': true, \r\n\t\t\t'trigger': 'hover',\r\n\t\t\t'title': function() { \r\n\t\t\t\treturn(\$(this).parent().parent().find('.title').html())\r\n\t\t\t},\r\n\t\t\t'content': function() {\r\n\t\t\t\treturn(\$(this).parent().find('.hover-info').html());\r\n\t\t\t}\r\n\t\t});\r\n\r\n" . (Session::is_group_user("Playlist Editor") ? "\r\n\t\tvar item;\r\n\t\t\$('.playlist-add').click(function() {\r\n\t\t\titem = \$(this).parent().parent();\r\n\t\t\tplaylists = \$(this).attr('data-playlists-in').split(',');\r\n\t\t\t\$('.playlist-select').parent().removeClass('active');\r\n\t\t\t\$('.playlist-select').find('span').removeClass('glyphicon-minus').addClass('glyphicon-plus');\r\n\t\t\t\$('.playlist-select').each(function() {\r\n\t\t\t\tif(\$.inArray(\$(this).attr('data-playlist-id'),playlists) > -1) {\r\n\t\t\t\t\t\$(this).find('span').removeClass('icon-plus').addClass('glyphicon-minus');\r\n\t\t\t\t\t\$(this).parent().addClass('active');\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t\t\$('.playlist-select').click(function() {\r\n\t\t\tobj = \$(this);\r\n\t\t\tif(\$(this).parent().hasClass('active')) {\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-minus').addClass('glyphicon-refresh');\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\r\n\t\t\t\t\tdata: 'trackid='+item.attr('id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=del',\r\n\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\tvalues = \$.parseJSON(data);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\r\n\t\t\t\t\t\tobj.parent().removeClass('active');\r\n\t\t\t\t\t\titem.find('.playlist-add').attr('data-playlists-in',values.playlists.join(','));\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-refresh');\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\r\n\t\t\t\t\tdata: 'trackid='+item.attr('id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=add',\r\n\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\tvalues = \$.parseJSON(data);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\r\n\t\t\t\t\t\tobj.parent().addClass('active');\r\n\t\t\t\t\t\titem.find('.playlist-add').attr('data-playlists-in',values.playlists.join(','));\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\$(this).parent().addClass('active');\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-minus');\r\n\t\t\t}\r\n\t\t});\t\t\r\n" : "") . (Session::is_group_user("Librarian") ? "\r\n\t\tvar trackid;\r\n\t\t\$('.track-delete').click(function() {\r\n\t\t\t\$('.delete-track-title').html(\$(this).parent().parent().find('.title').html());\r\n\t\t\ttrackid = \$(this).attr('data-dps-id');\r\n\t\t});\r\n\r\n\t\t\$('.yes-definitely-delete').click(function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/delete-track.php',\r\n\t\t\t\tdata: 'id='+trackid,\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\talert(value.error);\r\n\t\t\t\t},\r\n\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n" : "") . "\t});\r\n</script>";
MainTemplate::set_subtitle("Add and remove tracks, edit track details");
if (($flagged = Tracks::get_flagged()) && Session::is_group_user("Censor")) {
    echo Bootstrap::alert_message_basic("warning", "<a href=\"" . LINK_ABS . "music/censor\">Click here to view them.</a>", "Tracks have been flagged for censorship.");
}
echo "\r\n<div class=\"row\">\r\n\t<div class=\"col-sm-5\">\r\n\t<h3>Library Statistics</h3>\r\n\t\t<dl>\r\n\t\t\t<dt>Tracks Stored</dt>\r\n\t\t\t<dd>" . number_format(Tracks::get_total_tracks()) . "</dd>\r\n\t\t\t<dt>Length of Tracks</dt>\r\n\t\t\t<dd>" . Time::format_pretty(Tracks::get_total_length()) . "</dd>\r\n\t\t\t<dt>Playlisted Tracks</dt>\r\n\t\t\t<dd>" . count(Tracks::get_playlisted()) . "</dd>\r\n\t\t</dl>\r\n\t</div>\r\n\t<div class=\"col-sm-7\">\r\n\t\t<h3>Requested Tracks</h3>\r\n\t\t";
if ($requested = Requests::get_latest(3)) {
    echo "\r\n\t\t<table class=\"table table-striped table-condensed\" cellspacing=\"0\">\r\n\t\t\t<thead>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th class=\"icon\"></th>\r\n\t\t\t\t\t<th class=\"artist\">Artist</th>\r\n\t\t\t\t\t<th class=\"title\">Title</th>" . (Session::is_group_user("Requests Admin") ? "\r\n\t\t\t\t\t<th class=\"icon\"></th>" : "") . "\r\n\t\t\t\t</tr>\r\n\t\t\t</thead>";
    foreach ($requested as $request) {
        echo "\r\n\t\t\t<tr id=\"" . $request->get_id() . "\">\r\n\t\t\t\t<td class=\"icon\">\r\n\t\t\t\t\t<a href=\"#\" class=\"track-info\">\r\n\t\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\r\n\t\t\t\t\t</a>\r\n\t\t\t\t\t<div class=\"hover-info\">\r\n\t\t\t\t\t\t<strong>Artist:</strong> " . $request->get_artist_name() . "<br />\r\n\t\t\t\t\t\t<strong>Title:</strong> " . $request->get_name() . "<br />\r\n\t\t\t\t\t\t<strong>Date Requested:</strong> " . date("d/m/Y H:i", $request->get_date()) . "<br />\r\n\t\t\t\t\t\t<strong>Requester:</strong> " . $request->get_user()->get_username() . "<br />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td class=\"artist\">" . $request->get_artist_name() . "</td>\r\n\t\t\t\t<td class=\"title\">" . $request->get_name() . "</td>\r\n\t\t\t\t" . (Session::is_group_user("Requests Admin") ? "<td class=\"icon\"><a href=\"" . LINK_ABS . "music/request/delete?id=" . $request->get_id() . "\" class=\"request-delete\" title=\"Delete this request\" rel=\"twipsy\">" . Bootstrap::glyphicon("minus-sign") . "</td>" : "") . "\r\n\t\t\t</tr>";
    }
    echo "\r\n\t\t</table>";
    $total_requests = Requests::count();
    if ($total_requests <= count($requested)) {
        echo "<a href=\"" . LINK_ABS . "music/request\">&raquo; Go to requests</a>";
    } else {
        echo "<a href=\"" . LINK_ABS . "music/request\">&raquo; See " . ($total_requests - count($requested)) . " more requests</a>";
    }
} else {
    echo "\r\n\t\t<strong>No new requested tracks.</strong><br />\r\n\t\t<a href=\"" . LINK_ABS . "music/request\">&raquo; Go to requests</a>";
}
echo "\r\n\t</div>\r\n</div>\r\n<hr />\r\n";
$tracks = Tracks::get_newest();
if ($tracks) {
    echo "<h3>10 newest tracks</h3>";
    echo "<div class=\"table-responsive\"><table class=\"table table-striped\" cellspacing=\"0\">\r\n\t<thead>\r\n\t\t<tr>\r\n\t\t\t<th class=\"icon\"> </th>\r\n\t\t\t<th class=\"artist\">Artist</th>\r\n\t\t\t<th class=\"title\">Title</th>\r\n\t\t\t<th class=\"date-added nowrap\">Date Added</th>\r\n\t\t\t<th class=\"length nowrap\">Length</th> \r\n\t\t\t" . (Session::is_group_user("Playlist Editor") ? "<th class=\"icon\"></th>" : "") . "\r\n\t\t\t" . (Session::is_group_user("Librarian") ? "<th class=\"icon\"></th>" : "") . "\r\n\t\t</tr>\r\n\t</thead>";
    foreach ($tracks as $track) {
        $import_date = date("d/m/Y H:i", $track->get_import_date());
示例#15
0
<?php

Output::set_title("My Files");
MainTemplate::set_subtitle("Browse and manage files in the database");
Output::add_stylesheet(LINK_ABS . "css/ui.fancytree.css");
Output::add_script(LINK_ABS . "js/jquery-ui-1.10.3.custom.min.js");
Output::add_script(LINK_ABS . "js/jquery.fancytree.js");
Output::add_script(LINK_ABS . "js/jquery.fancytree.glyphicon.js");
/*echo("
	<script>
		$().ready(function() {
			$('#files').fancytree({ 
				source: { url: '".LINK_ABS."ajax/file-tree.php?id=1', cache: false },
				extensions: ['glyphicon'],
				lazyload: function(event, data) {
					var node = data.node;
					data.result = {	url: '".LINK_ABS."ajax/file-tree.php?id='+node.data.id }
				}
			});
		});
	</script>

	<div id=\"files\"></div>"
);*/
?>

<em>Coming soon!</em>
示例#16
0
<?php

Output::set_title("Playlists");
Output::add_script(LINK_ABS . "js/jquery-ui-1.10.3.custom.min.js");
MainTemplate::set_subtitle("View and edit music playlists");
echo "<script type=\"text/javascript\">\n\$(function() {\n\t\$('.table-striped tbody').sortable({ \n\t\taxis: 'y',\n\t\thandle: '.move',\n\t\thelper: function(e, tr){\n\t\t\tvar originals = tr.children();\n\t\t\tvar helper = tr.clone();\n\t\t\thelper.children().each(function(index) {\n\t\t\t\t\$(this).width(originals.eq(index).width())\n\t\t\t});\n\t\t\treturn helper;\n\t\t},\n\t\tupdate : function () { \n\t\t\t\$('.move').removeClass('.glyphicon-move').addClass('.glyphicon-refresh');\n            \$.ajax({\n                type: 'POST',\n                url: '" . LINK_ABS . "/ajax/update-playlist-sortorder.php',\n                data: \$('.sortorder').serialize(),\n                success: function(data) {\n                \tif(data != 'success') {\n                \t\t\$('.sortorder').before('" . Bootstrap::alert_message_basic("error", "'+data+'", "Error!") . "');\n                \t\t\$('.alert-message').alert();\n                \t}\n                \t\$('.move').removeClass('.glyphicon-refresh').addClass('.glyphicon-move');\n                }\n            });\n        }\n\t}).disableSelection();\n\n\t\$('.info').popover({\n\t\t'html': true, \n\t\t'trigger': 'hover',\n\t\t'title': function() { \n\t\t\treturn(\$(this).parent().parent().find('.title').html()+' tracks')\n\t\t},\n\t\t'content': function() {\n\t\t\treturn(\$(this).parent().find('.hover-info').html());\n\t\t}\n\t});\n\tif(window.location.hash == '#add') {\n\t\t\$('#add').click();\n\t}\n\t\$('a[href=\"" . LINK_ABS . "playlists/index.php#add\"]').click(function() {\n\t\tevent.preventDefault();\n\t\t\$('#add').click();\n\t});\n" . (Session::is_group_user("Playlist Admin") ? "\n\t\tvar playlist_id;\n\t\t\$('.delete-playlist').click(function() {\n\t\t\t\$('.delete-playlist-title').html(\$(this).parent().parent().find('.title').html());\n\t\t\tplaylist_id = \$(this).attr('data-dps-id');\n\t\t});\n\n\t\t\$('.edit-playlist').click(function() {\n\t\t\t\$('.playlist-edit-name').val(\$(this).parent().parent().find('.title').html());\n\t\t\t\$('.update-id').val(\$(this).attr('data-dps-id'));\n\t\t});\n\n\t\t\$('.yes-definitely-delete').click(function() {\n\t\t\t\$.ajax({\n\t\t\t\turl: '" . LINK_ABS . "ajax/delete-playlist.php',\n\t\t\t\tdata: 'id='+playlist_id,\n\t\t\t\ttype: 'POST',\n\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\talert(value.error);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\twindow.location.reload(true); \n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t\$('.add-playlist').click(function() {\n\t\t\t\$.ajax({\n\t\t\t\turl: '" . LINK_ABS . "ajax/add-update-playlist.php',\n\t\t\t\tdata: 'name='+\$('.playlist-name').val(),\n\t\t\t\ttype: 'POST',\n\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\talert(value.error);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\twindow.location.reload(true); \n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t\$('.playlist-name').keypress(function(e) { if(e.keyCode == 13) { e.preventDefault(); \$('.add-playlist').click(); }});\n\n\n\n\t\t\$('.update-playlist').click(function() {\n\t\t\t\$.ajax({\n\t\t\t\turl: '" . LINK_ABS . "ajax/add-update-playlist.php',\n\t\t\t\tdata: 'id='+\$('.update-id').val()+'&name='+\$('.playlist-edit-name').val(),\n\t\t\t\ttype: 'POST',\n\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\talert(value.error);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\twindow.location.reload(true); \n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t\$('.playlist-edit-name').keypress(function(e) { if(e.keyCode == 13) { e.preventDefault(); \$('.update-playlist').click(); }});\n" : "") . "});\n</script>";
echo "<h3>Current playlists:</h3>";
echo "\n<form class=\"sortorder\">\n<div class=\"table-responsive\">\n<table class=\"table table-striped\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th>Title</th>\n\t\t\t<th class=\"icon\">Items</th>\n\t\t\t";
if (Session::is_group_user("Playlist Admin")) {
    echo "\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th class=\"icon\"></th>\n\t";
}
echo "\n\t\t</tr>\n\t</thead>\n\t<tbody>\n";
foreach (Playlists::get_all(false) as $playlist) {
    echo "\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t<a href=\"" . LINK_ABS . "playlists/detail/" . $playlist->get_id() . "\" class=\"info\">\n\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"" . $playlist->get_id() . "\">\n\t\t\t\t</a>\n\t\t\t\t<div class=\"hover-info\">\n\t\t\t\t";
    $count = $playlist->count_tracks();
    foreach ($playlist->get_tracks(10) as $track) {
        echo "<strong>" . $track->get_title() . "</strong> by " . $track->get_artists_str() . "<br />";
    }
    if ($count > 10) {
        echo "<br />and <strong>" . ($count - 10) . " more...<br />";
    }
    echo "\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<td class=\"title\">" . $playlist->get_name() . "</td>\n\t\t\t<td>" . count($playlist->get_tracks()) . "</td>\n\t";
    if (Session::is_group_user("Playlist Admin")) {
        echo "\n\t\t\t<td>\n\t\t\t\t<a href=\"#\" data-toggle=\"modal\" data-target=\"#update-modal\" data-dps-id=\"" . $playlist->get_id() . "\" class=\"edit-playlist\" title=\"Edit playlist name\" rel=\"twipsy\">\n\t\t\t\t\t" . Bootstrap::glyphicon("pencil") . "\n\t\t\t\t</a>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<a href=\"#\" data-toggle=\"modal\" data-target=\"#delete-modal\" data-dps-id=\"" . $playlist->get_id() . "\" class=\"delete-playlist\" title=\"Delete this playlist\" rel=\"twipsy\">\n\t\t\t\t\t" . Bootstrap::glyphicon("remove-sign") . "\n\t\t\t\t</a>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<a href=\"#\" class=\"move\">\n\t\t\t\t\t" . Bootstrap::glyphicon("move move") . "\n\t\t\t\t</a>\n\t\t\t</td>\n\t\t";
    }
    echo "\n\t\t</tr>";
}
echo "\n\t</tbody>\n</table>\n</div>\n</form>\n";
if (Session::is_group_user("Playlist Admin")) {
    echo "<h3>Sustainer playlists:</h3>";
    echo "\n\t<div class=\"table-responsive\">\n\t<table class=\"table table-striped\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th class=\"icon\"></th>\n\t\t\t\t<th>Title</th>\n\t\t\t\t<th class=\"icon\">Items</th>\n\t\t\t\t<th class=\"icon\"></th>\n\t\t\t\t<th class=\"icon\"></th>\n\t\t\t\t<th class=\"icon\"></th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t";
示例#17
0
<?php

Output::set_title("Group Administration");
MainTemplate::set_subtitle("View and edit groups");
Output::require_group("Group Admin");
function print_groups($group)
{
    $groups = Groups::get_by_parent($group);
    if ($groups) {
        echo "<ul>";
        foreach ($groups as $group) {
            echo "<li data-group-id=\"" . $group->get_id() . "\" data-description=\"" . $group->get_description() . "\">" . $group->get_name() . "</li>";
            print_groups($group);
        }
        echo "</ul>";
    }
}
echo "\r\n\t<script>\r\n\t\$(document).ready(function() {\r\n\t\t\$(document).on('click', '#groups li', function() {\r\n\t\t\t\$('#group-info h3').html(\$(this).html());\r\n\t\t\t\$('#group-description').html(\$(this).attr('data-description'));\r\n\t\t\t\$('#group-info').attr('data-group-id',\$(this).attr('data-group-id'));\r\n\t\t\t\$('#group-members ul').html('');\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/group-admin.php?action=members&group='+\$(this).attr('data-group-id'),\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t}).done(function(data) {\r\n\t\t\t\t\$.each(data, function(id,user) {\r\n\t\t\t\t\t\$('#group-members ul').append('<li class=\"list-group-item\" data-user-id=\"'+id+'\">'+user+'" . Bootstrap::glyphicon("remove pull-right") . "</li>');\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t\t\$(document).on('click', '.glyphicon-remove', function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/group-admin.php?action=del-user&user='******'data-user-id')+'&group='+\$(this).parents('#group-info').attr('data-group-id'),\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t}).done(function(data) {\r\n\t\t\t\t\$.each(data, function(id,user) {\r\n\t\t\t\t\t\$('[data-user-id='+id+']').remove();\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t\t\$(document).on('submit', '.form-horizontal', function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/group-admin.php?action=add-user&user='******'input').val()+'&group='+\$(this).parents('#group-info').attr('data-group-id'),\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t}).done(function(data) {\r\n\t\t\t\t\$('input').val('');\r\n\t\t\t\t\$.each(data, function(id,user) {\r\n\t\t\t\t\t\$('#group-members ul').append('<li class=\"list-group-item\" data-user-id=\"'+id+'\">'+user+'" . Bootstrap::glyphicon("remove pull-right") . "</li>');\r\n\t\t\t\t})\r\n\t\t\t});\r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\t\$('#groups').find('li:first').click();\r\n\t});\r\n\t</script>\r\n\r\n\t<div class=\"row\">\r\n\t\t<div class=\"col-md-6\">\r\n\t\t\t<h3>Group tree</h3>\r\n\t\t\t<div id=\"groups\">\r\n";
print_groups(NULL);
echo "\r\n\t\t</div>\r\n\t</div>\r\n\t<div class=\"col-md-6\">\r\n\t\t<div id=\"group-info\">\r\n\t\t\t<h3></h3>\r\n\t\t\t<div id=\"group-description\"></div>\r\n\t\t\t<h4>Members:</h4>\r\n\t\t\t<div id=\"group-members\">\r\n\t\t\t\t<ul class=\"list-group\">\r\n\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\r\n\t\t\t<form class=\"form-horizontal\">\r\n\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t<div class=\"col-xs-9\">\r\n\t\t\t\t\t\t<input type=\"text\" id=\"add-user\" class=\"form-control\" placeholder=\"Add user...\" />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary col-xs-3\" id=\"add-user-submit\">Add</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n";
示例#18
0
require_once 'pre.php';
Output::set_title("Audiowall:");
MainTemplate::set_sidebar(NULL);
Output::add_script("../js/jquery-ui-1.10.3.custom.min.js");
Output::add_script("aw.js");
Output::add_less_stylesheet("aw.less");
Output::add_stylesheet("aw.css");
$aw_set = AudiowallSets::get((int) $_REQUEST['id']);
if ($aw_set == null) {
    exit;
}
//var_dump($aw_set);
$aw_walls = $aw_set->get_walls();
//var_dump($aw_walls);
$styles = AudiowallStyles::get_all();
Output::set_title("Audiowall:<br /><span id=\"wall-name\" data-dps-set-id=\"" . $aw_set->get_id() . "\">" . $aw_set->get_name() . "</span>");
MainTemplate::set_subtitle("<span id=\"wall-description\">" . $aw_set->get_description() . "</span><span id=\"aw_edit_buttons\"><p class=\"text-success\">Changes saved!</p><a href=\"#\" class=\"btn btn-primary\">Edit</a><a href=\"#\" class=\"btn btn-success\">Save</a></span>");
?>
<div class="row">
  <div class="col-md-12">
  </div>
  <div class="col-md-5">
    <div class="list-group" id="walls-tabs">
       <?php 
$w = 0;
foreach ($aw_walls as $wall) {
    echo "<a id=\"walls-tab\" href=\"#page" . $wall->get_page() . "\" data-toggle=\"tab\" data-dps-wall-page=\"" . $wall->get_page() . "\" data-dps-wall-id=\"" . $wall->get_id() . "\" class=\"list-group-item";
    if ($w == 0) {
        echo " list-group-item-info";
    }
    echo "\">";
示例#19
0
<?php

Output::set_title("System Information");
Output::add_stylesheet(LINK_ABS . "faults/comment.css");
MainTemplate::set_subtitle("View updates and report faults");
$faults = Faults::get(NULL, Session::get_id());
foreach ($faults as $fault) {
    $title = "<b>Fault ID: DIGI_" . $fault->get_id() . " </b><small>Assigned to: " . $fault->get_real_assignedto($fault->get_assignedto()) . "</small><span class=\"pull-right label label-" . $fault->get_panel_class() . "\">" . $fault->get_real_status() . "</span>";
    $footer = "<a data-toggle=\"modal\" href=\"#add-comment\" class=\"btn btn-primary btn-xs new-comment\" data-dps-id=" . $fault->get_id() . ">Add Comment</a>";
    if (Comments::get_fault_comments($fault->get_id()) != 0) {
        $footer .= "<span class=\"pull-right\"><a class=\"accordion-toggle\" data-toggle=\"collapse\" href=\"#collapse-" . $fault->get_id() . "\">" . Bootstrap::glyphicon("plus") . "</a></span></div><div id=\"collapse-" . $fault->get_id() . "\" class=\"panel-collapse collapse\"><div class=\"panel-body\">";
        $comments = Comments::get_by_fault($fault->get_id());
        foreach ($comments as $comment) {
            if ($comment->get_author() == -1) {
                $footer .= "<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-md-6 col-md-offset-3\"><hr></div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t\t  \r\n\t\t\t\t\t\t\t  <div class=\"col-md-8 col-md-offset-2 system-comment\"><b style=\"color: #f0ad4e;\">System:</b> " . $comment->get_comment() . "<br><span>" . $comment->get_postdate() . "</span></div>\t\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-md-6 col-md-offset-3\"><hr></div>\r\n\t\t\t\t\t\t</div>";
            } else {
                if ($comment->get_author() == $fault->get_author()) {
                    $footer .= "\r\n\t\t    \t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t" . $comment->get_comment() . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"panel-footer\"><span class=\"glyphicon glyphicon-time fault-time\" aria-hidden=\"true\"></span>" . $comment->get_postdate() . "<span class=\"glyphicon glyphicon-user fault-user\" aria-hidden=\"true\"></span>" . $comment->get_real_author($comment->get_author()) . "<span class=\"label label-success\">Customer</span></div>\r\n\t\t\t\t</div>\r\n\t\t\t\t";
                } else {
                    $footer .= "\t\t    \t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t" . $comment->get_comment() . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"panel-footer\"><span class=\"glyphicon glyphicon-time fault-time\" aria-hidden=\"true\"></span>" . $comment->get_postdate() . "<span class=\"glyphicon glyphicon-user fault-user\" aria-hidden=\"true\"></span>" . $comment->get_real_author($comment->get_author()) . "<span class=\"label label-danger\">Developer</span></div>\r\n\t\t\t\t</div>";
                }
            }
        }
        $footer .= "</div>";
    }
    $body = "<p><i>Submitted by: <b>" . $fault->get_real_author($fault->get_author()) . "</b> on: <b>" . $fault->get_postdate() . "</b></i><hr></p>\r\n\t<p>" . $fault->get_content() . "</p>";
    echo Bootstrap::panel($fault->get_panel_class(), $body, $title, $footer);
}
$title = "<span id=\"comment-status-title\">Add a comment to the fault DIGI_</span>";
$body = "<form role=\"form\">\r\n  <div class=\"form-group\">\r\n  \t<input type=\"hidden\" class=\"fault-comment-id\">\r\n    <textarea class=\"form-control fault-comment-value\" rows=\"3\"></textarea>\r\n  </div>\r\n  <div class=\"form-group\">\r\n  <button type=\"submit\" class=\"btn btn-primary confirm-fault-comment\">Add Comment</button>\r\n  <a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>\r\n  </div>\r\n</form>";
echo Bootstrap::modal("add-comment", $body, $title);
示例#20
0
<?php

require_once 'pre.php';
Output::set_title("Playout Reset");
if (Session::is_group_user("Studio Admin")) {
    echo "<div class=\"row\">\n\t<div class=\"col-md-3 list-group\">\n\t\t<a href=\"./studio/manage?location=1\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-check\"></span> Manage Studio 1</a>\n\t\t<a href=\"./studio/manage?location=2\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-check\"></span> Manage Studio 2</a>\n\t</div>\n\t<div class=\"col-md-4 jumbotron\">\n\t\t<h1>Reset Playout 1</h1>\n\t\t<button id=\"playout1\" type=\"button\" class=\"btn btn-danger col-md-12\">Reset</button>\n\t</div>\n\t<div class=\"col-md-1\"></div>\n\t<div class=\"col-md-4 jumbotron\">\n\t\t<h1>Reset Playout 2</h1>\n\t\t<button id=\"playout2\" type=\"button\" class=\"btn btn-danger col-md-12\">Reset</button>\n\t</div>\n</div>";
    echo "<script type=\"text/javascript\">\n\$('#playout1').click(function(){\n\t\$.ajax({\n\t\turl: './ajax/restart_playout1.php',\n\t\terror: function(xhr,text,error) {\n\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\talert(value.error);\n\t\t},\n\t\tsuccess: function(data,text,xhr) {\n\t\t\twindow.location.reload(true); \n\t\t}\n\t});\n\treturn(false);\n});\n\$('#playout2').click(function(){\n\t\$.ajax({\n\t\turl: './ajax/restart_playout2.php',\n\t\terror: function(xhr,text,error) {\n\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\talert(value.error);\n\t\t},\n\t\tsuccess: function(data,text,xhr) {\n\t\t\twindow.location.reload(true); \n\t\t}\n\t});\n\treturn(false);\n});\n</script>";
}
示例#21
0
<?php

Output::set_title("Sustainer Control Centre");
Output::add_script(LINK_ABS . "js/jquery-ui-1.10.3.custom.min.js");
Output::require_group("Sustainer Admin");
MainTemplate::set_subtitle("Perform common sustainer tasks");
if (isset($_POST['trackid']) || isset($_GET['trackid'])) {
    $query = "SELECT * FROM audio WHERE id=:trackid";
    $parameters = array(':trackid' => $_REQUEST['trackid']);
    $result = DigiplayDB::query($query, $parameters);
    if ($result->rowCount() != 1) {
        echo Bootstrap::alert_message_basic("danger", "Couldn't find track ID in the digiplay audio DB.");
    } else {
        $track = $result->fetch();
        $query = "SELECT * FROM sustschedule order by id asc limit 1";
        $result = DigiplayDB::query($query);
        $scheduleslot = $result->fetch();
        if ($track['id'] != $scheduleslot['audioid']) {
            $query = "UPDATE sustschedule SET audioid=:trackid, trim_start_smpl=0, trim_end_smpl = :tracklength, fade_in = 0, fade_out = :tracklength WHERE id = :scheduleslot";
            $parameters = array(':trackid' => $track['id'], ':tracklength' => $track['length_smpl'], ':scheduleslot' => $scheduleslot['id']);
            DigiplayDB::query($query, $parameters);
            $query = "INSERT INTO sustlog (audioid,userid,timestamp) VALUES (:audioid,:userid,:timestamp)";
            date_default_timezone_set("Europe/London");
            $parameters = array(':audioid' => $track['id'], ':userid' => Session::get_id(), ':timestamp' => time());
            DigiplayDB::query($query, $parameters);
            echo Bootstrap::alert_message_basic("info", "Track Scheduled.");
        } else {
            echo Bootstrap::alert_message_basic("warning", "This track is already at the top of the queue.");
        }
    }
}
示例#22
0
<?php

Output::set_title("Censored Tracks");
echo "<script>\n\t\$(function () {\n\t\t\$('.track-info').popover({\n\t\t\t'html': true, \n\t\t\t'trigger': 'hover',\n\t\t\t'title': function() { \n\t\t\t\treturn(\$(this).parent().parent().find('.title').html())\n\t\t\t},\n\t\t\t'content': function() {\n\t\t\t\treturn(\$(this).parent().find('.hover-info').html());\n\t\t\t}\n\t\t});\n\t});\n</script>";
MainTemplate::set_subtitle("Heard some naughty words? Censor tracks so their playout is restricted");
if (isset($_REQUEST["censor"]) && is_numeric($_REQUEST["censor"])) {
    if (!Session::is_group_user("Censor")) {
        trigger_error("You are trying to censor a track, but you do not have the required privileges!");
    } else {
        $track = Tracks::get_by_id($_REQUEST["censor"]);
        if ($track) {
            $track->set_censored(true);
            $track->set_flagged(false);
            $track->save();
            echo Bootstrap::alert("success", "The track " . $track->get_title() . " by " . $track->get_artists_str() . " has been censored.", "Track censored!");
        } else {
            trigger_error("The track you are trying to censor doesn't exist!");
        }
    }
}
if (isset($_REQUEST["uncensor"]) && is_numeric($_REQUEST["uncensor"])) {
    if (!Session::is_group_user("Censor")) {
        trigger_error("You are trying to uncensor a track, but you do not have the required privileges!");
    } else {
        $track = Tracks::get_by_id($_REQUEST["uncensor"]);
        if ($track) {
            $track->set_censored(false);
            $track->save();
            echo Bootstrap::alert("success", "The track " . $track->get_title() . " by " . $track->get_artists_str() . " has been uncensored.", "Track uncensored!");
        } else {
            trigger_error("The track you are trying to uncensor doesn't exist!");
示例#23
0
<?php

require_once 'pre.php';
Output::set_title("Audiowalls");
$sets = AudiowallSets::get_all();
$active = DigiplayDB::select("\"val\" FROM \"public\".\"usersconfigs\" WHERE \"userid\" = '" . Session::get_id() . "' AND \"configid\" = '1'");
?>
<style type="text/css">
table { font-size:1.2em; }
thead { display:none; }
.description { font-size:0.8em; font-style:italic; }
.hover-info { display:none; }
.table tbody tr.success td { background-color: #DFF0D8; }
</style>
<?php 
echo "\t<div class=\"row\"><div class=\"col-md-3\"><div class=\"well\"><p><a href=\"#\" class=\"btn btn-success\" id=\"create\">Create New Audiowall</a></p><p>An Audiowall is a 3x4 grid of buttons in Digiplay which play audio when pressed. They are displayed on the right hand side of the touchscreen in the studio. The top audiowall is set for everyone and contains core station imaging, promos and beds. The bottom audiowall can be set on this page, and may contain jingles and other audio specific to your show.</p></div></div><div class=\"col-md-9\">\t<table class=\"table table-striped\" cellspacing=\"0\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th></th>\n\t\t\t\t\t<th>Name</th>\n\t\t\t\t\t<th style=\"width:65px\"></th>\n\t\t\t\t\t<th style=\"width:185px\"></th>\n\t\t\t\t</tr>\n\t\t\t</thead><tbody>";
foreach ($sets as $set) {
    if (!$set->user_can_view() && !Session::is_group_user('Audiowalls Admin')) {
        continue;
    }
    echo "<tr" . ($set->get_id() == $active ? ' class="success"' : '') . "><td class=\"wall-info\" >";
    if ($set->user_can_delete()) {
        echo "<a href=\"users/users-viewers.php?setid=" . $set->get_id() . "\">" . Bootstrap::glyphicon("info-sign") . "</a>";
    }
    echo "</td><td><strong>" . $set->get_name() . "</strong><br /><span class=\"description\">" . $set->get_description() . "</span></td>";
    $station_aw = DigiplayDB::select("val FROM configuration WHERE parameter = 'station_aw_set' AND location = '1'");
    if (!($set->get_id() == (int) $station_aw)) {
        if ($set->user_can_delete() || Session::is_group_user('Audiowalls Admin')) {
            echo "<td class=\"delete-aw-btn\" data-aw-name=\"" . $set->get_name() . "\" data-dps-set-id=\"" . $set->get_id() . "\" style=\"width:65px\"><a href=\"#\" class=\"btn btn-danger\">Delete</a></td>";
        } else {
            echo "<td style=\"width:65px\"></td>";
示例#24
0
<?php

Output::set_title("Playlist Detail");
$playlist = Playlists::get_by_id($_REQUEST['q']);
$limit = isset($_GET['n']) ? $_REQUEST['n'] : 10;
$page = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1;
MainTemplate::set_subtitle("List tracks on a playlist, remove tracks");
$tracks = $playlist->get_tracks($limit, ($page - 1) * $limit);
if ($tracks) {
    $pages = new Paginator();
    $pages->items_per_page = $limit;
    $pages->querystring = $playlist->get_id();
    $pages->mid_range = 5;
    $pages->items_total = $playlist->count_tracks();
    $pages->paginate();
    $low = ($page - 1) * $limit + 1;
    $high = $low + $limit - 1 > $pages->items_total ? $pages->items_total : $low + $limit - 1;
    echo "<script>\r\n\t\t\$(function () {\r\n\t\t\t\$('.track-info').popover({\r\n\t\t\t\t'html': true, \r\n\t\t\t\t'trigger': 'hover',\r\n\t\t\t\t'title': function() { \r\n\t\t\t\t\treturn(\$(this).parent().parent().find('.title').html())\r\n\t\t\t\t},\r\n\t\t\t\t'content': function() {\r\n\t\t\t\t\treturn(\$(this).parent().find('.hover-info').html());\r\n\t\t\t\t}\r\n\t\t\t});\r\n" . (Session::is_group_user("Playlist Editor") ? "\r\n\t\t\t\$('.track-remove').click(function() {\r\n\t\t\t\ttrackid = \$(this).attr('data-dps-track-id');\r\n\t\t\t\tplaylistid = \$(this).attr('data-dps-playlist-id');\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\r\n\t\t\t\t\tdata: 'playlistid='+playlistid+'&trackid='+trackid+'&action=del',\r\n\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n" : "") . "\t\t});\r\n\t</script>";
    echo "<h3>Tracks on playlist '" . $playlist->get_name() . "'</h3>";
    echo "<div class=\"row\"><div class=\"col-lg-5\"><h5>Showing results " . $low . " to " . $high . "</h5></div><div class=\"pull-right\">" . $pages->display_jump_menu() . $pages->display_items_per_page() . "</div></div>";
    echo "<table class=\"table table-striped\" cellspacing=\"0\">\r\n\t<thead>\r\n\t\t<tr>\r\n\t\t\t<th class=\"icon\"> </th>\r\n\t\t\t<th class=\"artist\">Artist</th>\r\n\t\t\t<th class=\"title\">Title</th>\r\n\t\t\t<th class=\"album\">Album</th>\r\n\t\t\t<th class=\"length nowrap\">Length</th> \r\n\t\t\t" . (Session::is_group_user("Playlist Editor") ? "<th class=\"icon\"></th>" : "") . "\r\n\t\t</tr>\r\n\t</thead>";
    foreach ($tracks as $track) {
        echo "\r\n\t\t<tr id=\"" . $track->get_id() . "\">\r\n\t\t\t<td class=\"icon\">\r\n\t\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $track->get_id() . "\" class=\"track-info\">\r\n\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\r\n\t\t\t\t</a>\r\n\t\t\t\t<div class=\"hover-info\">\r\n\t\t\t\t\t<strong>Artist:</strong> " . $track->get_artists_str() . "<br />\r\n\t\t\t\t\t<strong>Album:</strong> " . $track->get_album()->get_name() . "<br />\r\n\t\t\t\t\t<strong>Year:</strong> " . $track->get_year() . "<br />\r\n\t\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($track->get_length()) . "<br />\r\n\t\t\t\t\t<strong>Origin:</strong> " . $track->get_origin() . "<br />\r\n\t\t\t\t\t" . ($track->get_reclibid() ? "<strong>Reclib ID:</strong> " . $track->get_reclibid() . "<br />" : "") . "\r\n\t\t\t\t\t<strong>Censored:</strong> " . ($track->is_censored() ? "Yes" : "No") . "<br /> \r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"artist\">" . $track->get_artists_str() . "</td>\r\n\t\t\t<td class=\"title\">" . $track->get_title() . "</td>\r\n\t\t\t<td class=\"album\">" . $track->get_album()->get_name() . "</td>\r\n\t\t\t<td class=\"length nowrap\">" . Time::format_succinct($track->get_length()) . "</td>";
        echo (Session::is_group_user("Playlist Editor") ? "<td class=\"icon\"><a href=\"#\" data-dps-track-id=\"" . $track->get_id() . "\" data-dps-playlist-id=\"" . $playlist->get_id() . "\" class=\"track-remove\" title=\"Remove this track\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</a></td>" : "") . "\r\n\t\t</tr>";
    }
    echo "</table>";
    echo $pages->return;
} else {
    if ($playlist) {
        echo "<h3>Sorry, no tracks are on the playlist '" . $playlist->get_name() . "'</h3>";
        if (Session::is_group_user("Playlist Editor")) {
示例#25
0
<?php

Output::set_title("Sustainer Schedule");
Output::add_script(LINK_ABS . "js/jquery-ui-1.10.3.custom.min.js");
Output::add_stylesheet(LINK_ABS . "css/select2.min.css");
Output::add_script(LINK_ABS . "js/select2.min.js");
Output::require_group("Sustainer Admin");
MainTemplate::set_subtitle("Change the schedule of the sustainer service");
echo "<style type=\"text/css\">\r\n\ttd.timeslot { text-align: center; }\r\n  </style>\r\n\r\n\r\n\t<script type=\"text/javascript\">\r\n\$(function() {\r\n\r\n\t\t\$('#update-playlist').click(function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/update-sustainer-slots.php',\r\n\t\t\t\tdata: { updateid: \$('.update-id').val(), playlistid: \$('#playlist-id').val() },\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\talert(value.error);\r\n\t\t\t\t},\r\n\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t\$('#save-prerecord').click(function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/add-update-prerecord.php',\r\n\t\t\t\tdata: { updateid: \$('.update-id').val(), prerecordid: \$('#prerecord-id').val() },\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\talert(value.error);\r\n\t\t\t\t},\r\n\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t\$('#delete-prerecord').click(function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/add-update-prerecord.php',\r\n\t\t\t\tdata: { updateid: \$('.update-id').val(), prerecordid: 0 },\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\talert(value.error);\r\n\t\t\t\t},\r\n\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t\$('#prerecord-id').select2({\r\n\t\t  ajax: {\r\n\t\t    url: '" . LINK_ABS . "ajax/prerecord-search.php',\r\n\t\t    dataType: 'json',\r\n\t\t    delay: 250,\r\n\t\t    data: function (params) {\r\n\t\t      return {\r\n\t\t        q: params.term\r\n\t\t      };\r\n\t\t    },\r\n\t\t    processResults: function (data, page) {\r\n\t\t      // parse the results into the format expected by Select2.\r\n\t\t      // since we are using custom formatting functions we do not need to\r\n\t\t      // alter the remote JSON data\r\n\t\t      return {\r\n\t\t        results: data.data\r\n\t\t      };\r\n\t\t    },\r\n\t\t    cache: true\r\n\t\t  },\r\n\t\t  escapeMarkup: function (markup) { return markup; }, // let our custom formatter work\r\n\t\t  minimumInputLength: 1,\r\n\t\t  templateResult: formatRepo, // omitted for brevity, see the source of this page\r\n\t\t  templateSelection: formatRepoSelection\r\n\t\t});\r\n\r\n\t\tfunction formatRepo (repo) {\r\n\t\t\tif (repo.loading) return repo.title;\r\n\t\t    return repo.title + ' by <i>' + repo.by + '</i>';\r\n\t\t  }\r\n\r\n\t  function formatRepoSelection (repo) {\r\n\t  \treturn repo.title;\r\n\t  }\r\n\r\n\t  \$('#playlist-id').select2()\r\n\r\n});\r\n</script>";
$colours = array('2ecc71', 'e67e22', '3498db', 'e74c3c', '9b59b6', '34495e', '1abc9c', 'f1c40f');
$timeslots = array('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23');
$slots = SustainerSlots::get_all();
$i = 0;
echo "<table class=\"table table-striped table-bordered\">\r\n\t<thead>\r\n\t<tr>\r\n\t<th></th>\r\n\t<th>Monday</th>\r\n\t<th>Tuesday</th>\r\n\t<th>Wednesday</th>\r\n\t<th>Thursday</th>\r\n\t<th>Friday</th>\r\n\t<th>Saturday</th>\r\n\t<th>Sunday</th>\r\n\t</tr>\r\n\t</thead>\r\n\t<tbody>";
$i = 0;
foreach ($slots as $slot) {
    if ($i < 1) {
        echo "<tr>\r\n\t\t\t<td>" . $slot->get_time() . ":00</td>";
    }
    $thisPlaylist = Playlists::get_by_id($slot->get_playlist_id());
    $thisPlaylistColour = $thisPlaylist->get_colour() == "" ? 'FFFFFF' : $thisPlaylist->get_colour();
    echo "<td class='timeslot' id='slot-" . $slot->get_day() . "-" . $slot->get_time() . "' style='background-color: #" . $thisPlaylistColour . ";'>";
    echo $slot->get_audio_id() == NULL ? '' : "<span class=\"glyphicon glyphicon-time\" aria-hidden=\"true\"></span>";
    echo "</td>";
    $i++;
    if ($i > 6) {
        echo "</tr>";
        $i = 0;
    }
}
echo "</tbody>\r\n\t</table>";
示例#26
0
<?php

Output::set_title("Studio Playout");
Output::add_stylesheet(LINK_ABS . "css/studio.css");
MainTemplate::set_body_class("playout");
Output::add_script(LINK_ABS . "js/observer.js");
Output::add_script(LINK_ABS . "js/wavesurfer.js");
Output::add_script(LINK_ABS . "js/webaudio.js");
Output::add_script(LINK_ABS . "js/drawer.js");
Output::add_script(LINK_ABS . "js/drawer.svg.js");
Output::add_script(LINK_ABS . "js/studio_player.js");
if (isset($_REQUEST["key"])) {
    $location = Locations::get_by_key($_REQUEST["key"]);
    $key = $_REQUEST["key"];
} else {
    if (isset($_REQUEST["location"])) {
        $location = Locations::get_by_id($_REQUEST["location"]);
        $key = $location->get_key();
    } else {
        exit("No location specified!");
    }
}
if (!isset($_REQUEST["mode"])) {
    $mode = "mp3";
} else {
    $mode = $_REQUEST["mode"];
}
echo "\r\n<script>\r\n\tvar key = 'key=" . $key . "&';\r\n\tvar timers = [];\r\n\tvar connect_timeout;\r\n\tvar websocket;\r\n\tvar connection = false;\r\n\r\n\tfunction disableLoad() {\r\n\t\t\$('.load').attr('disabled', 'disabled');\r\n\t}\r\n\r\n\tfunction enableLoad(url) {\r\n\t\t\$('.load').removeAttr('disabled');\t\r\n\t\t\$('.load').attr('data-url', url);\r\n\t}\r\n\r\n\t\$(function (){\r\n\t\tsetInterval(function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: 'functions.php?'+key+'action=check-next',\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t}).done(function(data) {\r\n\t\t\t\tif(data.response == 'true') {\r\n\t\t\t\t\tenableLoad('" . LINK_ABS . "audio/get/'+data.md5+'." . $mode . "?'+key);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdisableLoad();\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}, 1000);\r\n\t});\r\n</script>\r\n<div class=\"wrap\">\r\n\t<div class=\"container\">\r\n\t\t<div class=\"row\">\r\n\t\t\t<div class=\"col-md-7\" id=\"players\">";
for ($p = 1; $p <= 3; $p++) {
    echo "\r\n\t\t\t\t<div class=\"player\">\r\n\t\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t\t\t<script> \r\n\t\t\t\t\t\t\t\$(function () { \r\n\t\t\t\t\t\t\t\tplayer" . $p . " = wv_create('player" . $p . "');\r\n\r\n\t\t\t\t\t\t\t\t\$('#player" . $p . " .load').on('click', function(e) { \r\n\t\t\t\t\t\t\t\t\tdisableLoad();\r\n\t\t\t\t\t\t\t\t\tplayer" . $p . ".load(\$(this).attr('data-url'));\r\n\t\t\t\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\t\t\t\turl: 'functions.php?'+key+'action=load-player',\r\n\t\t\t\t\t\t\t\t\t\tdataType: 'json'\r\n\t\t\t\t\t\t\t\t\t}).done(function(data) {\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(data);\r\n\t\t\t\t\t\t\t\t\t\t\$('#player" . $p . "').find('.title').html(data.title);\r\n\t\t\t\t\t\t\t\t\t\t\$('#player" . $p . "').find('.artist').html(data.artist);\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\$('.timemode button').on('click', function() {\r\n\t\t\t\t\t\t\t\t\tif(\$(this).html() == 'ELAPSED') {\r\n\t\t\t\t\t\t\t\t\t\t\$(this).html('REMAIN');\r\n\t\t\t\t\t\t\t\t\t\t\$(this).parents('.transport').find('.elapsed').hide();\r\n\t\t\t\t\t\t\t\t\t\t\$(this).parents('.transport').find('.remain').show();\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\$(this).html('ELAPSED');\r\n\t\t\t\t\t\t\t\t\t\t\$(this).parents('.transport').find('.remain').hide();\r\n\t\t\t\t\t\t\t\t\t\t\$(this).parents('.transport').find('.elapsed').show();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t}); \r\n\t\t\t\t\t\t</script>\r\n\t\t\t\t\t\t<div class=\"panel-heading\">\r\n\t\t\t\t\t\t\t<span>Player " . $p . "</span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t\t<div class=\"row audio-player\" id=\"player" . $p . "\">\r\n\t\t\t\t\t\t\t\t<div class=\"col-xs-12\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"row meta\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-9\">\r\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"title\">Title</span><br />\r\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"artist\">Artist</span>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\r\n\t\t\t\t\t\t\t\t\t\t\t<button class=\"btn btn-info btn-block load\" disabled>Load</button>\r\n\t\t\t\t\t\t\t\t\t\t\t<button class=\"btn btn-warning btn-block load\" disabled>Log</button>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<div id=\"waveformplayer" . $p . "\" class=\"waveform\">\r\n\t\t\t\t\t\t\t\t\t\t<div id=\"progress-div\" class=\"progress progress-striped\">\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"progress-bar\">\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"transport\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-4\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<button class=\"btn btn-danger stop\" disabled>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("stop") . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<button class=\"btn btn-success playpause\" disabled>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("play") . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-5\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elapsed time\" style=\"display: none\">00:00.00</span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"remain time\">00:00.00</span>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3 timemode\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span>Time mode:</span><br />\r\n\t\t\t\t\t\t\t\t\t\t\t\t<button class=\"btn btn-primary btn-sm btn-block\">REMAIN</button>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>";
}
示例#27
0
<?php

Output::set_title("Emails to the Studio");
$limit = isset($_GET['n']) ? $_GET['n'] : 10;
$page = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1;
$emails = Emails::get(NULL, NULL, NULL, $limit, ($page - 1) * $limit);
$pages = new Paginator();
$pages->items_per_page = $limit;
$pages->mid_range = 3;
$pages->items_total = Emails::count();
$pages->paginate();
$low = ($page - 1) * $limit + 1;
$high = $low + $limit - 1 > 200 ? 200 : $low + $limit - 1;
?>
<style type="text/css">
.subject, .sender { display:block; word-wrap: break-word; width: 100%; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject { font-weight:bold; }
.sender { font-size:0.8em; }
small { display:block; margin-bottom:10px; }
#message { overflow:auto; }
tbody tr { cursor:pointer; }
.pagination { text-align: center; }
</style>
<script type="text/javascript">
$(function(){
	$('tbody tr').click(function(){
		$.getJSON('../ajax/emailmessage.php?id='+$(this).attr('data-dps-email-id'), function(data) {
			$('#message').html('<div class="panel-heading"><h4>'+data.subject+'</h4><h5>'+data.sender+'</h5></div><div class="panel-body">'+data.message+'</div>');
		});
	});
	$('#message').height($('#messagelist table').height()-20);
示例#28
0
<?php

Output::set_title("Requested Tracks");
Output::add_stylesheet(LINK_ABS . "css/music.css");
Output::add_script(LINK_ABS . "js/bootstrap-popover.js");
MainTemplate::set_subtitle("Want to play a track, but it's not in the database? Request it here");
if (isset($_REQUEST["name"]) && isset($_REQUEST["artistname"])) {
    $request = new Request();
    $request->set_name($_REQUEST["name"]);
    $request->set_artist_name($_REQUEST["artistname"]);
    $request->set_user(Session::get_user());
    $request->save();
}
if (isset($_REQUEST["delete"])) {
    if (!Session::is_group_user("Music Admin")) {
        echo Bootstrap::alert_message_basic("error", "You are trying to delete a request, but you do not have the requred privelidges!", "Error!");
    } else {
        $request = Requests::get_by_id($_REQUEST["delete"]);
        if ($request) {
            $request->delete();
        }
    }
}
echo "\n<h3 style=\"margin-top: -4px\">Request a track</h3>\n<form action=\"\" method=\"post\" name=\"request-track\" class=\"form-inline\">\n\t<div class=\"form-group\">\n\t\t<input type=\"text\" name=\"artistname\" placeholder=\"Artist...\" class=\"form-control\">\n\t</div>\n\t<div class=\"form-group\">\n\t\t<input type=\"text\" name=\"name\" placeholder=\"Title...\" class=\"form-control\">\n\t</div>\n\t<div class=\"form-group\">\n\t\t<input type=\"submit\" value=\"Request\" class=\"btn btn-primary\">\n\t</div>\n</form>";
if ($requested = Requests::get_all()) {
    echo "\n<table class=\"table table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"artist\">Artist</th>\n\t\t\t<th class=\"title\">Title</th>\n\t\t\t<th class=\"date nowrap\">Date Requested</th>\n\t\t\t<th class=\"requester nowrap\">Requester</th>\n\t\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
    foreach ($requested as $request) {
        echo "\n\t<tr id=\"" . $request->get_id() . "\">\n\t\t<td class=\"artist\">" . $request->get_artist_name() . "</td>\n\t\t<td class=\"title\">" . $request->get_name() . "</td>\n\t\t<td class=\"date nowrap\">" . date("d/m/Y H:i", $request->get_date()) . "</td>\n\t\t<td class=\"requester nowrap\">" . $request->get_user()->get_username() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"" . LINK_ABS . "music/request/?delete=" . $request->get_id() . "\" class=\"request-delete\" title=\"Delete this request\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
    }
    echo "\n</table>";
} else {
示例#29
0
<?php

Output::set_title("System Configuration");
MainTemplate::set_subtitle("View and edit system configuration settings");
echo "\n\t<table class=\"table table-striped table-hover\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th class=\"title\">Setting</th>\n\t\t\t\t<th class=\"icon\">Value</th>\n\t\t\t\t<th class=\"icon\"></th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>";
$settings = Configs::get(NULL, -1);
foreach ($settings as $setting) {
    echo "<tr>\n\t\t\t\t<td>\n\t\t\t\t\t" . $setting->get_parameter() . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<strong>" . $setting->get_val() . "</strong> <br />\n\t\t\t\t</td>\n\t\t\t\t<td class=\"icon\">\n\t\t\t\t\t\n\t\t\t\t\t  <!-- Button trigger modal -->\n\t\t\t\t\t  <a data-toggle=\"modal\" href=\"#" . $setting->get_parameter() . "\"><span class='glyphicon glyphicon-edit'></span></a>\n\n\t\t\t\t\t  <!-- Modal -->\n\t\t\t\t\t  <div class=\"modal fade\" id=\"" . $setting->get_parameter() . "\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n\t\t\t\t\t    <div class=\"modal-dialog\">\n\t\t\t\t\t      <div class=\"modal-content\">\n\t\t\t\t\t        <div class=\"modal-header\">\n\t\t\t\t\t          <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>\n\t\t\t\t\t          <h4 class=\"modal-title\">Change Value for " . $setting->get_parameter() . "</h4>\n\t\t\t\t\t        </div>\n\t\t\t\t\t        <div class=\"modal-body\">\n\t\t\t\t\t          <form role=\"form\">\n\t\t\t\t\t\t\t\t  <div class=\"form-group\">\n\t\t\t\t\t\t\t\t    <label for=\"settingUpdateText\">Value for " . $setting->get_parameter() . "</label>\n\t\t\t\t\t\t\t\t    <input type=\"text\" class=\"form-control\" id=\"settingUpdateText\" placeholder=\"Enter new value\" value=\"" . $setting->get_val() . "\">\n\t\t\t\t\t\t\t\t  </div>\n\t\t\t\t\t        </div>\n\t\t\t\t\t        <div class=\"modal-footer\">\n\t\t\t\t\t          <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n\t\t\t\t\t          <button type=\"button\" class=\"btn btn-primary\">Save changes</button>\n\t\t\t\t\t        </div>\n\t\t\t\t\t        </form>\n\t\t\t\t\t      </div><!-- /.modal-content -->\n\t\t\t\t\t    </div><!-- /.modal-dialog -->\n\t\t\t\t\t  </div><!-- /.modal -->\n\t\t\t\t</td>\n\t\t\t</tr>";
}
echo "\t\t</tbody>\n\t</table>";
示例#30
0
<?php

Output::set_title("Sustainer Playlists");
Output::add_script(LINK_ABS . "js/jquery-ui-1.10.3.custom.min.js");
MainTemplate::set_subtitle("View and edit music playlists");
echo "<script type=\"text/javascript\">\n\$(function() {\n\t\$('.table-striped tbody').sortable({ \n\t\taxis: 'y',\n\t\thandle: '.move',\n\t\thelper: function(e, tr){\n\t\t\tvar originals = tr.children();\n\t\t\tvar helper = tr.clone();\n\t\t\thelper.children().each(function(index) {\n\t\t\t\t\$(this).width(originals.eq(index).width())\n\t\t\t});\n\t\t\treturn helper;\n\t\t},\n\t\tupdate : function () { \n\t\t\t\$('.move').removeClass('.glyphicon-move').addClass('.glyphicon-refresh');\n            \$.ajax({\n                type: 'POST',\n                url: '" . LINK_ABS . "/ajax/update-playlist-sortorder.php',\n                data: \$('.sortorder').serialize(),\n                success: function(data) {\n                \tif(data != 'success') {\n                \t\t\$('.sortorder').before('" . Bootstrap::alert_message_basic("error", "'+data+'", "Error!") . "');\n                \t\t\$('.alert-message').alert();\n                \t}\n                \t\$('.move').removeClass('.glyphicon-refresh').addClass('.glyphicon-move');\n                }\n            });\n        }\n\t}).disableSelection();\n\n\t\$('.info').popover({\n\t\t'html': true, \n\t\t'trigger': 'hover',\n\t\t'title': function() { \n\t\t\treturn(\$(this).parent().parent().find('.title').html()+' tracks')\n\t\t},\n\t\t'content': function() {\n\t\t\treturn(\$(this).parent().find('.hover-info').html());\n\t\t}\n\t});\n\tif(window.location.hash == '#add') {\n\t\t\$('#add').click();\n\t}\n\t\$('a[href=\"" . LINK_ABS . "playlists/index.php#add\"]').click(function() {\n\t\tevent.preventDefault();\n\t\t\$('#add').click();\n\t});\n" . (Session::is_group_user("Playlist Admin") ? "\n\t\tvar playlist_id;\n\t\t\$('.delete-playlist').click(function() {\n\t\t\t\$('.delete-playlist-title').html(\$(this).parent().parent().find('.title').html());\n\t\t\tplaylist_id = \$(this).attr('data-dps-id');\n\t\t});\n\n\t\t\$('.edit-playlist').click(function() {\n\t\t\t\$('.playlist-edit-name').val(\$(this).parent().parent().find('.title').html());\n\t\t\t\$('.update-id').val(\$(this).attr('data-dps-id'));\n\t\t});\n\n\t\t\$('.yes-definitely-delete').click(function() {\n\t\t\t\$.ajax({\n\t\t\t\turl: '" . LINK_ABS . "ajax/delete-playlist.php',\n\t\t\t\tdata: 'id='+playlist_id,\n\t\t\t\ttype: 'POST',\n\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\talert(value.error);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\twindow.location.reload(true); \n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t\$('.add-playlist').click(function() {\n\t\t\t\$.ajax({\n\t\t\t\turl: '" . LINK_ABS . "ajax/add-update-playlist.php',\n\t\t\t\tdata: 'name='+\$('.playlist-name').val(),\n\t\t\t\ttype: 'POST',\n\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\talert(value.error);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\twindow.location.reload(true); \n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t\$('.playlist-name').keypress(function(e) { if(e.keyCode == 13) { e.preventDefault(); \$('.add-playlist').click(); }});\n\n\n\n\t\t\$('.update-playlist').click(function() {\n\t\t\t\$.ajax({\n\t\t\t\turl: '" . LINK_ABS . "ajax/add-update-playlist.php',\n\t\t\t\tdata: 'id='+\$('.update-id').val()+'&name='+\$('.playlist-edit-name').val(),\n\t\t\t\ttype: 'POST',\n\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\talert(value.error);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\twindow.location.reload(true); \n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t\$('.playlist-edit-name').keypress(function(e) { if(e.keyCode == 13) { e.preventDefault(); \$('.update-playlist').click(); }});\n" : "") . "});\n</script>";
echo "<h3>Current playlists:</h3>";
echo "\n<form class=\"sortorder\">\n<div class=\"table-responsive\">\n<table class=\"table table-striped\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th>Title</th>\n\t\t\t<th class=\"icon\">Items</th>\n\t\t\t";
if (Session::is_group_user("Playlist Admin")) {
    echo "\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th class=\"icon\"></th>\n\t";
}
echo "\n\t\t</tr>\n\t</thead>\n\t<tbody>\n";
foreach (Playlists::get_all(false) as $playlist) {
    echo "\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t<a href=\"" . LINK_ABS . "playlists/detail/" . $playlist->get_id() . "\" class=\"info\">\n\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"" . $playlist->get_id() . "\">\n\t\t\t\t</a>\n\t\t\t\t<div class=\"hover-info\">\n\t\t\t\t";
    $count = $playlist->count_tracks();
    foreach ($playlist->get_tracks(10) as $track) {
        echo "<strong>" . $track->get_title() . "</strong> by " . $track->get_artists_str() . "<br />";
    }
    if ($count > 10) {
        echo "<br />and <strong>" . ($count - 10) . " more...<br />";
    }
    echo "\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<td class=\"title\">" . $playlist->get_name() . "</td>\n\t\t\t<td>" . count($playlist->get_tracks()) . "</td>\n\t";
    if (Session::is_group_user("Playlist Admin")) {
        echo "\n\t\t\t<td>\n\t\t\t\t<a href=\"#\" data-toggle=\"modal\" data-target=\"#update-modal\" data-dps-id=\"" . $playlist->get_id() . "\" class=\"edit-playlist\" title=\"Edit playlist name\" rel=\"twipsy\">\n\t\t\t\t\t" . Bootstrap::glyphicon("pencil") . "\n\t\t\t\t</a>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<a href=\"#\" data-toggle=\"modal\" data-target=\"#delete-modal\" data-dps-id=\"" . $playlist->get_id() . "\" class=\"delete-playlist\" title=\"Delete this playlist\" rel=\"twipsy\">\n\t\t\t\t\t" . Bootstrap::glyphicon("remove-sign") . "\n\t\t\t\t</a>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<a href=\"#\" class=\"move\">\n\t\t\t\t\t" . Bootstrap::glyphicon("move move") . "\n\t\t\t\t</a>\n\t\t\t</td>\n\t\t";
    }
    echo "\n\t\t</tr>";
}
echo "\n\t</tbody>\n</table>\n</div>\n</form>\n";
if (Session::is_group_user("Playlist Admin")) {
    echo "<a href=\"#\" data-toggle=\"modal\" data-target=\"#addnew-modal\" id=\"add\">Add a new playlist &raquo;</a>" . Bootstrap::modal("addnew-modal", "\n\t\t<form class=\"form-horizontal\" action=\"" . LINK_ABS . "/ajax/add-update-playlist.php\" method=\"POST\">\n\t\t\t<fieldset>\n\t\t\t\t<div class=\"control-group\">\n\t\t\t\t\t<label class=\"control-label\" for=\"name\">Name</label>\n\t\t\t\t\t<div class=\"controls\">\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control playlist-name\" id=\"name\">\n\t\t\t\t\t\t<p class=\"help-block\">Enter a name for the new playlist.</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t</form>\n\t", "Add new playlist", "<a class=\"btn btn-primary add-playlist\" href=\"#\">Save</a><a class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</a>") . "</div>\n</div>" . Bootstrap::modal("update-modal", "\n\t\t<form class=\"form-horizontal\" action=\"" . LINK_ABS . "/ajax/add-update-playlist.php\" method=\"POST\">\n\t\t\t<fieldset>\n\t\t\t\t<div class=\"control-group\">\n\t\t\t\t\t<label class=\"control-label\" for=\"name\">Name</label>\n\t\t\t\t\t<div class=\"controls\">\n\t\t\t\t\t\t<input type=\"hidden\"class=\"update-id\">\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control playlist-edit-name\">\n\t\t\t\t\t\t<p class=\"help-block\">Enter a name for the playlist.</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t</form>\n\t", "Edit playlist name", "<a class=\"btn btn-primary update-playlist\" href=\"#\">Save</a><a class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</a>") . "</div>\n</div>" . Bootstrap::modal("delete-modal", "<p>Are you sure you want to permanently delete <span class=\"delete-playlist-title\">this playlist</span>? </p><p>(this does not delete any of the tracks on it)</p>", "Delete playlist", "<a href=\"#\" class=\"btn btn-primary yes-definitely-delete\">Yes</a> <a href=\"#\" class=\"btn btn-default\" data-dismiss=\"modal\">No</a>");
}