Skip to content

Commit fd044a1

Browse files
authored
Merge pull request #6953 from danieltj27/ticket/17640
[ticket/17640] Add events to acp_groups allowing custom quick actions
2 parents 43608c5 + e7ff06e commit fd044a1

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

phpBB/includes/acp/acp_groups.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,20 @@ function main($id, $mode)
881881
$s_action_options = '';
882882
$options = array('default' => 'DEFAULT', 'approve' => 'APPROVE', 'demote' => 'DEMOTE', 'promote' => 'PROMOTE', 'deleteusers' => 'DELETE');
883883

884+
/**
885+
* Modify the list of available quick actions for a group.
886+
*
887+
* @event core.acp_manage_group_action_options_before
888+
* @var int group_id The current group ID.
889+
* @var array options An array of HTML for the action select element.
890+
* @since 3.3.18-RC1
891+
*/
892+
$vars = array(
893+
'group_id',
894+
'options',
895+
);
896+
extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_action_options_before', compact($vars)));
897+
884898
foreach ($options as $option => $lang)
885899
{
886900
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
@@ -939,6 +953,22 @@ function main($id, $mode)
939953

940954
return;
941955
break;
956+
957+
default:
958+
/**
959+
* Handle any unspecified action for groups.
960+
*
961+
* @event core.acp_manage_group_default_action
962+
* @var string action The current action.
963+
* @var int group_id The current group ID.
964+
* @since 3.3.18-RC1
965+
*/
966+
$vars = array(
967+
'action',
968+
'group_id',
969+
);
970+
extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_default_action', compact($vars)));
971+
break;
942972
}
943973

944974
$template->assign_vars(array(

0 commit comments

Comments
 (0)