Disable text editor app in public mode when logged in

This fixes #5059 by disabling the text editor app from the JS code,
because it's currently not possible to detect public mode from app.php

Backport of 2b3447af7bd9524c9564e929457638711d712e60