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\Module\Authorization\Access;
24use Ampache\Module\Api\Ajax;
25use Ampache\Module\System\Core;
26use Ampache\Module\Util\AjaxUriRetrieverInterface;
27use Ampache\Module\Util\Ui;
28use Ampache\Module\Util\UiInterface;
29
30$tag_types = array(
31    'artist' => T_('Artist'),
32    'album' => T_('Album'),
33    'song' => T_('Song'),
34    'video' => T_('Video'),
35);
36
37/** @var UiInterface $ui */
38
39global $dic;
40$ui = $dic->get(UiInterface::class);
41
42?>
43<?php $ui->show('show_genre_browse_form.inc.php'); ?>
44<?php Ajax::start_container('tag_filter'); ?>
45<?php foreach ($object_ids as $data) { ?>
46    <div class="tag_container">
47        <div class="tag_button">
48            <span id="click_tag_<?php echo $data['id']; ?>"><?php echo scrub_out($data['name']); ?></span>
49            <?php echo Ajax::observe('click_tag_' . $data['id'], 'click', Ajax::action('?page=tag&action=add_filter&browse_id=' . $browse2->id . '&tag_id=' . $data['id'], '')); ?>
50        </div>
51        <?php if (Access::check('interface', 50)) { ?>
52        <div class="tag_actions">
53            <ul>
54                <li>
55                    <a class="tag_edit" id="<?php echo 'edit_tag_' . $data['id'] ?>" onclick="showEditDialog('tag_row', '<?php echo $data['id'] ?>', '<?php echo 'edit_tag_' . $data['id'] ?>', '<?php echo addslashes(T_('Edit')) ?>', 'click_tag_')">
56                        <?php echo Ui::get_icon('edit', T_('Edit')); ?>
57                    </a>
58                </li>
59                <li>
60                    <a class="tag_delete" href="<?php echo $dic->get(AjaxUriRetrieverInterface::class)->getAjaxUri(); ?>?page=tag&action=delete&tag_id=<?php echo $data['id']; ?>" onclick="return confirm('<?php echo T_('Do you really want to delete this Tag?'); ?>');"><?php echo Ui::get_icon('delete', T_('Delete')); ?></a>
61                </li>
62            </ul>
63        </div>
64    <?php
65            } ?>
66    </div>
67<?php
68        } ?>
69
70<br /><br /><br />
71<?php
72if (filter_has_var(INPUT_GET, 'show_tag')) {
73            $show_tag = (int) (Core::get_get('show_tag')); ?>
74<script>
75$(document).ready(function () {
76    <?php echo Ajax::action('?page=tag&action=add_filter&browse_id=' . $browse2->id . '&tag_id=' . $show_tag, ''); ?>
77});
78</script>
79<?php
80        } ?>
81<?php if (!count($object_ids)) { ?>
82<span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span>
83<?php
84        } ?>
85<?php Ajax::end_container(); ?>
86