Minor - format code.
Adding flash messages see BT#9016

Just add messages using for example:
Display::addFlash(Display::return_message(get_lang('Save'), 'warning'));

Chamilo will show the message and delete it from the session.
So the message will not be shown twice.