Esempio n. 1
0
 public function output($path, $tabs, $li_class = false)
 {
     $out = "\n" . str_repeat("\t", $tabs);
     $out .= "<li class=\"" . ($this->active ? "active " : "") . ($li_class ? $li_class : "") . "\">";
     $out .= "<a href=\"" . $this->url($path) . "\">";
     if (strlen($this->icon) > 0) {
         $out .= Bootstrap::glyphicon($this->icon);
     }
     $out .= $this->label . "</a>";
     if (isset($this->menu)) {
         $out .= $this->menu->output($path . $this->url . "/", $tabs + 1);
     }
     $out .= "</li>";
     return $out;
 }
Esempio n. 2
0
<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>";
        }
    } else {
        echo "<td style=\"width:65px\"></td>";
    }
    if ($set->user_can_edit() || Session::is_group_user('Audiowalls Admin')) {
        echo "<td style=\"width:65px\"><a href=\"edit.php?id=" . $set->get_id() . "\" class=\"btn btn-primary\">Edit</a></td>";
    } else {
Esempio n. 3
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>";
Esempio n. 4
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);
Esempio n. 5
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";
Esempio n. 6
0
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 {
    echo "\n<strong>No new requested tracks.</strong>";
}
Esempio n. 7
0
		</div>
	</div>
	<div class="col-sm-5 selected-package">
		<h2 id="package-name">Select a package</h2>
		<p id="package-description">Choose a package from the left.</p>
		<div class="btn-group">
			<a href="#" class="btn btn-success disabled" data-toggle="tooltip" title="Coming soon!" id="edit"><?php 
echo Bootstrap::glyphicon('pencil');
?>
 Edit</a>
			<a href="#" class="btn btn-warning disabled" id="archive"><?php 
echo Bootstrap::glyphicon('eye-close');
?>
 Archive</a>
			<a href="#" class="btn btn-danger disabled" id="delete"><?php 
echo Bootstrap::glyphicon('remove-sign');
?>
 Delete</a>
		</div>
		<p></p>
		<div class="input-group">
			<input type="text" autocomplete="off" data-provide="typeahead" class="form-control typeahead" placeholder="Search for jingles to add...">
			<span class="input-group-btn">
				<button id="add-jingle" class="btn btn-default" type="button">Add</button>
			</span>
		</div>
		<hr />
		<p><span id="count-jingles">0</span> jingles in this package:</p>
		<table class="table table-striped table-condensed">
			<thead>
Esempio n. 8
0
<?php

if (isset($_REQUEST['refer']) && Session::is_user()) {
    $refer = preg_replace('/\\&/', '?', $_REQUEST["refer"], 1);
    header("Location: " . LINK_ABS . $refer);
}
MainTemplate::set_feature_image(LINK_ABS . "img/homepage.png");
echo "\n\t\t<script type=\"text/javascript\">\n\t\t\$(function () {\n\t\t\t\$('#username').focus();\n\t\t\t\$('.form-signin').submit(function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t\$('#submit').button('loading');\n\t\t\t\t\$('.help-inline').remove();\n\t\t\t\t\$.post('ajax/login.php', \$(this).serialize(), function(data) {\n\t\t\t\t\tif(data == \"success\") { \n\t\t\t\t\t\tlocation.reload()\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\$('#submit').after('<span class=\"help-inline\">'+data+'</span>');\n\t\t\t\t\t\t\$('#submit').button('reset');\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\t\t});\n\t\t</script>";
$feature = "\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-sm-8\">\n\t\t\t\t\t<h1>Digiplay <small>by Radio Warwick</small></h1>\n\t\t\t\t\t<p>A magical software suite run by miniature elves, which is amazing because elves are already very small by their nature.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t" . (Session::is_user() ? "\n\t\t\t\t\t<h2>Common Tasks</h2>\n\t\t\t\t\t<a href=\"music/upload/\" class=\"btn btn-primary btn-large btn-block\">Upload Audio &raquo;</a>\n\t\t\t\t\t<a href=\"playlists/\" class=\"btn btn-primary btn-large btn-block\">Edit Playlists &raquo;</a>\n\t\t\t\t\t<a href=\"sustainer/\" class=\"btn btn-primary btn-large btn-block\">Schedule Prerecorded Content &raquo;</a>\n\t\t\t\t\t<a href=\"faults/\" class=\"btn btn-primary btn-large btn-block\">Report a Fault &raquo;</a>\n\t\t\t\t\t" . (Session::is_group_user("Studio Admin") ? "<a href=\"reset.php\" class=\"btn btn-primary btn-large btn-block\">Reset Playout Systems &raquo;</a>" : "") . "\n\t\t\t\t" : "\n\t\t\t\t\t<form class=\"form-signin\" action=\"ajax/login.php\" method=\"post\">\n\t\t\t\t\t\t<div class=\"form-group" . (isset($_REQUEST['refer']) ? " has-error" : "") . "\">\n\t\t\t\t\t\t\t<input id=\"username\" name=\"username\" type=\"text\" class=\"form-control input-lg\" placeholder=\"Username\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"form-group" . (isset($_REQUEST['refer']) ? " has-error" : "") . "\">\n\t\t\t\t\t\t\t<input id=\"password\" name=\"password\" type=\"password\" class=\"form-control input-lg\" placeholder=\"Password\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"btn btn-lg " . (isset($_REQUEST['refer']) ? "btn-danger" : "btn-primary") . " btn-block\" id=\"submit\" name=\"submit\" value=\"Log In\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t") . "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t";
MainTemplate::set_feature_html($feature);
echo "<div class=\"row\">\n\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t<h2>Music Library</h2>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt>Tracks Stored</dt>\n\t\t\t\t\t<dd>" . number_format(Tracks::get_total_tracks()) . "</dd>\n\t\t\t\t\t<dt>Length of Tracks</dt>\n\t\t\t\t\t<dd>" . Time::format_pretty(Tracks::get_total_length()) . "</dd>\n\t\t\t\t\t<dt>Playlisted Tracks</dt>\n\t\t\t\t\t<dd>" . (count(Tracks::get_playlisted()) - count(Tracks::get_playlisted(Playlists::get(0)))) . "</dd>\n\t\t\t\t</dl>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t<h2>Sustainer Service</h2>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt>Tracks on Sustainer</dt>\n\t\t\t\t\t<dd>" . Sustainer::get_total_tracks() . "</dd>\n\t\t\t\t\t<dt>Length of Sustainer Playlist</dt>\n\t\t\t\t\t<dd>" . Sustainer::get_total_length_formatted() . "</dd>\n\t\t\t\t</dl>\n\t\t\t\t<a class=\"btn btn-primary btn-block\" href=\"" . LINK_ABS . "sustainer/\">" . Bootstrap::glyphicon("headphones") . "Now playing</a>\n\t\t\t\t<a class=\"btn btn-primary btn-block\" href=\"" . LINK_ABS . "playlists/detail/0\">" . Bootstrap::glyphicon("list") . "View playlist</a>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t<h2>Newest Tracks</h2>";
$tracks = Tracks::get_newest(4);
echo "<table class=\"table table-striped table-hover table-condensed\" cellspacing=\"0\">";
foreach ($tracks as $track) {
    echo "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"icon\">\n\t\t\t\t\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $track->get_id() . "\" class=\"track-info\">\n\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"title\">" . $track->get_title() . " by " . $track->get_artists_str() . "</td>\n\t\t\t\t\t</tr>";
}
echo "\n\t\t\t\t</table>\n\t\t\t\t<a class=\"btn btn-primary btn-block\" href=\"" . LINK_ABS . "music/\">" . Bootstrap::glyphicon("chevron-right") . "More</a>\n\t\t\t</div>\n\t\t</div>";
if (Session::is_user()) {
    $lastlogin = Session::get_lastlogin();
    if ($lastlogin) {
        echo "<p class=\"text-success\">You last logged in: " . strftime("%A %e %B %G %H:%M", $lastlogin) . "</p>";
    } else {
        echo "<p class=\"text-success\">You've never logged in before! Welcome to the Digiplay Web Management System.</p>";
    }
    echo "<h4>Tracks of the Day:</h4><ul>";
    $tracks = Tracks::get_tracks_of_the_day(3);
    foreach ($tracks as $track) {
        echo "<li><a href=\"music/detail/" . $track->get_id() . "\">" . $track->get_artists_str() . " - " . $track->get_title() . "</a></li>";
    }
    echo "</ul>";
}
Esempio n. 9
0
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")) {
            echo "<h4>You can add tracks by finding them in the music library and clicking the " . Bootstrap::glyphicon("plus-sign") . ".</h4>";
        }
    } else {
        echo "Invalid playlist.";
    }
}
Esempio n. 10
0
echo "<strong>To flag a track for censorship, search for it in the music library, click the " . Bootstrap::glyphicon("info-sign") . " and click the \"Flag for censorship\" button.</strong>";
if ($flagged = Tracks::get_flagged()) {
    echo "\n<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" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
    foreach ($flagged as $flag) {
        echo "\n\t<tr id=\"" . $flag->get_id() . "\">\n\t\t<td class=\"icon\">\n\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $flag->get_id() . "\" class=\"track-info\">\n\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t</a>\n\t\t\t<div class=\"hover-info\">\n\t\t\t\t<strong>Artist:</strong> " . $flag->get_artists_str() . "<br />\n\t\t\t\t<strong>Album:</strong> " . $flag->get_album()->get_name() . "<br />\n\t\t\t\t<strong>Year:</strong> " . $flag->get_year() . "<br />\n\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($flag->get_length()) . "<br />\n\t\t\t\t<strong>Origin:</strong> " . $flag->get_origin() . "<br />\n\t\t\t\t" . ($flag->get_reclibid() ? "<strong>Reclib ID:</strong> " . $flag->get_reclibid() . "<br />" : "") . "\n\t\t\t</div>\n\t\t</td>\n\t\t<td class=\"artist\">" . $flag->get_artists_str() . "</td>\n\t\t<td class=\"title\">" . $flag->get_title() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?censor=" . $flag->get_id() . "\" class=\"censor\" title=\"Approve censorship\" rel=\"twipsy\">" . Bootstrap::glyphicon("ok-sign") . "</td>\n\t\t<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?unflag=" . $flag->get_id() . "\" class=\"unflag\" title=\"Remove flag\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
    }
    echo "\n</table>";
} else {
    echo "<h4>No tracks currently flagged for censorship.</h4>";
}
$limit = isset($_REQUEST['n']) ? $_REQUEST['n'] : 10;
$page = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1;
$num_of_censored = Tracks::count_censored();
if ($censored = Tracks::get_censored($limit, ($page - 1) * $limit)) {
    $pages = new Paginator();
    $pages->items_per_page = $limit;
    $pages->querystring = NULL;
    $pages->mid_range = 5;
    $pages->items_total = $num_of_censored;
    $pages->paginate();
    $low = ($page - 1) * $limit + 1;
    $high = $low + $limit - 1 > $num_of_censored ? $num_of_censored : $low + $limit - 1;
    echo "\n<h3>Censored Tracks</h3>\n<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" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
    foreach ($censored as $censor) {
        echo "\n\t<tr id=\"" . $censor->get_id() . "\">\n\t\t<td class=\"icon\">\n\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $censor->get_id() . "\" class=\"track-info\">\n\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t</a>\n\t\t\t<div class=\"hover-info\">\n\t\t\t\t<strong>Artist:</strong> " . $censor->get_artists_str() . "<br />\n\t\t\t\t<strong>Album:</strong> " . $censor->get_album()->get_name() . "<br />\n\t\t\t\t<strong>Year:</strong> " . $censor->get_year() . "<br />\n\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($censor->get_length()) . "<br />\n\t\t\t\t<strong>Origin:</strong> " . $censor->get_origin() . "<br />\n\t\t\t\t" . ($censor->get_reclibid() ? "<strong>Reclib ID:</strong> " . $censor->get_reclibid() . "<br />" : "") . "\n\t\t\t</div>\n\t\t</td>\n\t\t<td class=\"artist\">" . $censor->get_artists_str() . "</td>\n\t\t<td class=\"title\">" . $censor->get_title() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?uncensor=" . $censor->get_id() . "\" class=\"uncensor\" title=\"Uncensor this track\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
    }
    echo "\n</table>";
    echo $pages->return;
} else {
    echo "\n<strong>No censored tracks.</strong>";
}
Esempio n. 11
0
        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";
    foreach (Playlists::get_sustainer() as $playlist) {
        echo "\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"" . LINK_ABS . "playlists/detail/" . $playlist->get_id() . "\" class=\"info\">\n\t\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"" . $playlist->get_id() . "\">\n\t\t\t\t\t</a>\n\t\t\t\t\t<div class=\"hover-info\">\n\t\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\t</div>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"title\">" . $playlist->get_name() . "</td>\n\t\t\t\t<td>" . count($playlist->get_tracks()) . "</td>\n\t\t\t\t<td>\n\t\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\t" . Bootstrap::glyphicon("pencil") . "\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\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\t" . Bootstrap::glyphicon("remove-sign") . "\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"#\" class=\"move\">\n\t\t\t\t\t\t" . Bootstrap::glyphicon("move move") . "\n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t</tr>";
    }
    echo "\n\t\t</tbody>\n\t</table>\n\t</div>\n\t";
}
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>");
}
Esempio n. 12
0
    $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>";
        }
        echo (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"#\" data-toggle=\"modal\" data-target=\"#delete-modal\" data-backdrop=\"true\" data-keyboard=\"true\" data-dps-id=\"" . $track->get_id() . "\" class=\"track-delete\" title=\"Delete this track\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</a></td>" : "") . "\n\t\t</tr>";
    }
    echo "</table>";
    echo $pages->return;
}
if (Session::is_group_user("Music Admin")) {
    echo Bootstrap::modal("delete-modal", "<p>Are you sure you want to remove <span class=\"delete-track-title\">this track</span> completely?</p>", "Delete track", "<a href=\"#\" class=\"btn btn-primary yes-definitely-delete\">Yes</a> <a href=\"#\" class=\"btn btn-default\" data-dismiss=\"modal\">No</a>");
    echo Bootstrap::modal("empty-modal", "<p>Are you sure you want to empty the trash completely?</p>", "Empty Trash", "<div class=\"btn btn-primary\" id=\"flag-confirm\">Yes</div> <a href=\"#\" class=\"btn btn-default\" data-dismiss=\"modal\">No</a>");
    echo "<script>\n\t\t\t\$('#flag-confirm').click(function(){\n\t\t\t\t\$.ajax({\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/empty-trash.php',\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\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\twindow.location.reload(true); \n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t</script>\n\t";
}
Esempio n. 13
0
                 case "Advert":
                     $type = "bullhorn";
                     break;
                 case 0:
                     $type = "music";
                     break;
             }
             if ($location->get_config("current_showitems_id")->get_val() == $item->get_id()) {
                 if ($location->get_config("next_on_showplan")->get_val() == $audio->get_md5()) {
                     $current = true;
                 }
             }
             $return .= "<div class=\"showplan-audio panel " . ($current ? "panel-primary" : "panel-default") . "\" data-item-id=\"" . $item->get_id() . "\">\r\n\t\t\t\t\t<div class=\"panel-heading\" data-toggle=\"collapse\">\r\n\t\t\t\t\t\t<h4 class=\"panel-title\">\r\n\t\t\t\t\t\t\t<div class=\"pull-right\">\r\n\t\t\t\t\t\t\t\t<div class=\"controls\">" . Bootstrap::glyphicon("remove") . "</div>\r\n\t\t\t\t\t\t\t\t<div class=\"duration\">" . Time::format_succinct($audio->get_length()) . "</div></div>\r\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon($type) . ($audio->get_artists() ? $audio->get_artists_str() . " - " : "") . $audio->get_title() . "\r\n\t\t\t\t\t\t</h4>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>";
         }
         if ($script = $item->get_script()) {
             $return .= "<div class=\"showplan-script panel panel-default\" data-item-id=\"" . $item->get_id() . "\">\r\n\t\t\t\t\t<div class=\"panel-heading\" data-toggle=\"collapse\" href=\"#item-" . $item->get_id() . "-toggle\">\r\n\t\t\t\t\t\t<h4 class=\"panel-title\">\r\n\t\t\t\t\t\t\t<div class=\"pull-right\">\r\n\t\t\t\t\t\t\t\t<div class=\"controls\">" . Bootstrap::glyphicon("remove") . "</div>\r\n\t\t\t\t\t\t\t\t<div class=\"duration\">" . ($script->get_length() > 0 ? Time::format_succinct($script->get_length()) : "") . "</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("file") . $script->get_name() . "\r\n\t\t\t\t\t\t</h4>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id=\"item-" . $item->get_id() . "-toggle\" class=\"panel-collapse collapse\">\r\n\t\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t\t" . $script->get_contents() . "\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>";
         }
     }
     $return .= "</div>";
     echo $return;
     break;
 case "showplan-append":
     $showplan = Showplans::get_by_id($location->get_config("default_showplan")->get_val());
     $item = new ShowplanItem();
     $audio = Audio::get_by_id($_REQUEST["id"]);
     if (!$audio) {
         exit(json_encode(array("response" => "invalid")));
     }
     $item->set_title($audio->get_title());
     $item->set_audio($audio);
     $item->set_position($showplan->get_end_position());
Esempio n. 14
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";
Esempio n. 15
0
        $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")) {
            $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>";
        }
        echo (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"#\" data-toggle=\"modal\" data-target=\"#delete-modal\" data-backdrop=\"true\" data-keyboard=\"true\" data-dps-id=\"" . $track->get_id() . "\" class=\"track-delete\" title=\"Delete this track\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</a></td>" : "") . "\r\n\t\t</tr>";
    }
    echo "</table>";
    echo $pages->return;
} else {
    if ($query) {
        echo "<h3>Sorry, no results for " . $query . "</h3>";
        echo "<h4>Try a more generic search term.</h4>";
    }
    echo "<h4>Enter keywords below to search for tracks:</h4>\r\n\t<form action=\"" . LINK_ABS . "music/search\" method=\"GET\" class=\"form-inline\">\r\n\t\t<input type=\"text\" placeholder=\"Search Tracks\" name=\"q\" class=\"col-9\">\r\n       \t<input type=\"submit\" class=\"btn btn-primary\" value=\"Search\" class=\"col-2 col-offset-1\">\r\n    </form>";
}
if (Session::is_group_user("Playlist Admin")) {
    $playlist_modal_content = "<p>Select a playlist to add/remove <span class=\"playlist-track-title\">this track</span> to/from:</p><ul class=\"nav nav-pills nav-stacked\">";
    foreach (Playlists::get_all() as $playlist) {
        $playlist_modal_content .= "<li><a href=\"#\" class=\"playlist-select\" data-playlist-id=\"" . $playlist->get_id() . "\">" . Bootstrap::glyphicon("plus") . $playlist->get_name() . "</a></li>";
    }
    $playlist_modal_content .= "</ul>";
    echo Bootstrap::modal("playlist-modal", $playlist_modal_content, "Add to playlist", "<a href=\"#\" class=\"btn btn-primary\" data-dismiss=\"modal\">Done</a> <a href=\"" . LINK_ABS . "playlists\" class=\"btn btn-default\">Manage playlists</a>");
}
if (Session::is_group_user("Music Admin")) {
    echo Bootstrap::modal("delete-modal", "<p>Are you sure you want to move <span class=\"delete-track-title\">this track</span> to the trash?</p>", "Delete track", "<a href=\"#\" class=\"btn btn-primary yes-definitely-delete\">Yes</a> <a href=\"#\" class=\"btn btn-default\" data-dismiss=\"modal\">No</a>");
}
Esempio n. 16
0
 public function player($vocal_markers = true)
 {
     Output::add_script(LINK_ABS . "js/wavesurfer.min.js");
     Output::add_script(LINK_ABS . "js/wavesurfer.timeline.js");
     Output::add_script(LINK_ABS . "js/wavesurfer_init.js");
     if ($vocal_markers) {
         Output::add_script(LINK_ABS . "js/wavesurfer.regions.js");
     }
     $html = "\n\t\t<script> \$(function () { wv_create('" . $this->id . "'); wavesurfer[" . $this->id . "].load('" . LINK_ABS . "audio/preview/" . $this->id . ".mp3') }); </script>\n\t\t<div class=\"row audio-player\" id=\"" . $this->id . "\" " . ($vocal_markers ? "data-vocal-start=\"" . $this->get_vocal_start() . "\" data-vocal-end=\"" . $this->get_vocal_end() . "\"" : "") . ">\n\t\t\t<div class=\"col-xs-12\">\n\t\t\t\t<div class=\"well well-sm\">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<button class=\"btn btn-primary playpause\" id=\"playpause\" disabled>\n\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("play") . "\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<h6><small><span class=\"elapsed\">00:00</span> / <span class=\"duration\">00:00</span></small></h6>\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<div class=\"col-xs-6\">\n\t\t\t\t\t\t\t\t\t<button class=\"btn btn-sm btn-info zoom\">\n\t\t\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("search") . "\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div id=\"waveform" . $this->get_id() . "\">\n\t\t\t\t\t\t\t\t<div id=\"progress-div\" class=\"progress progress-striped\">\n\t\t\t\t\t\t\t\t\t<div class=\"progress-bar\">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\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</div>";
     return $html;
 }
Esempio n. 17
0
<?php

Output::set_title("Music Upload");
Output::add_script(LINK_ABS . "js/jquery.ui.widget.js");
Output::add_script(LINK_ABS . "js/tmpl.min.js");
Output::add_script(LINK_ABS . "js/jquery.fileupload.js");
Output::add_script(LINK_ABS . "js/jquery.fileupload-ui.js");
MainTemplate::set_subtitle("Drag and drop music to add to the file importer");
echo "\r\n<script>\r\n\$(function () {\r\n\t'use strict';\r\n\r\n\t\$('#fileupload').fileupload();\r\n\r\n\t\$('#fileupload').fileupload('option', {\r\n\t\tacceptFileTypes: /(\\.|\\/)(wav|mp3|aac|flac|m4a|ogg|pcm|wma|aif)\$/i,\r\n\t\turl: '" . LINK_ABS . "ajax/file-upload.php',\r\n\t\tlimitConcurrentUploads: 3\r\n\t});\r\n\t\t\r\n\t// Load existing files:\r\n\t\$.ajax({\r\n\t\turl: \$('#fileupload').fileupload('option', 'url'),\r\n\t\tdataType: 'json',\r\n\t\tcontext: \$('#fileupload')[0]\r\n\t}).done(function (result) {\r\n\t\t\$(this).fileupload('option', 'done')\r\n\t\t\t.call(this, null, {result: result});\r\n\t});\r\n});\r\n</script>\r\n\t<form id=\"fileupload\" action=\"" . LINK_ABS . "ajax/file-upload.php\" method=\"POST\" enctype=\"multipart/form-data\">\r\n\t\t<div class=\"row fileupload-buttonbar\">\r\n\t\t\t<div class=\"col-md-6\">\r\n\t\t\t\t<span class=\"btn btn-success fileinput-button\">\r\n\t\t\t\t\t" . Bootstrap::glyphicon("plus icon-white") . "\r\n\t\t\t\t\t<span>Add files</span>\r\n\t\t\t\t\t<input type=\"file\" name=\"files[]\" multiple>\r\n\t\t\t\t</span>\r\n\t\t\t\t<button type=\"submit\" class=\"btn btn-primary start\">\r\n\t\t\t\t\t" . Bootstrap::glyphicon("upload icon-white") . "\r\n\t\t\t\t\t<span>Start upload</span>\r\n\t\t\t\t</button>\r\n\t\t\t\t<button type=\"reset\" class=\"btn btn-warning cancel\">\r\n\t\t\t\t\t" . Bootstrap::glyphicon("ban-circle icon-white") . "\r\n\t\t\t\t\t<span>Cancel upload</span>\r\n\t\t\t\t</button>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"col-md-6 fileupload-progress\">\r\n\t\t\t\t<div class=\"progress-extended\">&nbsp;</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<div class=\"fileupload-loading\"></div>\r\n\t\t<br>\r\n\t\t<table class=\"table table-striped\"><tbody class=\"files\"></tbody></table>\r\n\t</form>\r\n\r\n<script>\r\n</script>\r\n<script id=\"template-upload\" type=\"text/x-tmpl\">\r\n{% for (var i=0, file; file=o.files[i]; i++) { %}\r\n\t<tr class=\"template-upload\">\r\n\t\t<td class=\"name col-md-5\"><span>{%=file.name%}</span></td>\r\n\t\t{% if (file.error) { %}\r\n\t\t\t<td class=\"error\" colspan=\"2\"><span class=\"label label-important\">Error</span> {%=file.error%}</td>\r\n\t\t{% } else if (o.files.valid && !i) { %}\r\n\t\t\t<td class=\"col-md-3\">\r\n\t\t\t\t<div class=\"progress progress-striped active\"><div class=\"progress-bar\"></div></div>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"size col-md-2\"><span>{%=o.formatFileSize(file.size)%}</span></td>\r\n\t\t\t<td class=\"start\">{% if (!o.options.autoUpload) { %}\r\n\t\t\t\t<button class=\"btn btn-primary pull-right\">\r\n\t\t\t\t\t<span>Start</span>\r\n\t\t\t\t</button>\r\n\t\t\t{% } %}</td>\r\n\t\t{% } else { %}\r\n\t\t\t<td colspan=\"2\"></td>\r\n\t\t{% } %}\r\n\t\t<td class=\"cancel col-md-1\">{% if (!i) { %}\r\n\t\t\t<button class=\"btn btn-warning pull-right\">\r\n\t\t\t\t<span>Cancel</span>\r\n\t\t\t</button>\r\n\t\t{% } %}</td>\r\n\t</tr>\r\n{% } %}\r\n</script>\r\n<script id=\"template-download\" type=\"text/x-tmpl\">\r\n{% for (var i=0, file; file=o.files[i]; i++) { %}\r\n\t<tr class=\"template-download\">\r\n\t\t{% if (file.error) { %}\r\n\t\t\t<td></td>\r\n\t\t\t<td class=\"name col-md-7\" colspan=\"2\"><span>{%=file.name%}</span></td>\r\n\t\t\t<td class=\"error\"><span class=\"label label-important\">Error</span> {%=file.error%}</td>\r\n\t\t\t<td class=\"size col-md-2\"><span>{%=o.formatFileSize(file.size)%}</span></td>\r\n\t\t{% } else { %}\r\n\t\t\t<td class=\"name col-md-7\" colspan=\"2\">\r\n\t\t\t\t<a href=\"{%=file.url%}\" title=\"{%=file.name%}\" download=\"{%=file.name%}\">{%=file.name%}</a>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"size col-md-2\"><span>{%=o.formatFileSize(file.size)%}</span></td>\r\n\t\t{% } %}\r\n\t</tr>\r\n{% } %}\r\n</script>\r\n\r\n";
echo Bootstrap::alert_message_basic("info", "<a href=\"" . LINK_ABS . "music/import\">Click here to go import the files to Digiplay.</a>", "Finished uploading?");
Esempio n. 18
0
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>";
}
echo "\r\n\t\t\t\t<div class=\"panel panel-default sustainer\">\r\n\t\t\t\t\t<h2>Sue stuff here</h2>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"col-md-5\">\r\n\t\t\t\t<h1>lol audiowalls</h1>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</div>";
Esempio n. 19
0
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";
}
echo "</div>";