I have written my own plugin. Now i want to save some plugin settings. The form with the settings is ready and does work.
But now I want to write my own save action. In the standard save.php of elgg there is this code:
....
// allow a plugin to override the save action for their settings
if (elgg_action_exists("$plugin_id/settings/save")) {
action("$plugin_id/settings/save");
}
....
I created the folder mod/my_plugin/actions/my_Plugin/settings/save.php. I also tried it with a folder .../settings/save/save.php. But nothing does work.
Has anybody an idea, where i have to create the folder and my save.php that it works?
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.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- iionly@iionly
iionly - 0 likes
- Alex@schneal76
Alex - 0 likes
You must log in to post replies.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
some file:
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.
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.