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\Art;
25use Ampache\Repository\Model\Catalog;
26use Ampache\Repository\Model\Rating;
27use Ampache\Repository\Model\TvShow;
28use Ampache\Repository\Model\Userflag;
29use Ampache\Module\Authorization\Access;
30use Ampache\Module\Api\Ajax;
31use Ampache\Module\Playback\Stream_Playlist;
32use Ampache\Module\Util\Ui;
33
34/** @var TvShow $libitem */
35/** @var bool $hide_genres */
36/** @var bool $show_ratings */
37/** @var string $cel_cover */
38/** @var string $cel_tags */
39
40?>
41<td class="cel_play">
42    <span class="cel_play_content">&nbsp;</span>
43    <div class="cel_play_hover">
44    <?php
45        if (AmpConfig::get('directplay')) {
46            echo Ajax::button('?page=stream&action=directplay&object_type=tvshow&object_id=' . $libitem->id, 'play', T_('Play'), 'play_tvshow_' . $libitem->id);
47            if (Stream_Playlist::check_autoplay_next()) {
48                echo Ajax::button('?page=stream&action=directplay&object_type=tvshow&object_id=' . $libitem->id . '&playnext=true', 'play_next', T_('Play next'), 'nextplay_tvshow_' . $libitem->id);
49            }
50            if (Stream_Playlist::check_autoplay_append()) {
51                echo Ajax::button('?page=stream&action=directplay&object_type=tvshow&object_id=' . $libitem->id . '&append=true', 'play_add', T_('Play last'), 'addplay_tvshow_' . $libitem->id);
52            }
53        } ?>
54    </div>
55</td>
56<td class="<?php echo $cel_cover; ?>">
57    <?php Art::display('tvshow', $libitem->id, $libitem->f_name, 6, $libitem->link); ?>
58</td>
59<td class="cel_tvshow"><?php echo $libitem->f_link; ?></td>
60<td class="cel_episodes"><?php echo $libitem->episodes; ?></td>
61<td class="cel_seasons"><?php echo $libitem->seasons; ?></td>
62<?php if (!$hide_genres) { ?>
63<td class="<?php echo $cel_tags; ?>"><?php echo $libitem->f_tags; ?></td>
64<?php } ?>
65<?php if ($show_ratings) { ?>
66        <td class="cel_ratings">
67            <?php if (AmpConfig::get('ratings')) { ?>
68                <span class="cel_rating" id="rating_<?php echo $libitem->id; ?>_tvshow"><?php echo Rating::show($libitem->id, 'tvshow'); ?></span>
69            <?php
70            } ?>
71
72            <?php if (AmpConfig::get('userflags')) { ?>
73                <span class="cel_userflag" id="userflag_<?php echo $libitem->id; ?>_tvshow"><?php echo Userflag::show($libitem->id, 'tvshow'); ?></span>
74            <?php } ?>
75        </td>
76    <?php } ?>
77<td class="cel_action">
78<?php if (Access::check('interface', 50)) { ?>
79    <a id="<?php echo 'edit_tvshow_' . $libitem->id ?>" onclick="showEditDialog('tvshow_row', '<?php echo $libitem->id ?>', '<?php echo 'edit_tvshow_' . $libitem->id ?>', '<?php echo addslashes(T_('TV Show Edit')) ?>', 'tvshow_')">
80        <?php echo Ui::get_icon('edit', T_('Edit')); ?>
81    </a>
82<?php } ?>
83<?php if (Catalog::can_remove($libitem)) { ?>
84    <a id="<?php echo 'delete_tvshow_' . $libitem->id ?>" href="<?php echo AmpConfig::get('web_path'); ?>/tvshows.php?action=delete&tvshow_id=<?php echo $libitem->id; ?>">
85        <?php echo Ui::get_icon('delete', T_('Delete')); ?>
86    </a>
87<?php } ?>
88</td>
89