function ajaxsocialize() { $social_network = JRequest::getVar('social_network'); $social_networks = array('facebook', 'twitter', 'google_plus'); if (!in_array($social_network, $social_networks)) { return; } $ret = modgsocialHelper::gsocial($social_network); $ret['message_type'] = isset($ret['message_type']) ? $ret['message_type'] : 'message'; $json['message'] = $message; $json['message_type'] = $ret['message_type']; $json = modgsocialHelper::json_encode($json); jexit(); }