diff --git a/src/mibew/libs/operator.php b/src/mibew/libs/operator.php index a7bebbbd..827122c6 100644 --- a/src/mibew/libs/operator.php +++ b/src/mibew/libs/operator.php @@ -583,9 +583,8 @@ function logout_operator() { $dispatcher->triggerEvent('operatorLogout'); } -function setup_redirect_links($threadid, $operator, $token) -{ - global $page; +function setup_redirect_links($threadid, $operator, $token) { + $result = array(); $operator_in_isolation = in_isolation($operator); @@ -607,7 +606,7 @@ function setup_redirect_links($threadid, $operator, $token) } $p = pagination_info(max($operatorscount, $groupscount), 8); - $page['pagination'] = $p; + $result['pagination'] = $p; $operators = array_slice($operators, $p['start'], $p['end'] - $p['start']); $groups = array_slice($groups, $p['start'], $p['end'] - $p['start']); @@ -627,7 +626,7 @@ function setup_redirect_links($threadid, $operator, $token) topage(get_operator_name($agent)) . " $status"; } - $page['redirectToAgent'] = $agent_list; + $result['redirectToAgent'] = $agent_list; $group_list = ""; if (Settings::get('enablegroups') == "1") { @@ -645,7 +644,9 @@ function setup_redirect_links($threadid, $operator, $token) " $status"; } } - $page['redirectToGroup'] = $group_list; + $result['redirectToGroup'] = $group_list; + + return $result; } function get_permission_list() diff --git a/src/mibew/operator/agent.php b/src/mibew/operator/agent.php index aa595b03..a83d860b 100644 --- a/src/mibew/operator/agent.php +++ b/src/mibew/operator/agent.php @@ -135,7 +135,10 @@ start_html_output(); $pparam = verifyparam("act", "/^(redirect)$/", "default"); if ($pparam == "redirect") { - setup_redirect_links($threadid, $operator, $token); + $page = array_merge_recursive( + $page, + setup_redirect_links($threadid, $operator, $token) + ); $chat_style->render('redirect', $page); } else { // Build js application options