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


PHP Output::add_stylesheet方法代码示例

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


在下文中一共展示了Output::add_stylesheet方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: function

<?php

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

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

示例4: function

<?php

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

开发者ID:radiowarwick,项目名称:digiplay,代码行数:10,代码来源:index.php

示例5: 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

示例6: exit

<?php

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

示例7:

<?php

require_once 'pre.php';
Output::set_title("Audiowall:");
MainTemplate::set_sidebar(NULL);
Output::add_script("../js/jquery-ui-1.10.3.custom.min.js");
Output::add_script("aw.js");
Output::add_less_stylesheet("aw.less");
Output::add_stylesheet("aw.css");
$aw_set = AudiowallSets::get((int) $_REQUEST['id']);
if ($aw_set == null) {
    exit;
}
//var_dump($aw_set);
$aw_walls = $aw_set->get_walls();
//var_dump($aw_walls);
$styles = AudiowallStyles::get_all();
Output::set_title("Audiowall:<br /><span id=\"wall-name\" data-dps-set-id=\"" . $aw_set->get_id() . "\">" . $aw_set->get_name() . "</span>");
MainTemplate::set_subtitle("<span id=\"wall-description\">" . $aw_set->get_description() . "</span><span id=\"aw_edit_buttons\"><p class=\"text-success\">Changes saved!</p><a href=\"#\" class=\"btn btn-primary\">Edit</a><a href=\"#\" class=\"btn btn-success\">Save</a></span>");
?>
<div class="row">
  <div class="col-md-12">
  </div>
  <div class="col-md-5">
    <div class="list-group" id="walls-tabs">
       <?php 
$w = 0;
foreach ($aw_walls as $wall) {
    echo "<a id=\"walls-tab\" href=\"#page" . $wall->get_page() . "\" data-toggle=\"tab\" data-dps-wall-page=\"" . $wall->get_page() . "\" data-dps-wall-id=\"" . $wall->get_id() . "\" class=\"list-group-item";
    if ($w == 0) {
        echo " list-group-item-info";
开发者ID:radiowarwick,项目名称:digiplay,代码行数:31,代码来源:edit.php

示例8: exit

<?php

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


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