mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-16 13:52:03 +02:00
[ticket/14283] Add a Manage Group link on a group page
PHPBB3-14283
This commit is contained in:
parent
8bb4af6271
commit
03662d5a89
@ -101,6 +101,7 @@ $lang = array_merge($lang, array(
|
||||
'LOGIN_EXPLAIN_SEARCHUSER' => 'The board requires you to be registered and logged in to search users.',
|
||||
'LOGIN_EXPLAIN_VIEWPROFILE' => 'The board requires you to be registered and logged in to view profiles.',
|
||||
|
||||
'MANAGE_GROUP' => 'Manage Group',
|
||||
'MORE_THAN' => 'More than',
|
||||
|
||||
'NO_CONTACT_FORM' => 'The board administrator contact form has been disabled.',
|
||||
|
@ -1088,7 +1088,7 @@ switch ($mode)
|
||||
if ($mode == 'group')
|
||||
{
|
||||
// We JOIN here to save a query for determining membership for hidden groups. ;)
|
||||
$sql = 'SELECT g.*, ug.user_id
|
||||
$sql = 'SELECT g.*, ug.user_id, ug.group_leader
|
||||
FROM ' . GROUPS_TABLE . ' g
|
||||
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id'] . " AND ug.group_id = $group_id)
|
||||
WHERE g.group_id = $group_id";
|
||||
@ -1147,6 +1147,20 @@ switch ($mode)
|
||||
$user_rank_data['img'] .= '<br />';
|
||||
}
|
||||
}
|
||||
// include modules for manage groups link display or not
|
||||
// need to ensure the modulr is active
|
||||
if (!class_exists('p_master'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
|
||||
}
|
||||
$module = new p_master;
|
||||
$module->list_modules('ucp');
|
||||
|
||||
$can_manage_group = false;
|
||||
if ($module->is_active('ucp_groups', 'manage') && ($group_row['group_leader'] || ($group_row['group_founder_manage'] && $user->data['user_type'] == USER_FOUNDER)))
|
||||
{
|
||||
$can_manage_group = true;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
|
||||
@ -1159,7 +1173,8 @@ switch ($mode)
|
||||
'RANK_IMG' => $user_rank_data['img'],
|
||||
'RANK_IMG_SRC' => $user_rank_data['img_src'],
|
||||
|
||||
'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&g=' . $group_id) : '',)
|
||||
'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&g=' . $group_id) : '',
|
||||
'U_MANAGE' => ($can_manage_group) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_groups&mode=manage') : false,)
|
||||
);
|
||||
|
||||
$sql_select = ', ug.group_leader';
|
||||
|
@ -14,7 +14,11 @@
|
||||
|
||||
<!-- IF S_SHOW_GROUP -->
|
||||
<h2 class="group-title"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{GROUP_NAME}</h2>
|
||||
<!-- IF U_MANAGE -->
|
||||
<p class="right responsive-center manage rightside"><a href="{U_MANAGE}">{L_MANAGE_GROUP}</a></p>
|
||||
<!-- ENDIF -->
|
||||
<p>{GROUP_DESC} {GROUP_TYPE}</p>
|
||||
|
||||
<p>
|
||||
<!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ENDIF -->
|
||||
<!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF -->
|
||||
|
@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="20%"><b class="genmed">{L_GROUP_NAME}{L_COLON}</b></td>
|
||||
<td class="row2"><b class="gen"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR}"<!-- ENDIF -->>{GROUP_NAME}</b></td>
|
||||
<td class="row2"><b class="gen"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR}"<!-- ENDIF -->>{GROUP_NAME}</b> <!-- IF U_MANAGE --><a href="{U_MANAGE}">{L_MANAGE_GROUP}</a><!-- ENDIF --></td>
|
||||
<!-- IF AVATAR_IMG or RANK_IMG or GROUP_RANK or U_PM -->
|
||||
<td class="row1" width="33%" rowspan="2" align="center"><!-- IF AVATAR_IMG -->{AVATAR_IMG}<br /><!-- ENDIF --><!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF --><!-- IF GROUP_RANK --><span class="gensmall">{GROUP_RANK}</span><br /><br /><!-- ENDIF --><!-- IF U_PM --><a href="{U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF --></td>
|
||||
<!-- ENDIF -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user