OK, this is not elegant coding...
My client would like to be able to customize the email sent to new users with a nice interface without having to mess with code.
I have already
written such a plugin.
To overwrite the entry from the usernotificationbyemail plugin (aaargh, I know this is ugly), I do this:
$CONFIG->translations[$language][$message_key] = $message_value;
Immediately afterwards, doing an elgg_echo($message_key) shows the correct new value. However, after the value is updated (the action terminated) I do a forward() to the editing form again, where though elgg_echo($message_key) still shows the old value.
Any ideas what happens?
I know I still need to find a clever way to update the language file itself (otherwise changes are lost on reboot), but for the time being this would meet my reqs.
Thanks for any suggestion.
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.
- Cash@costelloc
Cash - 0 likes
- Fabio@fablife
Fabio - 0 likes
You must log in to post replies.forward() sends a 301 redirect to the browser so you are dealing with a fresh start in your php script. You need to store the language string in the database. You can retrieve it in a plugin and set the translation there.
I was assuming something around this...
Thanks for the clear explanation!