mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Merge pull request #4030 from RMcGirr83/ticket_14283
[ticket/14283] Add a Manage Group link on a group page
This commit is contained in:
commit
8899829752
4 changed files with 27 additions and 3 deletions
|
@ -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_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.',
|
'LOGIN_EXPLAIN_VIEWPROFILE' => 'The board requires you to be registered and logged in to view profiles.',
|
||||||
|
|
||||||
|
'MANAGE_GROUP' => 'Manage Group',
|
||||||
'MORE_THAN' => 'More than',
|
'MORE_THAN' => 'More than',
|
||||||
|
|
||||||
'NO_CONTACT_FORM' => 'The board administrator contact form has been disabled.',
|
'NO_CONTACT_FORM' => 'The board administrator contact form has been disabled.',
|
||||||
|
|
|
@ -1088,7 +1088,7 @@ switch ($mode)
|
||||||
if ($mode == 'group')
|
if ($mode == 'group')
|
||||||
{
|
{
|
||||||
// We JOIN here to save a query for determining membership for hidden groups. ;)
|
// 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
|
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)
|
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";
|
WHERE g.group_id = $group_id";
|
||||||
|
@ -1147,6 +1147,24 @@ switch ($mode)
|
||||||
$user_rank_data['img'] .= '<br />';
|
$user_rank_data['img'] .= '<br />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// include modules for manage groups link display or not
|
||||||
|
// need to ensure the module is active
|
||||||
|
$can_manage_group = false;
|
||||||
|
if ($user->data['is_registered'] && $group_row['group_leader'])
|
||||||
|
{
|
||||||
|
if (!class_exists('p_master'))
|
||||||
|
{
|
||||||
|
include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
|
||||||
|
}
|
||||||
|
$module = new p_master;
|
||||||
|
$module->list_modules('ucp');
|
||||||
|
|
||||||
|
if ($module->is_active('ucp_groups', 'manage'))
|
||||||
|
{
|
||||||
|
$can_manage_group = true;
|
||||||
|
}
|
||||||
|
unset($module);
|
||||||
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$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']),
|
'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 +1177,8 @@ switch ($mode)
|
||||||
'RANK_IMG' => $user_rank_data['img'],
|
'RANK_IMG' => $user_rank_data['img'],
|
||||||
'RANK_IMG_SRC' => $user_rank_data['img_src'],
|
'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';
|
$sql_select = ', ug.group_leader';
|
||||||
|
|
|
@ -14,7 +14,11 @@
|
||||||
|
|
||||||
<!-- IF S_SHOW_GROUP -->
|
<!-- IF S_SHOW_GROUP -->
|
||||||
<h2 class="group-title"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{GROUP_NAME}</h2>
|
<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>{GROUP_DESC} {GROUP_TYPE}</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ENDIF -->
|
<!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ENDIF -->
|
||||||
<!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF -->
|
<!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF -->
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" width="20%"><b class="genmed">{L_GROUP_NAME}{L_COLON}</b></td>
|
<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 -->
|
<!-- 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>
|
<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 -->
|
<!-- ENDIF -->
|
||||||
|
|
Loading…
Add table
Reference in a new issue