Discussed already.
Imagick plugin will make you happy also.
1. You can set your options on the plugin's settings page and call them in your views:
mod/my_plugin/views/default/plugins/my_plugin/settings.php
$entity = elgg_extract('entity', $vars);
echo elgg_view_input('text', [
'name' => 'params[my_option]',
'label' => elgg_echo('my_option:name'),
'value' => $entity->my_option,
]);
some file:
$plugin_option = elgg_get_plugin_setting('my_option', 'my_plugin');
//Use echo if ...
2. Or learn how to register action
I think it's not the location of the action but the name of the action that is important here. You need to register the action in the init function of start.php with the action name "my_plugin/settings/save", e.g.
$base_dir = elgg_get_plugins_path() . 'my_plugin/actions';
elgg_register_action("my_plugin/settings/save", $base_dir . "settings.php", 'admin');
and then you can place the save action file where you want it (i.e. somewhere in the actions folder of your plugin) as long as the second parameter of elgg_register_action() gives the correct path to the action file.
Thanks for your answers. Now it works.
The problem was, that I wrote the wrong paths in my elgg_register_action.
Thanks for helping.
Try this plugin
https://github.com/hypeJunction/hypeAttachments
thanks for your answer. I'm sorry, I'm new on elgg,how can i do this with this plugin?
elgg_load_js() loads the script asynchronously, inline JS is implemented synchronously at runtime before lightbox is loaded.
Try at least wrapping your JS as an init, system event handler, might help but not bullet proof. In 2.3, lightbox is an AMD module which solves that problem.
<script> require(['elgg'], function(elgg) { elgg.register_hook_handler('init', 'system', function() { // put your $.colorbox dependent code here }); }); </script>
This will probably work in most cases, but might still fail on occasion.
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.