The main problem was to have the "compose-cc" area be visible when there is something in it. I solved this using a global variable (in $GLOBALS), but there might be a better solution
Mhm. Shouldn't this be handled on the client side inside the JavaScript that hides the CC area?
Is it better like this? I add rcmail.gui_object for the cc area and rcmail.set_env for the display style (table-row or none) with $OUTPUT->add_scipt. In app.js, in init, I set the display style of the cc area