Exemplo n.º 1
0
 public static function print_page($content)
 {
     $start_time = microtime(true);
     if (strlen(LINK_PATH) > 0) {
         $sitePathArray = explode("/", LINK_PATH);
         for ($i = 0; $i < count($sitePathArray); $i++) {
             $file = FILE_ROOT . implode("/", array_slice($sitePathArray, 0, $i + 1)) . "/sidebar.php";
             if (file_exists($file)) {
                 include $file;
                 MainTemplate::set_sidebar(sidebar());
                 MainTemplate::set_menu(menu());
             }
         }
         unset($sitePathArray, $i, $file);
     }
     $main_menu = new Menu();
     $main_menu->add_many(array("music", "Music Library", "music"), array("playlists", "Playlists", "th-list"), array("audiowalls", "Audiowalls", "th"), array("files", "Files", "folder-open"), array("showplans", "Show Planning", "tasks"));
     if (Session::is_admin()) {
         $main_menu->add("admin", "Admin", "cog");
     }
     $site_path_array = explode("/", LINK_PATH);
     $main_menu->set_active($site_path_array[0]);
     header("Content-Type: text/html; charset=utf-8");
     $return = "<!DOCTYPE html> \n<html> \n\t<head> \n\t\t<title>RaW Digiplay";
     if (Output::get_title() != 'Untitled Page') {
         $return .= " - " . Output::get_title();
     }
     $return .= "</title> \n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n\t\t<script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js\"></script>\n\t\t<script type=\"text/javascript\" src=\"" . LINK_ABS . "js/bootstrap.min.js\"></script>\n\t\t";
     if (isset($_REQUEST["theme"])) {
         $return .= "<link rel=\"stylesheet\" href=\"//netdna.bootstrapcdn.com/bootswatch/3.0.0/" . $_REQUEST["theme"] . "/bootstrap.min.css\">\n";
     } else {
         $return .= "<link rel=\"stylesheet\" href=\"" . LINK_ABS . "css/bootstrap.min.css\">\n";
     }
     if (count(Output::get_stylesheets()) > 0) {
         foreach (Output::get_stylesheets() as $src) {
             $return .= "<link href=\"" . $src . "\" rel=\"stylesheet\" type=\"text/css\">\n";
         }
     }
     if (count(Output::get_scripts()) > 0) {
         foreach (Output::get_scripts() as $src) {
             $return .= "<script src=\"" . $src . "\" type=\"text/javascript\"></script>\n";
         }
     }
     if (count(Output::get_feeds()) > 0) {
         foreach (Output::get_feeds() as $feed) {
             $return .= "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"" . $feed['title'] . "\" href=\"" . $feed['url'] . "\">\n";
         }
     }
     if (self::$barebones == false) {
         $return .= "\n\t\t\t<link rel=\"stylesheet\" href=\"" . LINK_ABS . "css/style.css\">\n\t\t\t<script src=\"" . LINK_ABS . "js/main.js\" type=\"text/javascript\"></script>\n\t\t\t";
     }
     $return .= "\t</head>\n\t<body" . (self::$body_class ? " class=\"" . self::$body_class . "\"" : "") . ">";
     if (self::$barebones == false) {
         $return .= "\n\t\t<div id=\"wrap\">\n\t\t\t<nav class=\"navbar navbar-inverse navbar-fixed-top\" role=\"navigation\">\n\t\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"navbar-header\">\n\t\t\t\t\t<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-dps-collapse\">\n      \t\t\t\t\t\t<span class=\"sr-only\">Toggle navigation</span>\n      \t\t\t\t\t\t<span class=\"icon-bar\"></span>\n      \t\t\t\t\t\t<span class=\"icon-bar\"></span>\n      \t\t\t\t\t\t<span class=\"icon-bar\"></span>\n    \t\t\t\t\t</button>\n\t    \t\t\t\t<a class=\"navbar-brand hidden-sm\" href=\"" . LINK_ABS . "\">Digiplay</a>\n\t\t\t\t\t<div class=\"navbar-spinner hidden\">\n\t\t\t\t\t\t<svg class=\"spinner\" width=\"25px\" height=\"25px\" viewBox=\"0 0 66 66\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t\t\t<circle class=\"path\" fill=\"none\" stroke-width=\"8\" stroke-linecap=\"round\" cx=\"33\" cy=\"33\" r=\"29\"></circle>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"navbar-collapse collapse navbar-dps-collapse\">" . $main_menu->output(LINK_ABS, 6, "nav navbar-nav");
         if (Session::is_user()) {
             $return .= "\n\t\t\t\t\t<ul class=\"nav search-pull-right hidden-sm\">\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<form class=\"navbar-form\" action=\"" . LINK_ABS . "music/search\" method=\"GET\" role=\"search\">\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t            \t\t\t\t\t<input type=\"text\" class=\"form-control search-query\" placeholder=\"Search Tracks\" name=\"q\" autocomplete=\"off\">\n\t            \t\t\t\t</div>\n\t            \t\t\t</form>\n\t            \t\t</li>\n\t            \t\t<li>\n\t\t          \t\t\t<ul id=\"quick-search\" class=\"dropdown-menu pull-right\"></ul>\n\t\t          \t\t</li>\n\t\t          \t</ul>\n\t\t          \t";
         }
         $return .= "\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</nav>\n\t\t\t" . (isset(self::$feature_html) ? "<div class=\"jumbotron" . (isset(self::$feature_image) ? " feature-image\" style=\"background-image: url('" . self::$feature_image . "')\"" : "\"") . "><div class=\"container\">" . self::$feature_html . "</div></div>" : "") . "<div class=\"container\">";
         if (Output::get_title() != 'Untitled Page') {
             $return .= "\n\t\t\t\t<div class=\"page-header\">\n\t\t\t\t\t<h2>" . Output::get_title();
             if (isset(self::$subtitle)) {
                 $return .= " <small>" . self::$subtitle . "</small>";
             }
             $return .= "</h2>\n\t\t\t\t</div>";
         }
         $return .= "\n\t\t\t\t<div class=\"row\">";
         if (isset(self::$sidebar) || isset(self::$menu)) {
             $return .= "\n\t\t\t\t<div class=\"col-md-3\">";
             if (isset(self::$menu)) {
                 $return .= self::$menu;
             }
             if (isset(self::$sidebar)) {
                 $return .= "\t\n\t\t\t\t\t<div class=\"panel panel-noborder visible-md visible-lg\">\n\t\t\t\t\t\t<div class=\"panel-body\">" . self::$sidebar . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>";
             }
             $return .= "\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-md-9\">";
         } else {
             $return .= "\n\t\t\t\t<div class=\"col-md-12\">";
         }
     }
     $return .= $content;
     if (self::$barebones == false) {
         $return .= "\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>";
         if (Session::is_user()) {
             $return .= Bootstrap::modal("logout-modal", "You'll lose any unsaved changes on this page.", "Log out?", "<a class=\"btn btn-primary\" href=\"" . LINK_ABS . "ajax/logout.php\">Yes, log out</a>");
         }
         $return .= "\n\t\t<div id=\"push\"></div>\n\t</div>\n\t\t<footer class=\"jumbotron\">\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"col-sm-8\">\n\t\t\t\t\t\t<p class=\"text-muted credit\">";
         if (Session::is_user()) {
             $return .= "Logged in as " . Session::get_username() . ". <a href=\"#logout-modal\" data-toggle=\"modal\">Logout</a>. ";
         } else {
             $return .= "Not logged in. ";
         }
         $return .= "Copyright &copy; 2011-" . date("y") . " Radio Warwick\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t\t\t<a href=\"" . LINK_ABS . "\"><img src=\"" . LINK_ABS . "img/footer_logo.png\" alt=\"RaW 1251AM\" class=\"pull-right\"/></a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</footer>";
     }
     $return .= "\n\t<!-- Page generated in " . (microtime(true) - START_TIME) . " seconds. " . DigiplayDB::get_querycount() . " database queries ran in " . DigiplayDB::get_querytime() . " seconds. -->\n\t</body> \n</html>";
     return $return;
 }
Exemplo n.º 2
0
$slots = SustainerSlots::get_all();
$i = 0;
echo "<table class=\"table table-striped table-bordered\">\r\n\t<thead>\r\n\t<tr>\r\n\t<th></th>\r\n\t<th>Monday</th>\r\n\t<th>Tuesday</th>\r\n\t<th>Wednesday</th>\r\n\t<th>Thursday</th>\r\n\t<th>Friday</th>\r\n\t<th>Saturday</th>\r\n\t<th>Sunday</th>\r\n\t</tr>\r\n\t</thead>\r\n\t<tbody>";
$i = 0;
foreach ($slots as $slot) {
    if ($i < 1) {
        echo "<tr>\r\n\t\t\t<td>" . $slot->get_time() . ":00</td>";
    }
    $thisPlaylist = Playlists::get_by_id($slot->get_playlist_id());
    $thisPlaylistColour = $thisPlaylist->get_colour() == "" ? 'FFFFFF' : $thisPlaylist->get_colour();
    echo "<td class='timeslot' id='slot-" . $slot->get_day() . "-" . $slot->get_time() . "' style='background-color: #" . $thisPlaylistColour . ";'>";
    echo $slot->get_audio_id() == NULL ? '' : "<span class=\"glyphicon glyphicon-time\" aria-hidden=\"true\"></span>";
    echo "</td>";
    $i++;
    if ($i > 6) {
        echo "</tr>";
        $i = 0;
    }
}
echo "</tbody>\r\n\t</table>";
echo "<form>";
foreach ($slots as $slot) {
    echo "<input type=\"hidden\" class=\"field-slots\" id=\"field-slot-" . $slot->get_day() . "-" . $slot->get_time() . "\" name=\"field-slot-" . $slot->get_day() . "-" . $slot->get_time() . "\" value=\"" . $slot->get_playlist_id() . "\">";
}
echo "</form>";
$playlistOptions = "";
foreach (Playlists::get_sustainer() as $playlist) {
    $playlistOptions .= "<option value=\"" . $playlist->get_id() . "\">" . $playlist->get_name() . "</option>";
}
echo Bootstrap::modal("update-modal", "\r\n\t\t<p id=\"slot-info\">Current slot information is unavailable.</p>\r\n\t\t<hr>\r\n\t\t<form class=\"form-horizontal\" action=\"?\" method=\"POST\">\r\n\t\t\t<fieldset>\r\n\t\t\t\t<div class=\"control-group\">\r\n\t\t\t\t\t<label class=\"control-label\" for=\"playlist-id\">New Playlist</label>\r\n\t\t\t\t\t<div class=\"controls\">\r\n\t\t\t\t\t\t<select id=\"playlist-id\" name=\"playlist-id\" data-width=\"100%\">\r\n\t\t\t\t\t\t\t" . $playlistOptions . "\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t<p class=\"help-block\">Select the playlist to be scheduled for <hh>.</p>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</fieldset>\r\n\t\t\t<fieldset>\r\n\t\t\t\t<div class=\"control-group\">\r\n\t\t\t\t\t<label class=\"control-label\" for=\"prerecord-id\">Prerecorded File</label>\r\n\t\t\t\t\t<div class=\"controls\">\r\n\t\t\t\t\t\t<select id=\"prerecord-id\" name=\"prerecord-id\" data-width=\"100%\">\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t<p class=\"help-block\">Select the prerecorded content to be played out at <hh>.</p>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</fieldset>\r\n\t\t\t<input type=\"hidden\"class=\"update-id\" name=\"updateid\">\r\n\t\t</form>\r\n\t", "Schedule Prerecorded Content", "<a class=\"btn btn-success\" id=\"update-playlist\" href=\"#\">Update Playlist</a><a class=\"btn btn-primary\" id=\"save-prerecord\" href=\"#\">Schedule Prerecord</a><a class=\"btn btn-danger\" id=\"delete-prerecord\" href=\"#\">Unschedule Prerecord</a><a class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</a>") . "<script type=\"text/javascript\">\r\n\t\tboxes = \$('.timeslot');\r\n\t\tboxes.dblclick(function(){\r\n\t\t\t\$('#update-modal').modal('show');\r\n\t\t\t\$('.update-id').val(\$(this).attr('id'));\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/get-slot-status.php',\r\n\t\t\t\tdata: { updateid: \$('.update-id').val() },\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\tdataType: 'json',\r\n\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\talert(value.error);\r\n\t\t\t\t},\r\n\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\$('#slot-info').html(data.status);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n</script>";
Exemplo n.º 3
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>");
}
Exemplo n.º 4
0
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);
echo "<script>\r\n\t\$('.new-comment').click(function() {\r\n\t\t\$('#comment-status-title').html('Add a comment to the fault DIGI_');\r\n\t\t\$('#comment-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-comment-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.confirm-fault-comment').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/add-update-comment.php',\r\n\t\t\tdata: 'faultid='+\$('.fault-comment-id').val()+'&comment='+\$('.fault-comment-value').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n</script>";
Exemplo n.º 5
0
    }
    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 {
        echo "<td style=\"width:65px\"></td>";
    }
    echo "<td style=\"width:185px\">";
    if ($set->get_id() == $active) {
        echo "<a href=\"#\" class=\"btn btn-success disabled\" id=\"active-aw\" data-user-id=\"" . Session::get_id() . "\" onclick=\"javascript: return false;\">Active Personal Audiowall</a>";
    } else {
        echo "<a href=\"#\" data-aw-id=\"" . $set->get_id() . "\" class=\"btn btn-default set-personal-audiowall\" onclick=\"javascript: return false;\">Use as Personal Audiowall</a>";
    }
    echo "</td></tr>";
}
echo "</tbody></table></div>";
echo Bootstrap::modal("add-audiowall-modal", "\n\t\t<form class=\"form-horizontal\" action=\"?\" 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=\"audiowall-name\">Audiowall Name</label>\n\t\t\t\t\t<div class=\"controls\">\n\t\t\t\t\t\t<input type=\"text\" class=\"form-control add_aw_text\" id=\"audiowall-name\" placeholder=\"Enter audiowall title.\">\n\t\t\t\t\t</div>\n\t\t\t\t\t<br>\n\t\t\t\t\t<label class=\"control-label\" for=\"audiowall-description\">Audiowall Description</label>\n\t\t\t\t\t<div class=\"controls\">\n\t\t\t\t\t\t<textarea class=\"form-control add_aw_text\" id=\"audiowall-description\" placeholder=\"Enter audiowall description.\"></textarea>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t\t<input type=\"hidden\"class=\"update-id\" name=\"updateid\">\n\t\t</form>\n\t", "Create New Audiowall", "<a class=\"btn btn-success\" id=\"create-audiowall\" href=\"#\">Create New Audiowall</a><a class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</a>");
echo "<div id=\"delete-audiowall-modal\" class=\"modal fade\">\n  <div class=\"modal-dialog\">\n    <div class=\"modal-content\"> \n      <div class=\"modal-header\">\n        <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button><h4 class=\"modal-title\">Delete Audiowall</h4>\n      </div>\n      <div class=\"modal-body\">\n        <div class=\"row\">\n          <div class=\"col-md-8\">\n            Are you sure you want to delete the page: \n          </div>\n          <div class=\"col-md-4\" id=\"wall-to-delete\"></div>\n      </div>\n      <p>&nbsp;</p>\n      <div class=\"modal-footer clearfix\">\n        <a href=\"#\" class=\"btn btn-primary\">Yes</a>\n        <a href=\"#\" class=\"btn btn-danger\">No</a>\n      </div>\n    </div>\n  </div>\n</div>\n</div>";
echo "<script type=\"text/javascript\">\n\t\t\$('.delete-aw-btn').click(function(){\n\t\t\t\$('#wall-to-delete').html(\$(this).data('aw-name'));\n\t\t\t\$('#wall-to-delete').attr('data-dps-aw-set', \$(this).data('dps-set-id'));\n\t\t\t\$('#delete-audiowall-modal').modal('show');\n\t\t});\n\t\t\$('#delete-audiowall-modal .btn-danger').click(function(){\n\t\t\t\$('#delete-audiowall-modal').modal('hide');\n\t\t});\n\t\t\$('#delete-audiowall-modal .btn-primary').click(function(){\n\t\t\t\$('#delete-audiowall-modal .btn-primary').addClass(\"disabled\");\n\t\t\t\$.ajax({\n\t\t\t\turl: '" . LINK_ABS . "ajax/delete-audiowall-set.php',\n\t\t\t\tdata: { setid: \$('#wall-to-delete').attr('data-dps-aw-set') },\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</script>\n\t\t";
echo "<script type=\"text/javascript\">\n\t\tboxes = \$('#create');\n\t\tboxes.click(function(){\n\t\t\t\$('#add-audiowall-modal').modal('show');\n\t\t});\n\t\t\n\t\tfunction add_aw() {\n\t\t\tif (\$('#audiowall-description').val() == \"\" || \$('#audiowall-name').val() == \"\") {\n\t\t\t\talert(\"Audiowalls must have both name and description!\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t\$.ajax({\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/add-audiowall-set.php',\n\t\t\t\t\tdata: { awname: \$('#audiowall-name').val().replace(\"'\", \"''\"), awdescription: \$('#audiowall-description').val().replace(\"'\", \"''\") },\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\treturn false;\n\t\t}\n\n\t\t\$('#create-audiowall').click(function() {\n\t\t\tadd_aw();\n\t\t});\n\n\t\t\$('.add_aw_text').on('keypress', function(e) {\n \t\t\t\tvar code = (e.keyCode ? e.keyCode : e.which);\n \t\t\t\tif(code == 13) {\n   \t\t\t\t\tadd_aw();\n   \t\t\t\t\te.preventDefault();\n \t\t\t\t}\n\t\t\t});\t\n</script>";
echo "<script type=\"text/javascript\">\n\t\$('.set-personal-audiowall').click(function(){\n\t\t\t\t\$.ajax({\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/update-audiowall-config.php',\n\t\t\t\t\tdata: { awid: \$(this).attr('data-aw-id'), userid: " . Session::get_id() . "},\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</script>";
Exemplo n.º 6
0
                } 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);
$title = "<span id=\"update-status-title\">Change the status of fault DIGI_</span>";
$body = "<form role=\"form\">\r\n  <div class=\"form-group\">\r\n  \t<input type=\"hidden\" class=\"fault-update-id\">\r\n    <select class=\"form-control fault-update-value\" name=\"status\">\r\n\t  <option value=\"1\">Not yet read</option>\r\n\t  <option value=\"2\">On hold</option>\r\n\t  <option value=\"3\">Work in progress</option>\r\n\t  <option value=\"4\">Fault complete</option>\r\n\t</select>\r\n  </div>\r\n  <div class=\"form-group\">\r\n  <button type=\"submit\" class=\"btn btn-success confirm-fault-update\">Change Status</button>\r\n  <a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>\r\n  </div>\r\n</form>";
echo Bootstrap::modal("update-status", $body, $title);
$title = "<span id=\"assign-status-title\">Assign fault DIGI_</span>";
$body = "<form role=\"form\">\r\n  <div class=\"form-group\">\r\n  \t<input type=\"hidden\" class=\"fault-assign-id\">\r\n    <select class=\"form-control fault-assign-value\" name=\"assign\">";
$group = Groups::get_by_name("Developers");
$developers = $group->get_users();
foreach ($developers as $developer) {
    $user = Users::get_by_id($developer->get_id());
    $user_fullname = $user->get_display_name();
    $body .= "<option value=" . $developer->get_id() . ">" . $user_fullname . "</option>";
}
$body .= "</select>\r\n  </div>\r\n  <div class=\"form-group\">\r\n  <button type=\"submit\" class=\"btn btn-warning confirm-fault-assign\">Assign Fault</button>\r\n  <a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>\r\n  </div>\r\n</form>";
echo Bootstrap::modal("assign-fault", $body, $title);
$title = "<span id=\"delete-status-title\">Are you sure you want to delete fault DIGI_</span>";
$body = "<input type=\"hidden\" class=\"fault-delete-id\">\r\n\t\t<a href=\"#\" class=\"btn btn-danger confirm-fault-delete\">Delete</a> \r\n\t\t<a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>";
echo Bootstrap::modal("delete-fault", $body, $title);
echo "<script>\r\n\t\$('.new-comment').click(function() {\r\n\t\t\$('#comment-status-title').html('Add a comment to the fault DIGI_');\r\n\t\t\$('#comment-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-comment-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.change-status').click(function() {\r\n\t\t\$('#update-status-title').html('Change the status of fault DIGI_');\r\n\t\t\$('#update-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-update-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.delete-fault').click(function() {\r\n\t\t\$('#delete-status-title').html('Are you sure you want to delete fault DIGI_');\r\n\t\t\$('#delete-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-delete-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.assign-fault').click(function() {\r\n\t\t\$('#assign-status-title').html('Assign fault DIGI_');\r\n\t\t\$('#assign-status-title').append(\$(this).attr('data-dps-id'));\r\n\t\t\$('.fault-assign-id').val(\$(this).attr('data-dps-id'));\r\n\t});\r\n\t\$('.confirm-fault-comment').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/add-update-comment.php',\r\n\t\t\tdata: 'faultid='+\$('.fault-comment-id').val()+'&comment='+\$('.fault-comment-value').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\$('.confirm-fault-update').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/fault-admin.php',\r\n\t\t\tdata: 'action=update-status&id='+\$('.fault-update-id').val()+'&status='+\$('.fault-update-value').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\$('.confirm-fault-delete').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/fault-admin.php',\r\n\t\t\tdata: 'action=del-fault&id='+\$('.fault-delete-id').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\$('.confirm-fault-assign').click(function() {\r\n\t\t\$.ajax({\r\n\t\t\turl: '" . LINK_ABS . "ajax/fault-admin.php',\r\n\t\t\tdata: 'action=assign-fault&id='+\$('.fault-assign-id').val()+'&assign='+\$('.fault-assign-value').val(),\r\n\t\t\ttype: 'POST',\r\n\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\talert(value.error);\r\n\t\t\t},\r\n\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\twindow.location.reload(true); \r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n</script>";
Exemplo n.º 7
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>");
}
Exemplo n.º 8
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";
}
Exemplo n.º 9
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";
Exemplo n.º 10
0
    $first = false;
}
echo "\n\t\t\t\t\t\t<div class=\"col-md-10 col-md-offset-2\">\n\t\t\t\t\t\t\t<input type=\"text\" id=\"new_artist\" name=\"new-artist\" class=\"form-control\" " . $disabled . " placeholder=\"Add new artist...\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<label class=\"control-label col-md-2\" for=\"album\">Album</label>\n\t\t\t\t\t\t<div class=\"col-md-10\">\n\t\t\t\t\t\t\t<input type=\"text\" id=\"album\" name=\"album\" class=\"form-control\" " . $disabled . " value=\"" . $track->get_album()->get_name() . "\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<label class=\"control-label col-md-2\" for=\"year\">Year</label>\n\t\t\t\t\t\t<div class=\"col-md-10\">\n\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" id=\"year\" name=\"year\" " . $disabled . " value=\"" . $track->get_year() . "\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<label class=\"control-label col-md-2\" for=\"length\">Length</label>\n\t\t\t\t\t\t<div class=\"col-md-10\">\n\t\t\t\t\t\t\t<p class=\"form-control-static\">" . Time::format_succinct($track->get_length()) . "</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<label class=\"control-label col-md-2\" for=\"origin\">Origin</label>\n\t\t\t\t\t\t<div class=\"col-md-10\">\n\t\t\t\t\t\t\t<input type=\"text\" id=\"origin\" name=\"origin\" class=\"form-control\" " . $disabled . " value=\"" . $track->get_origin() . "\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<div class=\"col-md-10 col-md-offset-2\">\n\t\t\t\t\t\t\t<div class=\"checkbox\">\n\t\t\t\t\t\t\t\t<label for=\"censored\">\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" id=\"censored\" name=\"censored\" " . $disabled . " " . ($track->is_censored() ? "checked" : "") . ">\n\t\t\t\t\t\t\t\t\tExplicit\n\t\t\t\t\t\t\t\t</label>\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\t<div class=\"form-group\">\n\t\t\t\t\t\t<div class=\"col-md-10 col-md-offset-2\">\n\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary btn-block\">\n\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("save save") . "\n\t\t\t\t\t\t\t\tSave\n\t\t\t\t\t\t\t</button>\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\t<div class=\"col-md-5 form\">\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<label for=\"notes\">Notes</label>\n\t\t\t\t\t\t<textarea class=\"form-control\" id=\"notes\" name=\"notes\" " . $disabled . ">" . $track->get_notes() . "</textarea>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<label for=\"keyword\">Keywords</label>\n\t\t\t\t\t\t<div class=\"for-keywords\">";
foreach ($track->get_keywords() as $keyword) {
    echo "\n\t\t\t\t\t\t\t\t<div class=\"input-group\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-addon\"><a class=\"keyword-remove\" href=\"" . LINK_ABS . "ajax/del-keywords.php?track_id=" . $track->get_id() . "&keyword=" . $keyword->get_text() . "\">" . Bootstrap::glyphicon("remove-sign") . "</a></span>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" disabled value=\"" . $keyword->get_text() . "\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t";
}
echo "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"input-group\">\n\t\t\t\t\t\t\t<span class=\"input-group-addon\">" . Bootstrap::glyphicon("tag") . "</span>\n\t\t\t\t\t\t\t<input type=\"text\" id=\"new_keyword\" name=\"new_keyword\" class=\"form-control\" " . $disabled . " placeholder=\"Add new keyword...\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t<label for=\"type\">Audio Type</label>\n\t\t\t\t\t\t<select class=\"selectpicker\" id=\"type\" name=\"type\" data-width=\"100%\" " . $disabled . ">";
foreach (AudioTypes::get_all() as $audiotype) {
    if ($audiotype->get_id() == $track->get_type()->get_id()) {
        echo "<option value=\"" . $audiotype->get_id() . "\" selected=\"selected\">" . $audiotype->get_name() . "</option>";
    } else {
        echo "<option value=\"" . $audiotype->get_id() . "\">" . $audiotype->get_name() . "</option>";
    }
}
echo "</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<hr />\n\t\t\t\t\t";
if (Session::is_group_user("Playlist Editor")) {
    $playlists = array();
    foreach ($track->get_playlists_in() as $playlist) {
        $playlists[] = $playlist->get_id();
    }
    echo "<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) . "\" id=\"playlists\" class=\"playlist-add btn btn-primary btn-block\">" . Bootstrap::glyphicon("th-list") . " Playlists</a>";
}
echo "\n\t\t\t\t\t<a href=\"#\" id=\"flag\" class=\"btn btn-danger btn-block" . ($track->is_flagged() ? " active" : "") . "\">" . Bootstrap::glyphicon("warning-sign censor-flag") . " Flag for censorship</a>\n\t\t\t\t\t" . (Session::is_group_user("Music Admin") ? "<hr /><a href=\"" . LINK_ABS . "audio/get/" . $track->get_id() . ".flac\" class=\"btn btn-primary btn-block\">" . Bootstrap::glyphicon("download-alt") . " Download FLAC</a>" : "") . "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</fieldset>\n\t</form>\n";
if (Session::is_group_user("Playlist Editor")) {
    $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>");
}