Commit c59dc181 by Scott

Use old array syntax

parent 1a6bd589
...@@ -70,12 +70,12 @@ function qa_get_logged_in_user() ...@@ -70,12 +70,12 @@ function qa_get_logged_in_user()
$teamGroup = $jhelper->trigger_team_group_event($user); $teamGroup = $jhelper->trigger_team_group_event($user);
return [ return array(
'userid' => $user->id, 'userid' => $user->id,
'publicusername' => $user->name.($teamGroup ? " ({$teamGroup})" : ''), 'publicusername' => $user->name.($teamGroup ? " ({$teamGroup})" : ''),
'email' => $user->email, 'email' => $user->email,
'level' => $level, 'level' => $level,
]; );
} }
return null; return null;
...@@ -95,7 +95,7 @@ function qa_get_user_email($userid) ...@@ -95,7 +95,7 @@ function qa_get_user_email($userid)
function qa_get_userids_from_public($publicusernames) function qa_get_userids_from_public($publicusernames)
{ {
$output = []; $output = array();
if(count($publicusernames)) { if(count($publicusernames)) {
$jhelper = new qa_joomla_helper(); $jhelper = new qa_joomla_helper();
foreach($publicusernames as $username) { foreach($publicusernames as $username) {
...@@ -107,7 +107,7 @@ function qa_get_userids_from_public($publicusernames) ...@@ -107,7 +107,7 @@ function qa_get_userids_from_public($publicusernames)
function qa_get_public_from_userids($userids) function qa_get_public_from_userids($userids)
{ {
$output = []; $output = array();
if(count($userids)) { if(count($userids)) {
$jhelper = new qa_joomla_helper(); $jhelper = new qa_joomla_helper();
foreach($userids as $userID) { foreach($userids as $userID) {
......
...@@ -33,7 +33,7 @@ class qa_joomla_helper { ...@@ -33,7 +33,7 @@ class qa_joomla_helper {
$this->load_joomla_app(); $this->load_joomla_app();
} }
/* /*
* If your Q2A installation is in a subfolder of your Joomla, then this file should be in joomla-root/qa-root/qa-include/util/ * If your Q2A installation is in a subfolder of your Joomla, then this file should be in joomla-root/qa-root/qa-include/util/
* We can use this info to track back up the tree to find the Joomla root. * We can use this info to track back up the tree to find the Joomla root.
* If your Q2A installation is in a different folder structure, then you should define JOOMLA_PATH_BASE manually in your qa-config file. * If your Q2A installation is in a different folder structure, then you should define JOOMLA_PATH_BASE manually in your qa-config file.
...@@ -74,26 +74,26 @@ class qa_joomla_helper { ...@@ -74,26 +74,26 @@ class qa_joomla_helper {
function trigger_access_event($user) function trigger_access_event($user)
{ {
return $this->trigger_joomla_event('onQnaAccess', [$user]); return $this->trigger_joomla_event('onQnaAccess', array($user));
} }
function trigger_team_group_event($user) function trigger_team_group_event($user)
{ {
return $this->trigger_joomla_event('onTeamGroup', [$user]); return $this->trigger_joomla_event('onTeamGroup', array($user));
} }
function trigger_get_urls_event() function trigger_get_urls_event()
{ {
return $this->trigger_joomla_event('onGetURLs', []); return $this->trigger_joomla_event('onGetURLs', array());
} }
function trigger_get_avatar_event($userid, $size) function trigger_get_avatar_event($userid, $size)
{ {
return $this->trigger_joomla_event('onGetAvatar', [$userid, $size]); return $this->trigger_joomla_event('onGetAvatar', array($userid, $size));
} }
function trigger_log_event($userid, $action) function trigger_log_event($userid, $action)
{ {
return $this->trigger_joomla_event('onWriteLog', [$userid, $action], false); return $this->trigger_joomla_event('onWriteLog', array($userid, $action), false);
} }
private function trigger_joomla_event($event, $args = [], $expectResponse = true) private function trigger_joomla_event($event, $args = array(), $expectResponse = true)
{ {
JPluginHelper::importPlugin('q2a'); JPluginHelper::importPlugin('q2a');
$dispatcher = JEventDispatcher::getInstance(); $dispatcher = JEventDispatcher::getInstance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment