1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/14315] Add back roles select for disable javascript

The javascript will hide the old select and show the version using
the span and showing the tooltips.

PHPBB3-14315
This commit is contained in:
Marc Alexander
2016-02-16 17:32:33 +01:00
parent 32815faa33
commit 6f41fcb3d6
4 changed files with 30 additions and 1 deletions

View File

@@ -468,12 +468,18 @@ class auth_admin extends \phpbb\auth\auth
$role_options = array();
$s_role_options = '';
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
@reset($roles);
while (list($role_id, $role_row) = each($roles))
{
$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
$title = ($role_description) ? ' title="' . $role_description . '"' : '';
$s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';
$role_options[] = array(
'ID' => $role_id,
'ROLE_NAME' => $role_name,
@@ -482,6 +488,11 @@ class auth_admin extends \phpbb\auth\auth
);
}
if ($s_role_options)
{
$s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN']) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;
}
if (!$current_role_id && $mode != 'view')
{
$s_custom_permissions = false;
@@ -503,6 +514,7 @@ class auth_admin extends \phpbb\auth\auth
$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
'NAME' => $ug_names_ary[$ug_id],
'UG_ID' => $ug_id,
'S_ROLE_OPTIONS' => $s_role_options,
'S_CUSTOM' => $s_custom_permissions,
'FORUM_ID' => $forum_id,
'S_ROLE_ID' => $current_role_id,
@@ -555,12 +567,18 @@ class auth_admin extends \phpbb\auth\auth
$role_options = array();
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
$s_role_options = '';
@reset($roles);
while (list($role_id, $role_row) = each($roles))
{
$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
$title = ($role_description) ? ' title="' . $role_description . '"' : '';
$s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';
$role_options[] = array(
'ID' => $role_id,
'ROLE_NAME' => $role_name,
@@ -569,6 +587,11 @@ class auth_admin extends \phpbb\auth\auth
);
}
if ($s_role_options)
{
$s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN']) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;
}
if (!$current_role_id && $mode != 'view')
{
$s_custom_permissions = false;
@@ -592,6 +615,7 @@ class auth_admin extends \phpbb\auth\auth
'PADDING' => ($forum_id == 0) ? '' : $forum_names_ary[$forum_id]['padding'],
'S_CUSTOM' => $s_custom_permissions,
'UG_ID' => $ug_id,
'S_ROLE_OPTIONS' => $s_role_options,
'FORUM_ID' => $forum_id)
);