1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

say hello to role descriptions, role ordering and tooltips on role selects

git-svn-id: file:///svn/phpbb/trunk@5791 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-04-17 22:36:43 +00:00
parent a0f8e1323a
commit 8d456a0fd7
20 changed files with 369 additions and 33 deletions

View File

@@ -66,6 +66,10 @@
<dt><label for="role_name">{L_ROLE_NAME}:</label></dt>
<dd><input name="role_name" type="text" id="role_name" value="{ROLE_NAME}" /></dd>
</dl>
<dl>
<dt><label for="role_description">{L_ROLE_DESCRIPTION}:</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt>
<dd><textarea id="role_description" name="role_description" rows="3" cols="45">{ROLE_DESCRIPTION}</textarea></dd>
</dl>
<dl>
<dt><label for="pre_select">{L_DISPLAY_FOR_GROUP}:</label><br /><span>{L_DISPLAY_FOR_GROUP_EXPLAIN}</span></dt>
<dd><select name="pre_select" id="pre_select" onchange="if(this.value=='custom'){dE('custom_group',1);}else{dE('custom_group',-1);}">{S_PRESELECT_OPTIONS}</select></dd>
@@ -177,13 +181,15 @@
<tr>
<th style="width: 50%">{L_ROLE_NAME}</th>
<th>{L_DISPLAY_FOR_GROUP}</th>
<th colspan="3">{L_OPTIONS}</th>
<th colspan="2">{L_OPTIONS}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN roles -->
<tr>
<td style="vertical-align: top;"><b>{roles.NAME}</b></td>
<td style="vertical-align: top;"><b>{roles.ROLE_NAME}</b>
<!-- IF roles.ROLE_DESCRIPTION --><br /><span>{roles.ROLE_DESCRIPTION}</span><!-- ENDIF -->
</td>
<td style="vertical-align: top;">
<!-- IF roles.S_GROUP -->
<!-- a href="{roles.groups.U_GROUP}">{roles.groups.GROUP_NAME}</a><br / -->
@@ -196,9 +202,13 @@
{L_EVERY_USER_GROUP}
<!-- ENDIF -->
</td>
<td style="vertical-align: top; white-space: nowrap;"><a href="{roles.U_EDIT}">{L_EDIT_ROLE}</a></td>
<td style="vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td>
<td style="vertical-align: top; white-space: nowrap;"><a href="{roles.U_REMOVE}">{L_REMOVE_ROLE}</a></td>
<td style="vertical-align: top; white-space: nowrap;">
<!-- IF not roles.S_FIRST_ROW --><a href="{roles.U_MOVE_UP}"><img src="images/icon_up.gif" alt="{L_MOVE_UP}" title="{L_MOVE_UP}" width="16" height="16" /></a> <!-- ENDIF -->
<!-- IF not roles.S_LAST_ROW --><a href="{roles.U_MOVE_DOWN}"><img src="images/icon_down.gif" alt="{L_MOVE_DOWN}" title="{L_MOVE_DOWN}" width="16" height="16" /></a> <!-- ENDIF -->
<a href="{roles.U_EDIT}"><img src="images/icon_edit.gif" alt="{L_EDIT_ROLE}" title="{L_EDIT_ROLE}" width="16" height="16" /></a>
<a href="{roles.U_REMOVE}"><img src="images/icon_delete.gif" alt="{L_REMOVE_ROLE}" title="{L_REMOVE_ROLE}" width="16" height="16" /></a>
</td>
</tr>
<!-- END roles -->
</tbody>

View File

@@ -343,6 +343,14 @@
<br /><br />
<!-- include tooltip file -->
<script type="text/javascript" src="style/tooltip.js"></script>
<script type="text/javascript">
<!--
window.onload = function(){enable_tooltips_select('set_permissions', 'Role Description', 'role')};
//-->
</script>
<form id="set_permissions" method="post" action="{U_ACTION}">
{S_HIDDEN_FIELDS}

View File

@@ -871,6 +871,22 @@ table.pmask td.name {
color: #333333;
}
.tooltip {
width: 200px;
color: #000;
text-align: center;
}
.tooltip span.top {
background: #EFEFEF;
font-weight: bold;
}
.tooltip span.bottom {
padding: 5px;
color: #000;
background: #fff;
}
/*
Format Buttons for signature editor

View File

@@ -156,7 +156,7 @@
&nbsp;
<!-- ELSE -->
<!-- IF p_mask.f_mask.S_ROLE_OPTIONS -->
<b>{L_ROLE}:</b>&nbsp; &nbsp;<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, 'a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')">{p_mask.f_mask.S_ROLE_OPTIONS}</select>
<b>{L_ROLE}:</b>&nbsp; &nbsp;<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, 'a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')"><option value="-2" title="testing">testing</option>{p_mask.f_mask.S_ROLE_OPTIONS}</select>
<!-- ELSE -->
<b>{L_ROLE}:</b> {L_NO_ROLE_AVAILABLE}
<!-- ENDIF -->

223
phpBB/adm/style/tooltip.js Normal file
View File

@@ -0,0 +1,223 @@
/*
javascript for Bubble Tooltips by Alessandro Fulciniti
- http://pro.html.it - http://web-graphics.com
obtained from: http://web-graphics.com/mtarchive/001717.php
phpBB Development Team:
- modified to adhere to our coding guidelines
- integration into our design
- added ability to perform tooltips on select elements
- further adjustements
*/
var head_text, tooltip_mode;
/**
* Enable tooltip replacements for links
*/
function enable_tooltips_link(id, headline, sub_id)
{
var links, i, hold;
head_text = headline;
if (!document.getElementById || !document.getElementsByTagName)
{
return;
}
hold = document.createElement('span');
hold.id = '_tooltip_container';
hold.setAttribute('id', '_tooltip_container');
hold.style.position = 'absolute';
document.getElementsByTagName('body')[0].appendChild(hold);
if (id == null)
{
links = document.getElementsByTagName('a');
}
else
{
links = document.getElementById(id).getElementsByTagName('a');
}
for (i = 0; i < links.length; i++)
{
if (sub_id)
{
if (links[i].id.substr(0, sub_id.length) == sub_id)
{
prepare(links[i]);
}
}
else
{
prepare(links[i]);
}
}
tooltip_mode = 'link';
}
function enable_tooltips_select(id, headline, sub_id)
{
var links, i, hold;
head_text = headline;
if (!document.getElementById || !document.getElementsByTagName)
{
return;
}
hold = document.createElement('span');
hold.id = '_tooltip_container';
hold.setAttribute('id', '_tooltip_container');
hold.style.position = 'absolute';
document.getElementsByTagName('body')[0].appendChild(hold);
if (id == null)
{
links = document.getElementsByTagName('option');
}
else
{
links = document.getElementById(id).getElementsByTagName('option');
}
for (i = 0; i < links.length; i++)
{
if (sub_id)
{
if (links[i].parentNode.id.substr(0, sub_id.length) == sub_id)
{
prepare(links[i]);
}
}
else
{
prepare(links[i]);
}
}
tooltip_mode = 'select';
}
function prepare(element)
{
var tooltip, text, desc, title;
text = element.getAttribute('title');
if (text == null || text.length == 0)
{
return;
}
element.removeAttribute('title');
tooltip = create_element('span', 'tooltip');
title = create_element('span', 'top');
title.appendChild(document.createTextNode(head_text));
tooltip.appendChild(title);
desc = create_element('span', 'bottom');
desc.innerHTML = text;
tooltip.appendChild(desc);
set_opacity(tooltip);
element.tooltip = tooltip;
element.onmouseover = show_tooltip;
element.onmouseout = hide_tooltip;
}
function show_tooltip(e)
{
document.getElementById('_tooltip_container').appendChild(this.tooltip);
locate(this);
}
function hide_tooltip(e)
{
var d = document.getElementById('_tooltip_container');
if (d.childNodes.length > 0)
{
d.removeChild(d.firstChild);
}
}
function set_opacity(element)
{
element.style.filter = 'alpha(opacity:95)';
element.style.KHTMLOpacity = '0.95';
element.style.MozOpacity = '0.95';
element.style.opacity = '0.95';
}
function create_element(tag, c)
{
var x = document.createElement(tag);
x.className = c;
x.style.display = 'block';
return x;
}
function locate(e)
{
var posx = 0;
var posy = 0;
if (tooltip_mode == 'link')
{
if (e == null)
{
e = window.event;
}
if (e.pageX || e.pageY)
{
posx = e.pageX;
posy = e.pageY;
}
else if (e.clientX || e.clientY)
{
if (document.documentElement.scrollTop)
{
posx = e.clientX+document.documentElement.scrollLeft;
posy = e.clientY+document.documentElement.scrollTop;
}
else
{
posx = e.clientX+document.body.scrollLeft;
posy = e.clientY+document.body.scrollTop;
}
}
document.getElementById('_tooltip_container').style.top=(posy+10) + 'px';
document.getElementById('_tooltip_container').style.left=(posx-20) + 'px';
}
else
{
e = e.parentNode;
if (e.offsetParent)
{
for (var posx = 0, posy = 0; e.offsetParent; e = e.offsetParent)
{
posx += e.offsetLeft;
posy += e.offsetTop;
}
}
else
{
posx = e.offsetLeft;
posy = e.offsetTop;
}
document.getElementById('_tooltip_container').style.top=(posy+30) + 'px';
document.getElementById('_tooltip_container').style.left=(posx-205) + 'px';
}
}