当前位置: 首页>>代码示例>>PHP>>正文


PHP Bootstrap::alert_message_basic方法代码示例

本文整理汇总了PHP中Bootstrap::alert_message_basic方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::alert_message_basic方法的具体用法?PHP Bootstrap::alert_message_basic怎么用?PHP Bootstrap::alert_message_basic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bootstrap的用法示例。


在下文中一共展示了Bootstrap::alert_message_basic方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?php

Output::set_title("Fault Reporting");
Output::add_stylesheet(LINK_ABS . "faults/style.css");
Output::add_stylesheet(LINK_ABS . "faults/status.css");
MainTemplate::set_subtitle("View updates and report faults");
echo Bootstrap::alert_message_basic("warning", "Most systems are operational", "System Status:", false);
echo "<ul class=\"serviceList\">";
$statuses = Statuses::get(NULL);
foreach ($statuses as $status) {
    $statusInfo = $status->get_status_info();
    echo "<li class=\"serviceList__item\">\r\n      <p class=\"serviceList__status\"><span class=\"serviceStatusTag\" style=\"color:#" . $statusInfo['colour'] . "\">" . $statusInfo['status'] . "</span></p>\r\n      <p class=\"serviceList__name\">\r\n        " . $status->get_name() . "\r\n        <span class=\"serviceList__description has-tooltip\" data-toggle=\"tooltip\" data-placement=\"right\" title=\"" . $status->get_description() . "\"></span>\r\n      </p>\r\n    </li>";
}
echo "</ul>";
开发者ID:radiowarwick,项目名称:digiplay,代码行数:14,代码来源:index.php

示例2: Request

<?php

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

示例3: array

    } else {
        $track = $result->fetch();
        $query = "SELECT * FROM sustschedule order by id asc limit 1";
        $result = DigiplayDB::query($query);
        $scheduleslot = $result->fetch();
        if ($track['id'] != $scheduleslot['audioid']) {
            $query = "UPDATE sustschedule SET audioid=:trackid, trim_start_smpl=0, trim_end_smpl = :tracklength, fade_in = 0, fade_out = :tracklength WHERE id = :scheduleslot";
            $parameters = array(':trackid' => $track['id'], ':tracklength' => $track['length_smpl'], ':scheduleslot' => $scheduleslot['id']);
            DigiplayDB::query($query, $parameters);
            $query = "INSERT INTO sustlog (audioid,userid,timestamp) VALUES (:audioid,:userid,:timestamp)";
            date_default_timezone_set("Europe/London");
            $parameters = array(':audioid' => $track['id'], ':userid' => Session::get_id(), ':timestamp' => time());
            DigiplayDB::query($query, $parameters);
            echo Bootstrap::alert_message_basic("info", "Track Scheduled.");
        } else {
            echo Bootstrap::alert_message_basic("warning", "This track is already at the top of the queue.");
        }
    }
}
$currentQueue = Sustainer::get_queue();
$i = 0;
echo "<h3>Current queue:</h3>";
if (!is_null($currentQueue)) {
    if (array_key_exists('id', $currentQueue)) {
        $currentQueueTemp = array(0 => $currentQueue);
        $currentQueue = $currentQueueTemp;
    }
    echo "<table class=\"table table-striped table-bordered\">\r\n\t\t<thead>\r\n\t\t<tr>\r\n\t\t<th></th>\r\n\t\t<th>Title</th>\r\n\t\t<th>Artist</th>\r\n\t\t<th>Album</th>\r\n\t\t</tr>\r\n\t\t</thead>\r\n\t\t<tbody>";
    foreach ($currentQueue as $row) {
        $i++;
        echo "<tr>\r\n\t\t\t<td>" . $i . "</td>\r\n\t\t<td>" . $row['title'] . "</td>\r\n\t\t<td>" . $row['artist'] . "</td>\r\n\t\t<td>" . $row['album'] . "</td>\r\n\t\t</tr>";
开发者ID:radiowarwick,项目名称:digiplay,代码行数:31,代码来源:index.php

示例4: trigger_error

            $track->save();
            echo Bootstrap::alert("success", "The track " . $track->get_title() . " by " . $track->get_artists_str() . " has been uncensored.", "Track uncensored!");
        } else {
            trigger_error("The track you are trying to uncensor doesn't exist!");
        }
    }
}
if (isset($_REQUEST["unflag"]) && is_numeric($_REQUEST["unflag"])) {
    if (!Session::is_group_user("Censor")) {
        echo Bootstrap::alert_message_basic("error", "You are trying to unflag a track, but you do not have the required privileges!", "Error!");
    } else {
        $track = Tracks::get_by_id($_REQUEST["unflag"]);
        if ($track) {
            $track->set_flagged(false);
            $track->save();
            echo Bootstrap::alert_message_basic("success", "The track " . $track->get_title() . " by " . $track->get_artists_str() . " has been unflagged.", "Track unflagged!");
        } else {
            trigger_error("The track you are trying to unflag doesn't exist!");
        }
    }
}
echo "<h3>Flagged for Censorship</h3>";
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>";
开发者ID:radiowarwick,项目名称:digiplay,代码行数:31,代码来源:index.php

示例5: for

<?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?");
开发者ID:radiowarwick,项目名称:digiplay,代码行数:10,代码来源:index.php

示例6: __toString

 public function __toString()
 {
     return Bootstrap::alert_message_basic("danger", (Session::is_developer() ? "Error on line " . $this->line . " in file " . $this->file . ":\n" : "Error: Please contact a developer!\n ") . $this->string, $this->error_type() . ":");
 }
开发者ID:radiowarwick,项目名称:digiplay,代码行数:4,代码来源:Errors.php

示例7: function

<?php

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

示例8: scandir

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>";
开发者ID:radiowarwick,项目名称:digiplay,代码行数:31,代码来源:index.php

示例9: exit

Output::set_title("Track Detail");
MainTemplate::set_subtitle("View and edit track metadata");
Output::add_stylesheet(LINK_ABS . "css/bootstrap-select.css");
Output::add_script(LINK_ABS . "js/bootstrap-select.js");
if (!isset($_GET['id'])) {
    exit("<h3>No track specified</h3><h4>You must access this via another page, to get metadata for a specified track.</h4>");
}
if (!($track = Tracks::get($_GET["id"]))) {
    exit("<h3>Invalid track ID</h3><h4>If you got to this page via a link from somewhere else on the site, there may be a bug.  A bug you should bug the techies about!</h4>");
}
if (!Session::is_group_user("Music Admin")) {
    $disabled = " disabled";
} else {
    $disabled = "";
}
echo "\n\t<script>\n\t\t\$(function () {\n\t\t\t\$('.track-detail-form').submit(function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsubmit = \$(this).find('button[type=\"submit\"]');\n\t\t\t\tsubmit.find('span').removeClass('glyphicon-save').addClass('glyphicon-refresh');\n\t\t\t\t\$.ajax({\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-detail-update.php',\n\t\t\t\t\tdata: \$(this).serialize(),\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\tsubmit.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-save');\n\t\t\t\t\t\t\$('h3').after('" . Bootstrap::alert_message_basic("danger", "'+value.error+'", "Error!") . "');\n\t\t\t\t\t\tconsole.error(value.detail);\n\t\t\t\t\t\t\$('.alert-message').alert();\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\tsubmit.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-save');\n\t\t\t\t\t\t\$('h3').after('" . Bootstrap::alert_message_basic("success", "Track details altered.", "Success!", false) . "');\n\t\t\t\t\t\t\$('[id=new_artist]').val('');\n\t\t\t\t\t\t\$('[id=artist\\\\[\\\\]]').parent('.col-md-10').remove();\n\t\t\t\t\t\tartists_str = '';\n\t\t\t\t\t\tfirst = true;\n\t\t\t\t\t\t\$.each(values.artists, function(i, val) {\n\t\t\t\t\t\t\tartists_str += '<div class=\"col-md-10'+(first? '' : ' col-md-offset-2')+'\"><input type=\"text\" id=\"artist[]\" name=\"artist[]\" class=\"form-control" . $disabled . "\" value=\"'+val+'\"></div>';\n\t\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\$('[for=artist]').after(artists_str);\n\t\t\t\t\t\t\$('[id=new_keyword]').val('');\n\t\t\t\t\t\t\$('.keyword').parent().remove();\n\t\t\t\t\t\tkeywords_str = '';\n\t\t\t\t\t\t\$.each(values.keywords, function(i, val) {\n\t\t\t\t\t\t\tkeywords_str += '<div class=\"input-group\"><span class=\"input-group-addon\"><a class=\"keyword-remove\" href=\"" . LINK_ABS . "ajax/del-keywords.php?track_id=" . $track->get_id() . "&keyword='+val+'\">" . Bootstrap::glyphicon("remove-sign") . "</a></span><input type=\"text\" class=\"form-control\" disabled value=\"'+val+'\"></div></div>'\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\$('.for-keywords').html(keywords_str);\n\t\t\t\t\t\tsetTimeout(function() {\n    \t\t\t\t\t\t\$('.alert').hide('fast', function(){\n        \t\t\t\t\t\t\$(this).remove(); \n           \t\t\t\t});},4000);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t\$('.keyword-remove').on(\"click\", function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tparent = \$(this).parent().parent();\n\t\t\t\t\$.get(\$(this).attr('href'), function(data) {\n\t\t\t\t\tif(data == \"success\") {\n\t\t\t\t\t\tparent.remove();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\$('h3').after('" . Bootstrap::alert_message_basic("danger", "'+data+'", "Error!") . "');\n\t\t\t\t\t\t\$('.alert-message').show('fast').alert();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t\$('[id=flag]').click(function() {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tt = \$(this);\n\t\t\t\tt.find('.censor-flag').removeClass('glyphicon-warning-sign').addClass('glyphicon-refresh');\n\t\t\t\t\$.ajax({\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/flag.php',\n\t\t\t\t\tdata: 'id=" . $track->get_id() . "&flag=toggle',\n\t\t\t\t\ttype: 'GET',\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\t\$('h3').after('" . Bootstrap::alert_message_basic("danger", "'+value.error+'", "Error!") . "');\n\t\t\t\t\t\t\$('.alert-message').alert();\n\t\t\t\t\t\tt.find('.censor-flag').removeClass('glyphicon-refresh').addClass('glyphicon-warning-sign');\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\tt.find('.censor-flag').removeClass('glyphicon-refresh').addClass('glyphicon-warning-sign');\n\t\t\t\t\t\t\tif(value.response == 'flagged') {\n\t\t\t\t\t\t\t\tt.addClass('active');\n\t\t\t\t\t\t\t\tresponse = 'This track has been flagged for censorship and will be reviewed in due course.';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tt.removeClass('active');\n\t\t\t\t\t\t\t\tresponse = 'This track has been unflagged.';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\$('h3').after('" . Bootstrap::alert_message_basic("warning", "'+response+'", "Success!", false) . "'); \n\t\t\t\t\t\t\tsetTimeout(function() {\n\t    \t\t\t\t\t\t\$('.alert').hide('fast', function(){\n\t        \t\t\t\t\t\t\$(this).remove(); \n\t           \t\t\t\t});},4000);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n" . (Session::is_group_user("Playlist Editor") ? "\n\t\t\tvar item;\n\t\t\t\$('.playlist-add').click(function() {\n\t\t\t\titem = \$(this);\n\t\t\t\tplaylists = \$(this).attr('data-playlists-in').split(',');\n\t\t\t\t\$('.playlist-select').parent().removeClass('active');\n\t\t\t\t\$('.playlist-select').find('span').removeClass('glyphicon-minus').addClass('glyphicon-plus');\n\t\t\t\t\$('.playlist-select').each(function() {\n\t\t\t\t\tif(\$.inArray(\$(this).attr('data-playlist-id'),playlists) > -1) {\n\t\t\t\t\t\t\$(this).find('span').removeClass('icon-plus').addClass('glyphicon-minus');\n\t\t\t\t\t\t\$(this).parent().addClass('active');\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\n\t\t\t\$('.playlist-select').click(function() {\n\t\t\t\tobj = \$(this);\n\t\t\t\tif(\$(this).parent().hasClass('active')) {\n\t\t\t\t\t\$(this).find('span').removeClass('glyphicon-minus').addClass('glyphicon-refresh');\n\t\t\t\t\t\$.ajax({\n\t\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\n\t\t\t\t\t\tdata: 'trackid='+item.attr('data-dps-id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=del',\n\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\n\t\t\t\t\t\t\talert(value.error);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\t\t\tvalues = \$.parseJSON(data);\n\t\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\n\t\t\t\t\t\t\tobj.parent().removeClass('active');\n\t\t\t\t\t\t\titem.attr('data-playlists-in',values.playlists.join(','));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-refresh');\n\t\t\t\t\t\$.ajax({\n\t\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\n\t\t\t\t\t\tdata: 'trackid='+item.attr('data-dps-id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=add',\n\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\terror: function(xhr,text,error) {\n\t\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\n\t\t\t\t\t\t\talert(value.error);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess: function(data,text,xhr) {\n\t\t\t\t\t\t\tvalues = \$.parseJSON(data);\n\t\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\n\t\t\t\t\t\t\tobj.parent().addClass('active');\n\t\t\t\t\t\t\titem.attr('data-playlists-in',values.playlists.join(','));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\$(this).parent().addClass('active');\n\t\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-minus');\n\t\t\t\t}\n\t\t\t});\t\t\n" : "") . "\n\t\t});\n\t</script>\n\t<h3>Edit Track: " . $track->get_id() . " <small>Added " . date("d/m/Y H:i", $track->get_import_date()) . "</small></h3>\n\t" . (Session::is_group_user("Music Admin") ? "" : Bootstrap::alert_message_basic("info", "You can't edit the details of this track, because you aren't a Music Admin.", "Notice:"));
echo $track->player() . "\n\t<form class=\"track-detail-form\" action=\"\" method=\"post\">\n\t\t<fieldset>\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-7 form-horizontal\">\n\t\t\t\t\t<input type=\"hidden\" id=\"id\" name=\"id\" value=\"" . $track->get_id() . "\">\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=\"title\">Title</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=\"title\" name=\"title\" class=\"form-control\" " . $disabled . " value=\"" . $track->get_title() . "\">\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=\"artist\">Artists</label>";
$first = true;
foreach ($track->get_artists() as $key => $artist) {
    echo "\n\t\t\t\t\t\t<div class=\"col-md-10" . (!$first ? " col-md-offset-2" : "") . "\">\n\t\t\t\t\t\t\t<input type=\"text\" id=\"artist[]\"  name=\"artist[]\" class=\"form-control\" " . $disabled . " value=\"" . $artist->get_name() . "\">\n\t\t\t\t\t\t</div>";
    $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 {
开发者ID:radiowarwick,项目名称:digiplay,代码行数:31,代码来源:index.php


注:本文中的Bootstrap::alert_message_basic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。