xref: /webtrees/resources/views/admin/users-table-options.phtml (revision 1581e36eec57f11b12a03a1213501f41df10ee12)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\Masquerade;
4use Fisharebest\Webtrees\I18N;
5
6?>
7
8<div class="dropdown">
9    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" id="edit-user-button-<?= $row->user_id ?>" aria-haspopup="true" aria-expanded="false">
10        <?= view('icons/menu') ?>
11    </button>
12    <div class="dropdown-menu" aria-labelledby="edit-user-button-<?= $row->user_id ?>">
13        <div class="dropdown-item">
14            <?= view('icons/edit') ?>
15            <a href="<?= e(route('admin-users-edit', ['user_id' => $row->user_id])) ?>">
16                <?= I18N::translate('Edit') ?>
17            </a>
18        </div>
19
20        <div class="divider"></div>
21
22        <?php if ($row->user_id !== $user->id()) : ?>
23            <div class="dropdown-item">
24                <?= view('icons/user') ?>
25                <a href="#" data-post-url="<?= e(route(Masquerade::class, ['user_id' => $row->user_id])) ?>">
26                    <?= I18N::translate('Masquerade as this user') ?>
27                </a>
28            </div>
29
30            <div class="dropdown-item">
31                <?= view('icons/delete') ?>
32                <a href="#" data-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', e($row->user_name)) ?>" data-post-url="<?= e(route('delete-user', ['user_id' => $row->user_id])) ?>">
33                    <?= I18N::translate('Delete') ?>
34                </a>
35            </div>
36        <?php endif ?>
37    </div>
38</div>
39