Advanced module - how to add custom 'Data has been saved' notification?
Hey there!
I'm wondering if it'd be possible to send a conditional notification on an advanced module model after an entry has been saved. What I'm trying to do is doing some checks inside the on_after_save hook and if the criteria was matched send a different notification message to the user.
So instead of the green "Data has been saved" i'd love to have something like 'Please don't forget to ...'
Even better, I'd love to be able to "append" so to say an html block in the edit form body once the saving has been done. Just a simple link to another backend section basically.
Any idea on how to achieve this?
I presume i might set some session variable and hack some lines in the module.php controller to take care of them, but I'm hoping there's a cleaner way...
thanks!
Comments
if (!$this->session->flashdata('success')) { $this->session->set_flashdata('success', lang('data_saved')); }
Doc is here - http://docs.getfuelcms.com/libraries/fuel_admin#func_set_notification
And message should look like - $this->fuel->admin->set_notification('Custom message ...', 'success');