Skip to content

Commit

Permalink
change role selector position
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathologic authored Feb 7, 2024
1 parent a96c3af commit 592125a
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions manager/actions/mutate_web_user.dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,39 @@ function evoRenderTvImageCheck (a) {
</tr>
<?php
} ?>
<tr>
<td><?= ManagerTheme::getLexicon('user_role'); ?>:
</td>
<td>
<?php
$roles = UserRole::query()->select('name', 'id');
if (!evo()->hasPermission('save_role')) {
$roles = $roles->where('id', '!=', 1);
}
?>
<select name="role" id="role" class="inputBox" onChange="roleWarning();"
style="width:300px">
<option value="0"<?= $userdata['role'] == 0 ? ' selected'
: '' ?>><?= ManagerTheme::getLexicon(
'no_user_role'
); ?></option>
<?php
foreach ($roles->get()->toArray() as $row) {
if (evo()->getManagerApi()->action == '11') {
$selectedtext = $row['id'] == '1' ? ' selected' : '';
} else {
$selectedtext = $row['id'] == $userdata['role'] ? ' selected' : '';
}
?>
<option value="<?= $row['id']; ?>"<?= $selectedtext; ?>><?= e(
$row['name']
); ?></option>
<?php
}
?>
</select>
</td>
</tr>
<?php
if (!empty($userdata['id'])) { ?>
<tr id="showname" style="display: <?= (evo()->getManagerApi()->action == '88' &&
Expand Down Expand Up @@ -521,39 +554,6 @@ function evoRenderTvImageCheck (a) {
); ?>"/>
</td>
</tr>
<tr>
<td><?= ManagerTheme::getLexicon('user_role'); ?>:
</td>
<td>
<?php
$roles = UserRole::query()->select('name', 'id');
if (!evo()->hasPermission('save_role')) {
$roles = $roles->where('id', '!=', 1);
}
?>
<select name="role" id="role" class="inputBox" onChange="roleWarning();"
style="width:300px">
<option value="0"<?= $userdata['role'] == 0 ? ' selected'
: '' ?>><?= ManagerTheme::getLexicon(
'no_user_role'
); ?></option>
<?php
foreach ($roles->get()->toArray() as $row) {
if (evo()->getManagerApi()->action == '11') {
$selectedtext = $row['id'] == '1' ? ' selected' : '';
} else {
$selectedtext = $row['id'] == $userdata['role'] ? ' selected' : '';
}
?>
<option value="<?= $row['id']; ?>"<?= $selectedtext; ?>><?= e(
$row['name']
); ?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td><?= ManagerTheme::getLexicon('user_phone'); ?>:
</td>
Expand Down

0 comments on commit 592125a

Please sign in to comment.