aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/admin.css2
-rw-r--r--phpBB/adm/style/permission_mask.html1
-rw-r--r--phpBB/adm/style/tooltip.js4
-rw-r--r--phpBB/includes/acp/auth.php24
4 files changed, 30 insertions, 1 deletions
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index e537e970a3..e1668bf70b 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -2489,7 +2489,7 @@ fieldset.permissions .padding {
border-radius: 3px;
padding: 4px;
width: 250px;
- display: block;
+ display: none;
background: url('../images/arrow_down.gif') no-repeat 245px .7em;
}
diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html
index 721fc42473..cddcac170f 100644
--- a/phpBB/adm/style/permission_mask.html
+++ b/phpBB/adm/style/permission_mask.html
@@ -42,6 +42,7 @@
{% if p_mask.f_mask.role_options %}
<dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 20%">
<div class="dropdown-container dropdown-button-control roles-options" data-alt-text="{LA_ROLE_DESCRIPTION}">
+ <select id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" onchange="set_role_settings(this.options[selectedIndex].value, 'advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); init_colours('{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')">{p_mask.f_mask.S_ROLE_OPTIONS}</select>
<span title="Roles" class="button icon-button tools-icon dropdown-trigger dropdown-select">{L_NO_ROLE_ASSIGNED}</span>
<div class="dropdown hidden">
<ul class="dropdown-contents" id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" >
diff --git a/phpBB/adm/style/tooltip.js b/phpBB/adm/style/tooltip.js
index 3abeefbffe..b38418876d 100644
--- a/phpBB/adm/style/tooltip.js
+++ b/phpBB/adm/style/tooltip.js
@@ -142,6 +142,10 @@ phpbb.positionTooltip = function ($element) {
phpbb.prepareRolesDropdown = function () {
var $options = $('.roles-options li');
+ // Display span and hide select
+ $('.roles-options > span').css('display', 'block');
+ $('.roles-options > select').hide();
+
// Prepare highlighting of select options and settings update
$options.each(function () {
var $this = $(this);
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 31471f8611..b36b900396 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -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)
);