本文整理汇总了PHP中Bootstrap::glyphicon方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::glyphicon方法的具体用法?PHP Bootstrap::glyphicon怎么用?PHP Bootstrap::glyphicon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::glyphicon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output
public function output($path, $tabs, $li_class = false)
{
$out = "\n" . str_repeat("\t", $tabs);
$out .= "<li class=\"" . ($this->active ? "active " : "") . ($li_class ? $li_class : "") . "\">";
$out .= "<a href=\"" . $this->url($path) . "\">";
if (strlen($this->icon) > 0) {
$out .= Bootstrap::glyphicon($this->icon);
}
$out .= $this->label . "</a>";
if (isset($this->menu)) {
$out .= $this->menu->output($path . $this->url . "/", $tabs + 1);
}
$out .= "</li>";
return $out;
}
示例2: foreach
<style type="text/css">
table { font-size:1.2em; }
thead { display:none; }
.description { font-size:0.8em; font-style:italic; }
.hover-info { display:none; }
.table tbody tr.success td { background-color: #DFF0D8; }
</style>
<?php
echo "\t<div class=\"row\"><div class=\"col-md-3\"><div class=\"well\"><p><a href=\"#\" class=\"btn btn-success\" id=\"create\">Create New Audiowall</a></p><p>An Audiowall is a 3x4 grid of buttons in Digiplay which play audio when pressed. They are displayed on the right hand side of the touchscreen in the studio. The top audiowall is set for everyone and contains core station imaging, promos and beds. The bottom audiowall can be set on this page, and may contain jingles and other audio specific to your show.</p></div></div><div class=\"col-md-9\">\t<table class=\"table table-striped\" cellspacing=\"0\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th></th>\n\t\t\t\t\t<th>Name</th>\n\t\t\t\t\t<th style=\"width:65px\"></th>\n\t\t\t\t\t<th style=\"width:185px\"></th>\n\t\t\t\t</tr>\n\t\t\t</thead><tbody>";
foreach ($sets as $set) {
if (!$set->user_can_view() && !Session::is_group_user('Audiowalls Admin')) {
continue;
}
echo "<tr" . ($set->get_id() == $active ? ' class="success"' : '') . "><td class=\"wall-info\" >";
if ($set->user_can_delete()) {
echo "<a href=\"users/users-viewers.php?setid=" . $set->get_id() . "\">" . Bootstrap::glyphicon("info-sign") . "</a>";
}
echo "</td><td><strong>" . $set->get_name() . "</strong><br /><span class=\"description\">" . $set->get_description() . "</span></td>";
$station_aw = DigiplayDB::select("val FROM configuration WHERE parameter = 'station_aw_set' AND location = '1'");
if (!($set->get_id() == (int) $station_aw)) {
if ($set->user_can_delete() || Session::is_group_user('Audiowalls Admin')) {
echo "<td class=\"delete-aw-btn\" data-aw-name=\"" . $set->get_name() . "\" data-dps-set-id=\"" . $set->get_id() . "\" style=\"width:65px\"><a href=\"#\" class=\"btn btn-danger\">Delete</a></td>";
} else {
echo "<td style=\"width:65px\"></td>";
}
} else {
echo "<td style=\"width:65px\"></td>";
}
if ($set->user_can_edit() || Session::is_group_user('Audiowalls Admin')) {
echo "<td style=\"width:65px\"><a href=\"edit.php?id=" . $set->get_id() . "\" class=\"btn btn-primary\">Edit</a></td>";
} else {
示例3:
<?php
Output::set_title("Administration");
MainTemplate::set_subtitle("Control every aspect of the Digiplay system");
$trash = Files::get_by_id(3, "dir");
echo "\n<div class=\"row\">\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "admin/music\">\n\t\t\t<div class=\"panel panel-info\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("volume-up icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . Tracks::get_total_tracks() . "</h2>\n\t\t\t\t\t\t\t<h4>tracks</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "admin/users\">\n\t\t\t<div class=\"panel panel-success\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("user icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . Users::count() . "</h2>\n\t\t\t\t\t\t\t<h4>users</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "showplans\">\n\t\t\t<div class=\"panel panel-default\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("tasks icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . Showplans::count() . "</h2>\n\t\t\t\t\t\t\t<h4>showplans</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n</div>\n<div class=\"row\">\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "audiowalls\">\n\t\t\t<div class=\"panel panel-default\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("th icon-huge\" style=\"margin-top: -4px;") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . AudiowallSets::count() . "</h2>\n\t\t\t\t\t\t\t<h4>audiowalls</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "email\">\n\t\t\t<div class=\"panel panel-warning\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("envelope icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . Emails::count_unread() . "</h2>\n\t\t\t\t\t\t\t<h4>e-mails</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n\t<div class=\"col-sm-4\">\n\t\t<a href=\"" . LINK_ABS . "admin/trash\">\n\t\t\t<div class=\"panel panel-danger\">\n\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t<div class=\"row dashboard-stamp\">\n\t\t\t\t\t\t<div class=\"col-xs-5\">\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("trash icon-huge") . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-xs-7\">\n\t\t\t\t\t\t\t<h2>" . $trash->count() . "</h2>\n\t\t\t\t\t\t\t<h4>in trash</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\n</div>";
示例4: foreach
<?php
Output::set_title("System Information");
Output::add_stylesheet(LINK_ABS . "faults/comment.css");
MainTemplate::set_subtitle("View updates and report faults");
$faults = Faults::get(NULL, Session::get_id());
foreach ($faults as $fault) {
$title = "<b>Fault ID: DIGI_" . $fault->get_id() . " </b><small>Assigned to: " . $fault->get_real_assignedto($fault->get_assignedto()) . "</small><span class=\"pull-right label label-" . $fault->get_panel_class() . "\">" . $fault->get_real_status() . "</span>";
$footer = "<a data-toggle=\"modal\" href=\"#add-comment\" class=\"btn btn-primary btn-xs new-comment\" data-dps-id=" . $fault->get_id() . ">Add Comment</a>";
if (Comments::get_fault_comments($fault->get_id()) != 0) {
$footer .= "<span class=\"pull-right\"><a class=\"accordion-toggle\" data-toggle=\"collapse\" href=\"#collapse-" . $fault->get_id() . "\">" . Bootstrap::glyphicon("plus") . "</a></span></div><div id=\"collapse-" . $fault->get_id() . "\" class=\"panel-collapse collapse\"><div class=\"panel-body\">";
$comments = Comments::get_by_fault($fault->get_id());
foreach ($comments as $comment) {
if ($comment->get_author() == -1) {
$footer .= "<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-md-6 col-md-offset-3\"><hr></div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t <div class=\"col-md-8 col-md-offset-2 system-comment\"><b style=\"color: #f0ad4e;\">System:</b> " . $comment->get_comment() . "<br><span>" . $comment->get_postdate() . "</span></div>\t\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-md-6 col-md-offset-3\"><hr></div>\r\n\t\t\t\t\t\t</div>";
} else {
if ($comment->get_author() == $fault->get_author()) {
$footer .= "\r\n\t\t \t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t" . $comment->get_comment() . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"panel-footer\"><span class=\"glyphicon glyphicon-time fault-time\" aria-hidden=\"true\"></span>" . $comment->get_postdate() . "<span class=\"glyphicon glyphicon-user fault-user\" aria-hidden=\"true\"></span>" . $comment->get_real_author($comment->get_author()) . "<span class=\"label label-success\">Customer</span></div>\r\n\t\t\t\t</div>\r\n\t\t\t\t";
} else {
$footer .= "\t\t \t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t" . $comment->get_comment() . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"panel-footer\"><span class=\"glyphicon glyphicon-time fault-time\" aria-hidden=\"true\"></span>" . $comment->get_postdate() . "<span class=\"glyphicon glyphicon-user fault-user\" aria-hidden=\"true\"></span>" . $comment->get_real_author($comment->get_author()) . "<span class=\"label label-danger\">Developer</span></div>\r\n\t\t\t\t</div>";
}
}
}
$footer .= "</div>";
}
$body = "<p><i>Submitted by: <b>" . $fault->get_real_author($fault->get_author()) . "</b> on: <b>" . $fault->get_postdate() . "</b></i><hr></p>\r\n\t<p>" . $fault->get_content() . "</p>";
echo Bootstrap::panel($fault->get_panel_class(), $body, $title, $footer);
}
$title = "<span id=\"comment-status-title\">Add a comment to the fault DIGI_</span>";
$body = "<form role=\"form\">\r\n <div class=\"form-group\">\r\n \t<input type=\"hidden\" class=\"fault-comment-id\">\r\n <textarea class=\"form-control fault-comment-value\" rows=\"3\"></textarea>\r\n </div>\r\n <div class=\"form-group\">\r\n <button type=\"submit\" class=\"btn btn-primary confirm-fault-comment\">Add Comment</button>\r\n <a href=\"#\" data-dismiss=\"modal\" class=\"btn btn-default\">Cancel</a>\r\n </div>\r\n</form>";
echo Bootstrap::modal("add-comment", $body, $title);
示例5: print_groups
<?php
Output::set_title("Group Administration");
MainTemplate::set_subtitle("View and edit groups");
Output::require_group("Group Admin");
function print_groups($group)
{
$groups = Groups::get_by_parent($group);
if ($groups) {
echo "<ul>";
foreach ($groups as $group) {
echo "<li data-group-id=\"" . $group->get_id() . "\" data-description=\"" . $group->get_description() . "\">" . $group->get_name() . "</li>";
print_groups($group);
}
echo "</ul>";
}
}
echo "\r\n\t<script>\r\n\t\$(document).ready(function() {\r\n\t\t\$(document).on('click', '#groups li', function() {\r\n\t\t\t\$('#group-info h3').html(\$(this).html());\r\n\t\t\t\$('#group-description').html(\$(this).attr('data-description'));\r\n\t\t\t\$('#group-info').attr('data-group-id',\$(this).attr('data-group-id'));\r\n\t\t\t\$('#group-members ul').html('');\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/group-admin.php?action=members&group='+\$(this).attr('data-group-id'),\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t}).done(function(data) {\r\n\t\t\t\t\$.each(data, function(id,user) {\r\n\t\t\t\t\t\$('#group-members ul').append('<li class=\"list-group-item\" data-user-id=\"'+id+'\">'+user+'" . Bootstrap::glyphicon("remove pull-right") . "</li>');\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t\t\$(document).on('click', '.glyphicon-remove', function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/group-admin.php?action=del-user&user='+\$(this).parent().attr('data-user-id')+'&group='+\$(this).parents('#group-info').attr('data-group-id'),\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t}).done(function(data) {\r\n\t\t\t\t\$.each(data, function(id,user) {\r\n\t\t\t\t\t\$('[data-user-id='+id+']').remove();\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t\t\$(document).on('submit', '.form-horizontal', function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/group-admin.php?action=add-user&user='+\$(this).find('input').val()+'&group='+\$(this).parents('#group-info').attr('data-group-id'),\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t}).done(function(data) {\r\n\t\t\t\t\$('input').val('');\r\n\t\t\t\t\$.each(data, function(id,user) {\r\n\t\t\t\t\t\$('#group-members ul').append('<li class=\"list-group-item\" data-user-id=\"'+id+'\">'+user+'" . Bootstrap::glyphicon("remove pull-right") . "</li>');\r\n\t\t\t\t})\r\n\t\t\t});\r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\t\$('#groups').find('li:first').click();\r\n\t});\r\n\t</script>\r\n\r\n\t<div class=\"row\">\r\n\t\t<div class=\"col-md-6\">\r\n\t\t\t<h3>Group tree</h3>\r\n\t\t\t<div id=\"groups\">\r\n";
print_groups(NULL);
echo "\r\n\t\t</div>\r\n\t</div>\r\n\t<div class=\"col-md-6\">\r\n\t\t<div id=\"group-info\">\r\n\t\t\t<h3></h3>\r\n\t\t\t<div id=\"group-description\"></div>\r\n\t\t\t<h4>Members:</h4>\r\n\t\t\t<div id=\"group-members\">\r\n\t\t\t\t<ul class=\"list-group\">\r\n\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\r\n\t\t\t<form class=\"form-horizontal\">\r\n\t\t\t\t<div class=\"form-group\">\r\n\t\t\t\t\t<div class=\"col-xs-9\">\r\n\t\t\t\t\t\t<input type=\"text\" id=\"add-user\" class=\"form-control\" placeholder=\"Add user...\" />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary col-xs-3\" id=\"add-user-submit\">Add</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n";
示例6: Request
Output::set_title("Requested Tracks");
Output::add_stylesheet(LINK_ABS . "css/music.css");
Output::add_script(LINK_ABS . "js/bootstrap-popover.js");
MainTemplate::set_subtitle("Want to play a track, but it's not in the database? Request it here");
if (isset($_REQUEST["name"]) && isset($_REQUEST["artistname"])) {
$request = new Request();
$request->set_name($_REQUEST["name"]);
$request->set_artist_name($_REQUEST["artistname"]);
$request->set_user(Session::get_user());
$request->save();
}
if (isset($_REQUEST["delete"])) {
if (!Session::is_group_user("Music Admin")) {
echo Bootstrap::alert_message_basic("error", "You are trying to delete a request, but you do not have the requred privelidges!", "Error!");
} else {
$request = Requests::get_by_id($_REQUEST["delete"]);
if ($request) {
$request->delete();
}
}
}
echo "\n<h3 style=\"margin-top: -4px\">Request a track</h3>\n<form action=\"\" method=\"post\" name=\"request-track\" class=\"form-inline\">\n\t<div class=\"form-group\">\n\t\t<input type=\"text\" name=\"artistname\" placeholder=\"Artist...\" class=\"form-control\">\n\t</div>\n\t<div class=\"form-group\">\n\t\t<input type=\"text\" name=\"name\" placeholder=\"Title...\" class=\"form-control\">\n\t</div>\n\t<div class=\"form-group\">\n\t\t<input type=\"submit\" value=\"Request\" class=\"btn btn-primary\">\n\t</div>\n</form>";
if ($requested = Requests::get_all()) {
echo "\n<table class=\"table table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"artist\">Artist</th>\n\t\t\t<th class=\"title\">Title</th>\n\t\t\t<th class=\"date nowrap\">Date Requested</th>\n\t\t\t<th class=\"requester nowrap\">Requester</th>\n\t\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
foreach ($requested as $request) {
echo "\n\t<tr id=\"" . $request->get_id() . "\">\n\t\t<td class=\"artist\">" . $request->get_artist_name() . "</td>\n\t\t<td class=\"title\">" . $request->get_name() . "</td>\n\t\t<td class=\"date nowrap\">" . date("d/m/Y H:i", $request->get_date()) . "</td>\n\t\t<td class=\"requester nowrap\">" . $request->get_user()->get_username() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"" . LINK_ABS . "music/request/?delete=" . $request->get_id() . "\" class=\"request-delete\" title=\"Delete this request\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
}
echo "\n</table>";
} else {
echo "\n<strong>No new requested tracks.</strong>";
}
示例7:
</div>
</div>
<div class="col-sm-5 selected-package">
<h2 id="package-name">Select a package</h2>
<p id="package-description">Choose a package from the left.</p>
<div class="btn-group">
<a href="#" class="btn btn-success disabled" data-toggle="tooltip" title="Coming soon!" id="edit"><?php
echo Bootstrap::glyphicon('pencil');
?>
Edit</a>
<a href="#" class="btn btn-warning disabled" id="archive"><?php
echo Bootstrap::glyphicon('eye-close');
?>
Archive</a>
<a href="#" class="btn btn-danger disabled" id="delete"><?php
echo Bootstrap::glyphicon('remove-sign');
?>
Delete</a>
</div>
<p></p>
<div class="input-group">
<input type="text" autocomplete="off" data-provide="typeahead" class="form-control typeahead" placeholder="Search for jingles to add...">
<span class="input-group-btn">
<button id="add-jingle" class="btn btn-default" type="button">Add</button>
</span>
</div>
<hr />
<p><span id="count-jingles">0</span> jingles in this package:</p>
<table class="table table-striped table-condensed">
<thead>
示例8: preg_replace
<?php
if (isset($_REQUEST['refer']) && Session::is_user()) {
$refer = preg_replace('/\\&/', '?', $_REQUEST["refer"], 1);
header("Location: " . LINK_ABS . $refer);
}
MainTemplate::set_feature_image(LINK_ABS . "img/homepage.png");
echo "\n\t\t<script type=\"text/javascript\">\n\t\t\$(function () {\n\t\t\t\$('#username').focus();\n\t\t\t\$('.form-signin').submit(function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t\$('#submit').button('loading');\n\t\t\t\t\$('.help-inline').remove();\n\t\t\t\t\$.post('ajax/login.php', \$(this).serialize(), function(data) {\n\t\t\t\t\tif(data == \"success\") { \n\t\t\t\t\t\tlocation.reload()\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\$('#submit').after('<span class=\"help-inline\">'+data+'</span>');\n\t\t\t\t\t\t\$('#submit').button('reset');\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\t\t});\n\t\t</script>";
$feature = "\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-sm-8\">\n\t\t\t\t\t<h1>Digiplay <small>by Radio Warwick</small></h1>\n\t\t\t\t\t<p>A magical software suite run by miniature elves, which is amazing because elves are already very small by their nature.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t" . (Session::is_user() ? "\n\t\t\t\t\t<h2>Common Tasks</h2>\n\t\t\t\t\t<a href=\"music/upload/\" class=\"btn btn-primary btn-large btn-block\">Upload Audio »</a>\n\t\t\t\t\t<a href=\"playlists/\" class=\"btn btn-primary btn-large btn-block\">Edit Playlists »</a>\n\t\t\t\t\t<a href=\"sustainer/\" class=\"btn btn-primary btn-large btn-block\">Schedule Prerecorded Content »</a>\n\t\t\t\t\t<a href=\"faults/\" class=\"btn btn-primary btn-large btn-block\">Report a Fault »</a>\n\t\t\t\t\t" . (Session::is_group_user("Studio Admin") ? "<a href=\"reset.php\" class=\"btn btn-primary btn-large btn-block\">Reset Playout Systems »</a>" : "") . "\n\t\t\t\t" : "\n\t\t\t\t\t<form class=\"form-signin\" action=\"ajax/login.php\" method=\"post\">\n\t\t\t\t\t\t<div class=\"form-group" . (isset($_REQUEST['refer']) ? " has-error" : "") . "\">\n\t\t\t\t\t\t\t<input id=\"username\" name=\"username\" type=\"text\" class=\"form-control input-lg\" placeholder=\"Username\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"form-group" . (isset($_REQUEST['refer']) ? " has-error" : "") . "\">\n\t\t\t\t\t\t\t<input id=\"password\" name=\"password\" type=\"password\" class=\"form-control input-lg\" placeholder=\"Password\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"btn btn-lg " . (isset($_REQUEST['refer']) ? "btn-danger" : "btn-primary") . " btn-block\" id=\"submit\" name=\"submit\" value=\"Log In\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t") . "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t";
MainTemplate::set_feature_html($feature);
echo "<div class=\"row\">\n\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t<h2>Music Library</h2>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt>Tracks Stored</dt>\n\t\t\t\t\t<dd>" . number_format(Tracks::get_total_tracks()) . "</dd>\n\t\t\t\t\t<dt>Length of Tracks</dt>\n\t\t\t\t\t<dd>" . Time::format_pretty(Tracks::get_total_length()) . "</dd>\n\t\t\t\t\t<dt>Playlisted Tracks</dt>\n\t\t\t\t\t<dd>" . (count(Tracks::get_playlisted()) - count(Tracks::get_playlisted(Playlists::get(0)))) . "</dd>\n\t\t\t\t</dl>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t<h2>Sustainer Service</h2>\n\t\t\t\t<dl>\n\t\t\t\t\t<dt>Tracks on Sustainer</dt>\n\t\t\t\t\t<dd>" . Sustainer::get_total_tracks() . "</dd>\n\t\t\t\t\t<dt>Length of Sustainer Playlist</dt>\n\t\t\t\t\t<dd>" . Sustainer::get_total_length_formatted() . "</dd>\n\t\t\t\t</dl>\n\t\t\t\t<a class=\"btn btn-primary btn-block\" href=\"" . LINK_ABS . "sustainer/\">" . Bootstrap::glyphicon("headphones") . "Now playing</a>\n\t\t\t\t<a class=\"btn btn-primary btn-block\" href=\"" . LINK_ABS . "playlists/detail/0\">" . Bootstrap::glyphicon("list") . "View playlist</a>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-4\">\n\t\t\t\t<h2>Newest Tracks</h2>";
$tracks = Tracks::get_newest(4);
echo "<table class=\"table table-striped table-hover table-condensed\" cellspacing=\"0\">";
foreach ($tracks as $track) {
echo "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"icon\">\n\t\t\t\t\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $track->get_id() . "\" class=\"track-info\">\n\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"title\">" . $track->get_title() . " by " . $track->get_artists_str() . "</td>\n\t\t\t\t\t</tr>";
}
echo "\n\t\t\t\t</table>\n\t\t\t\t<a class=\"btn btn-primary btn-block\" href=\"" . LINK_ABS . "music/\">" . Bootstrap::glyphicon("chevron-right") . "More</a>\n\t\t\t</div>\n\t\t</div>";
if (Session::is_user()) {
$lastlogin = Session::get_lastlogin();
if ($lastlogin) {
echo "<p class=\"text-success\">You last logged in: " . strftime("%A %e %B %G %H:%M", $lastlogin) . "</p>";
} else {
echo "<p class=\"text-success\">You've never logged in before! Welcome to the Digiplay Web Management System.</p>";
}
echo "<h4>Tracks of the Day:</h4><ul>";
$tracks = Tracks::get_tracks_of_the_day(3);
foreach ($tracks as $track) {
echo "<li><a href=\"music/detail/" . $track->get_id() . "\">" . $track->get_artists_str() . " - " . $track->get_title() . "</a></li>";
}
echo "</ul>";
}
示例9: Paginator
MainTemplate::set_subtitle("List tracks on a playlist, remove tracks");
$tracks = $playlist->get_tracks($limit, ($page - 1) * $limit);
if ($tracks) {
$pages = new Paginator();
$pages->items_per_page = $limit;
$pages->querystring = $playlist->get_id();
$pages->mid_range = 5;
$pages->items_total = $playlist->count_tracks();
$pages->paginate();
$low = ($page - 1) * $limit + 1;
$high = $low + $limit - 1 > $pages->items_total ? $pages->items_total : $low + $limit - 1;
echo "<script>\r\n\t\t\$(function () {\r\n\t\t\t\$('.track-info').popover({\r\n\t\t\t\t'html': true, \r\n\t\t\t\t'trigger': 'hover',\r\n\t\t\t\t'title': function() { \r\n\t\t\t\t\treturn(\$(this).parent().parent().find('.title').html())\r\n\t\t\t\t},\r\n\t\t\t\t'content': function() {\r\n\t\t\t\t\treturn(\$(this).parent().find('.hover-info').html());\r\n\t\t\t\t}\r\n\t\t\t});\r\n" . (Session::is_group_user("Playlist Editor") ? "\r\n\t\t\t\$('.track-remove').click(function() {\r\n\t\t\t\ttrackid = \$(this).attr('data-dps-track-id');\r\n\t\t\t\tplaylistid = \$(this).attr('data-dps-playlist-id');\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\r\n\t\t\t\t\tdata: 'playlistid='+playlistid+'&trackid='+trackid+'&action=del',\r\n\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n" : "") . "\t\t});\r\n\t</script>";
echo "<h3>Tracks on playlist '" . $playlist->get_name() . "'</h3>";
echo "<div class=\"row\"><div class=\"col-lg-5\"><h5>Showing results " . $low . " to " . $high . "</h5></div><div class=\"pull-right\">" . $pages->display_jump_menu() . $pages->display_items_per_page() . "</div></div>";
echo "<table class=\"table table-striped\" cellspacing=\"0\">\r\n\t<thead>\r\n\t\t<tr>\r\n\t\t\t<th class=\"icon\"> </th>\r\n\t\t\t<th class=\"artist\">Artist</th>\r\n\t\t\t<th class=\"title\">Title</th>\r\n\t\t\t<th class=\"album\">Album</th>\r\n\t\t\t<th class=\"length nowrap\">Length</th> \r\n\t\t\t" . (Session::is_group_user("Playlist Editor") ? "<th class=\"icon\"></th>" : "") . "\r\n\t\t</tr>\r\n\t</thead>";
foreach ($tracks as $track) {
echo "\r\n\t\t<tr id=\"" . $track->get_id() . "\">\r\n\t\t\t<td class=\"icon\">\r\n\t\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $track->get_id() . "\" class=\"track-info\">\r\n\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\r\n\t\t\t\t</a>\r\n\t\t\t\t<div class=\"hover-info\">\r\n\t\t\t\t\t<strong>Artist:</strong> " . $track->get_artists_str() . "<br />\r\n\t\t\t\t\t<strong>Album:</strong> " . $track->get_album()->get_name() . "<br />\r\n\t\t\t\t\t<strong>Year:</strong> " . $track->get_year() . "<br />\r\n\t\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($track->get_length()) . "<br />\r\n\t\t\t\t\t<strong>Origin:</strong> " . $track->get_origin() . "<br />\r\n\t\t\t\t\t" . ($track->get_reclibid() ? "<strong>Reclib ID:</strong> " . $track->get_reclibid() . "<br />" : "") . "\r\n\t\t\t\t\t<strong>Censored:</strong> " . ($track->is_censored() ? "Yes" : "No") . "<br /> \r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"artist\">" . $track->get_artists_str() . "</td>\r\n\t\t\t<td class=\"title\">" . $track->get_title() . "</td>\r\n\t\t\t<td class=\"album\">" . $track->get_album()->get_name() . "</td>\r\n\t\t\t<td class=\"length nowrap\">" . Time::format_succinct($track->get_length()) . "</td>";
echo (Session::is_group_user("Playlist Editor") ? "<td class=\"icon\"><a href=\"#\" data-dps-track-id=\"" . $track->get_id() . "\" data-dps-playlist-id=\"" . $playlist->get_id() . "\" class=\"track-remove\" title=\"Remove this track\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</a></td>" : "") . "\r\n\t\t</tr>";
}
echo "</table>";
echo $pages->return;
} else {
if ($playlist) {
echo "<h3>Sorry, no tracks are on the playlist '" . $playlist->get_name() . "'</h3>";
if (Session::is_group_user("Playlist Editor")) {
echo "<h4>You can add tracks by finding them in the music library and clicking the " . Bootstrap::glyphicon("plus-sign") . ".</h4>";
}
} else {
echo "Invalid playlist.";
}
}
示例10: foreach
echo "<strong>To flag a track for censorship, search for it in the music library, click the " . Bootstrap::glyphicon("info-sign") . " and click the \"Flag for censorship\" button.</strong>";
if ($flagged = Tracks::get_flagged()) {
echo "\n<table class=\"table table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th class=\"artist\">Artist</th>\n\t\t\t<th class=\"title\">Title</th>\n\t\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
foreach ($flagged as $flag) {
echo "\n\t<tr id=\"" . $flag->get_id() . "\">\n\t\t<td class=\"icon\">\n\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $flag->get_id() . "\" class=\"track-info\">\n\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t</a>\n\t\t\t<div class=\"hover-info\">\n\t\t\t\t<strong>Artist:</strong> " . $flag->get_artists_str() . "<br />\n\t\t\t\t<strong>Album:</strong> " . $flag->get_album()->get_name() . "<br />\n\t\t\t\t<strong>Year:</strong> " . $flag->get_year() . "<br />\n\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($flag->get_length()) . "<br />\n\t\t\t\t<strong>Origin:</strong> " . $flag->get_origin() . "<br />\n\t\t\t\t" . ($flag->get_reclibid() ? "<strong>Reclib ID:</strong> " . $flag->get_reclibid() . "<br />" : "") . "\n\t\t\t</div>\n\t\t</td>\n\t\t<td class=\"artist\">" . $flag->get_artists_str() . "</td>\n\t\t<td class=\"title\">" . $flag->get_title() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?censor=" . $flag->get_id() . "\" class=\"censor\" title=\"Approve censorship\" rel=\"twipsy\">" . Bootstrap::glyphicon("ok-sign") . "</td>\n\t\t<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?unflag=" . $flag->get_id() . "\" class=\"unflag\" title=\"Remove flag\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
}
echo "\n</table>";
} else {
echo "<h4>No tracks currently flagged for censorship.</h4>";
}
$limit = isset($_REQUEST['n']) ? $_REQUEST['n'] : 10;
$page = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1;
$num_of_censored = Tracks::count_censored();
if ($censored = Tracks::get_censored($limit, ($page - 1) * $limit)) {
$pages = new Paginator();
$pages->items_per_page = $limit;
$pages->querystring = NULL;
$pages->mid_range = 5;
$pages->items_total = $num_of_censored;
$pages->paginate();
$low = ($page - 1) * $limit + 1;
$high = $low + $limit - 1 > $num_of_censored ? $num_of_censored : $low + $limit - 1;
echo "\n<h3>Censored Tracks</h3>\n<table class=\"table table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th class=\"icon\"></th>\n\t\t\t<th class=\"artist\">Artist</th>\n\t\t\t<th class=\"title\">Title</th>\n\t\t\t" . (Session::is_group_user("Music Admin") ? "\n\t\t\t<th class=\"icon\"></th>" : "") . "\n\t\t</tr>\n\t</thead>";
foreach ($censored as $censor) {
echo "\n\t<tr id=\"" . $censor->get_id() . "\">\n\t\t<td class=\"icon\">\n\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $censor->get_id() . "\" class=\"track-info\">\n\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\n\t\t\t</a>\n\t\t\t<div class=\"hover-info\">\n\t\t\t\t<strong>Artist:</strong> " . $censor->get_artists_str() . "<br />\n\t\t\t\t<strong>Album:</strong> " . $censor->get_album()->get_name() . "<br />\n\t\t\t\t<strong>Year:</strong> " . $censor->get_year() . "<br />\n\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($censor->get_length()) . "<br />\n\t\t\t\t<strong>Origin:</strong> " . $censor->get_origin() . "<br />\n\t\t\t\t" . ($censor->get_reclibid() ? "<strong>Reclib ID:</strong> " . $censor->get_reclibid() . "<br />" : "") . "\n\t\t\t</div>\n\t\t</td>\n\t\t<td class=\"artist\">" . $censor->get_artists_str() . "</td>\n\t\t<td class=\"title\">" . $censor->get_title() . "</td>\n\t\t" . (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"" . LINK_ABS . "music/censor/?uncensor=" . $censor->get_id() . "\" class=\"uncensor\" title=\"Uncensor this track\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</td>" : "") . "\n\t</tr>";
}
echo "\n</table>";
echo $pages->return;
} else {
echo "\n<strong>No censored tracks.</strong>";
}
示例11: count
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 »</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>");
}
示例12: implode
$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";
}
示例13: ShowplanItem
case "Advert":
$type = "bullhorn";
break;
case 0:
$type = "music";
break;
}
if ($location->get_config("current_showitems_id")->get_val() == $item->get_id()) {
if ($location->get_config("next_on_showplan")->get_val() == $audio->get_md5()) {
$current = true;
}
}
$return .= "<div class=\"showplan-audio panel " . ($current ? "panel-primary" : "panel-default") . "\" data-item-id=\"" . $item->get_id() . "\">\r\n\t\t\t\t\t<div class=\"panel-heading\" data-toggle=\"collapse\">\r\n\t\t\t\t\t\t<h4 class=\"panel-title\">\r\n\t\t\t\t\t\t\t<div class=\"pull-right\">\r\n\t\t\t\t\t\t\t\t<div class=\"controls\">" . Bootstrap::glyphicon("remove") . "</div>\r\n\t\t\t\t\t\t\t\t<div class=\"duration\">" . Time::format_succinct($audio->get_length()) . "</div></div>\r\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon($type) . ($audio->get_artists() ? $audio->get_artists_str() . " - " : "") . $audio->get_title() . "\r\n\t\t\t\t\t\t</h4>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>";
}
if ($script = $item->get_script()) {
$return .= "<div class=\"showplan-script panel panel-default\" data-item-id=\"" . $item->get_id() . "\">\r\n\t\t\t\t\t<div class=\"panel-heading\" data-toggle=\"collapse\" href=\"#item-" . $item->get_id() . "-toggle\">\r\n\t\t\t\t\t\t<h4 class=\"panel-title\">\r\n\t\t\t\t\t\t\t<div class=\"pull-right\">\r\n\t\t\t\t\t\t\t\t<div class=\"controls\">" . Bootstrap::glyphicon("remove") . "</div>\r\n\t\t\t\t\t\t\t\t<div class=\"duration\">" . ($script->get_length() > 0 ? Time::format_succinct($script->get_length()) : "") . "</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t" . Bootstrap::glyphicon("file") . $script->get_name() . "\r\n\t\t\t\t\t\t</h4>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id=\"item-" . $item->get_id() . "-toggle\" class=\"panel-collapse collapse\">\r\n\t\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t\t" . $script->get_contents() . "\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>";
}
}
$return .= "</div>";
echo $return;
break;
case "showplan-append":
$showplan = Showplans::get_by_id($location->get_config("default_showplan")->get_val());
$item = new ShowplanItem();
$audio = Audio::get_by_id($_REQUEST["id"]);
if (!$audio) {
exit(json_encode(array("response" => "invalid")));
}
$item->set_title($audio->get_title());
$item->set_audio($audio);
$item->set_position($showplan->get_end_position());
示例14: array
$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>");
}
示例15: player
public function player($vocal_markers = true)
{
Output::add_script(LINK_ABS . "js/wavesurfer.min.js");
Output::add_script(LINK_ABS . "js/wavesurfer.timeline.js");
Output::add_script(LINK_ABS . "js/wavesurfer_init.js");
if ($vocal_markers) {
Output::add_script(LINK_ABS . "js/wavesurfer.regions.js");
}
$html = "\n\t\t<script> \$(function () { wv_create('" . $this->id . "'); wavesurfer[" . $this->id . "].load('" . LINK_ABS . "audio/preview/" . $this->id . ".mp3') }); </script>\n\t\t<div class=\"row audio-player\" id=\"" . $this->id . "\" " . ($vocal_markers ? "data-vocal-start=\"" . $this->get_vocal_start() . "\" data-vocal-end=\"" . $this->get_vocal_end() . "\"" : "") . ">\n\t\t\t<div class=\"col-xs-12\">\n\t\t\t\t<div class=\"well well-sm\">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<button class=\"btn btn-primary playpause\" id=\"playpause\" disabled>\n\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("play") . "\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<h6><small><span class=\"elapsed\">00:00</span> / <span class=\"duration\">00:00</span></small></h6>\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<div class=\"col-xs-6\">\n\t\t\t\t\t\t\t\t\t<button class=\"btn btn-sm btn-info zoom\">\n\t\t\t\t\t\t\t\t\t\t" . Bootstrap::glyphicon("search") . "\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div id=\"waveform" . $this->get_id() . "\">\n\t\t\t\t\t\t\t\t<div id=\"progress-div\" class=\"progress progress-striped\">\n\t\t\t\t\t\t\t\t\t<div class=\"progress-bar\">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>";
return $html;
}