Hi Fazli, Thanks for testing the plugin with elgg 4.3. Majority of my plugin is being used on my own website which is still running on elgg 4.1 and that is why I have the plugin supported till 4.1. I have not yet tested the plugin with any recent elgg release. I will be updating all my plugin but I don't think this will be done anytime soon. I am planning to update the plugins but it will be done somewhere around December this year. You will have to wait for few more months for the latest version. Thanks.
New version of plupload have a different license I don't want to switch to. And the documentation doesn't mention any dependencies at all.
By using elgg_define_js in bootstrap init and then require in the AMD module I got it working. But then I have again the problem with the user-specific language not being used (you might remember that problem I also had on Elgg 3 already). I "solved" the language issue by using elgg_register_external_file / elgg_load_external_file back then but I haven't got it working on Elgg 4 in the same way so far (probably a race-condition with loading of dependecies).
The slideshow seems also available at https://github.com/GalleriaJS/galleria. Though if I remember correctly it hasn't worked using it as AMD module out-of-the-box this way and I had rewritten it to work. But I don't see which jquery-ui modules might be required (if any).
You could always include the complete jQuery-UI as a dependency in your plugin and only load the full jQuery-UI on your pages.
Elgg uses https://asset-packagist.org/package/npm-asset/components-jqueryui v1.12.1, so for example you could use https://asset-packagist.org/package/npm-asset/jquery-ui with the same version requirements as Elgg https://github.com/Elgg/Elgg/blob/6c4f01852ee0a8eb5f1caf108fda455726a0d3ce/composer.json#L35
Edit:
The link i provided apparently is also the split jQuery-UI, so you might have to look around
I've got the uploader working now. The jquery-ui modules needed was a bit of trial and error still after I had found a docs fragment listing some requirements. Still, I had to rewrite parts of the Tidypics code to get it working on Elgg 4 because the former approach of loading the libs and translations didn't work anymore at all. Well, finally got this part working.
Now I'm stuck with the JS slideshow seemingly not compatible with jquery3 - took me a whole week to figure this out as the way of requiring the modules had to be rewritten, too. Now I'm not sure how to proceed as it might be that a total rewrite of the slideshow code might be necessary to replace all the methods no longer available - not knowing which due to lack of any error messages... I can just say it's absolutely frustrating right now.
Have you tried
$item = $items->get('activity:owner');
$item->setText('just tesing');
$items->add($item);
return $items;
Is your plugin below the Activity plugin?
Hi there Jerome. I've managed to get it to work by overriding the original menu item and re-registering it all over again. Your solution, however, doesn't do any changes - I'm not sure why. I was hoping it would as my solution doesn't seem like the more clean and consistent way to go about it.
public static function changeActivityIcon(\Elgg\Hook $hook) {
$entity = $hook->getEntityParam();
if (!$entity instanceof \ElggUser) {
return;
}
$return = $hook->getValue();
$return[] = \ElggMenuItem::factory([
'name' => 'activity:owner',
'icon' => 'clock-regular',
'text' => elgg_echo('activity:owner'),
'href' => elgg_generate_url('collection:river:owner', ['username' => $entity->username]),
]);
return $return;
}
Revilo,
I tried (almost) exactly what you did. And it works.
The only change I made was the namespace of the Class that handles the hook. Since you put your class in exactly the same namespace as the Activity plugin it could be that your plugin overrules the class. Therefor the original item isn't registered.
If you place your the class in namespace 'YourName\YourPlugin\Menus' it should work. The class file should then be place inside you plugin in the folder 'classes\YourName\YourPlugin\Menus\OwnerBlock.php'
If you wish to fully take over the upload action, you can re-register the action in your plugin and also have the action file in your plugin.
return [
'plugin' => [
'name' => 'My Plugin',
'activate_on_install' => true,
],
'view_extensions' => [],
'actions' => [
'avatar/upload' => [],
],
];
Then on submit it'll go to your action file
I couldn't be more thankful for your reply Jerome Bakker. That was mighty helpful. I'll be using your suggestion.
I would, however, like to know why the hook wasn't being called, just in case I get to need to use hooks in the future. Hope you can help.
Your hook registration was wrong
I presume you wished to use this hook https://github.com/Elgg/Elgg/blob/94a075687edb5bdf71d7a28c016ca12856e4efa3/engine/classes/Elgg/EntityIconService.php#L214-L222
Which would be 'entity:avatar:prepare', 'user' not 'prepare' 'entity:avatar:prepare'
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.