Hello to all, can you please help me .How can i turn this code , to make an ajax request? Thanks
if (check_entity_relationship($user->getGUID(), "friendrequest", $entity->getGUID())) {
// pending request
$returnvalue[] = ElggMenuItem::factory(array(
"name" => "friend_request",
"text" => elgg_echo("friend_request:friend:add:pending"),
"href" => "friend_request/" . $user->username . "#friend_request_sent_listing",
"priority" => 500
));info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Cim@manacim

Cim - 0 likes
- Register action (or ajax view if there's no sensitive data required)
- Custom PHP file with necessary Elgg functions and output link/button
- jQuery click() listener function for custom button
- Inside the jQuery click function should use elgg.action() function for the ajax request
You must log in to post replies.There's quite a few steps in order to "ajaxify" things:
That's pretty much it I think. See the message board core plugin for an example.