1<?php
2/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
3/**
4 *
5 * LICENSE: GNU Affero General Public License, version 3 (AGPL-3.0-or-later)
6 * Copyright 2001 - 2020 Ampache.org
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20 *
21 */
22
23use Ampache\Config\AmpConfig;
24use Ampache\Repository\Model\Live_Stream;
25use Ampache\Module\Authorization\Access;
26use Ampache\Module\Api\Ajax;
27use Ampache\Module\Util\Ui;
28
29/** @var Ampache\Repository\Model\Browse $browse */
30/** @var array $object_ids */
31
32$is_table = $browse->is_grid_view();
33//mashup and grid view need different css
34$cel_cover = ($is_table) ? "cel_cover" : 'grid_cover'; ?>
35<?php if (Access::check('interface', 50)) { ?>
36<?php UI::show_box_top(T_('Manage'), 'info-box'); ?>
37<div id="information_actions">
38<ul>
39<li>
40    <a href="<?php echo AmpConfig::get('web_path'); ?>/radio.php?action=show_create">
41        <?php echo Ui::get_icon('add', T_('Add')); ?>
42        <?php echo T_('Add Radio Station'); ?>
43    </a>
44</li>
45</ul>
46</div>
47<?php UI::show_box_bottom(); ?>
48<?php
49} ?>
50<?php if ($browse->is_show_header()) {
51    require Ui::find_template('list_header.inc.php');
52} ?>
53<table class="tabledata striped-rows <?php echo $browse->get_css_class() ?>" data-objecttype="live_stream">
54    <thead>
55        <tr class="th-top">
56            <th class="cel_play essential"></th>
57            <th class="<?php echo $cel_cover; ?> optional"><?php echo T_('Art') ?></th>
58            <th class="cel_streamname essential persist"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=name', T_('Name'), 'live_stream_sort_name'); ?></th>
59            <th class="cel_siteurl optional"><?php echo T_('Website'); ?></th>
60            <th class="cel_codec optional"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=codec', T_('Codec'), 'live_stream_codec');  ?></th>
61            <th class="cel_action essential"><?php echo T_('Action'); ?></th>
62        </tr>
63    </thead>
64    <tbody>
65        <?php
66        foreach ($object_ids as $radio_id) {
67            $libitem = new Live_Stream($radio_id);
68            $libitem->format(); ?>
69        <tr id="live_stream_<?php echo $libitem->id; ?>">
70            <?php require Ui::find_template('show_live_stream_row.inc.php'); ?>
71        </tr>
72        <?php
73        } // end foreach ($artists as $artist)?>
74        <?php if (!count($object_ids)) { ?>
75        <tr>
76            <td colspan="6"><span class="nodata"><?php echo T_('No live stream found'); ?></span></td>
77        </tr>
78        <?php
79        } ?>
80    </tbody>
81    <tfoot>
82        <tr class="th-bottom">
83            <th class="cel_play"></th>
84            <th class="<?php echo $cel_cover; ?>"><?php echo T_('Art') ?></th>
85            <th class="cel_streamname"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=name', T_('Name'), 'live_stream_sort_name'); ?></th>
86            <th class="cel_siteurl"><?php echo T_('Website'); ?></th>
87            <th class="cel_codec"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=codec', T_('Codec'), 'live_stream_codec_bottom');  ?></th>
88            <th class="cel_action"><?php echo T_('Action'); ?> </th>
89        </tr>
90    </tfoot>
91</table>
92<?php if ($browse->is_show_header()) {
93            require Ui::find_template('list_header.inc.php');
94        } ?>
95