fix for bug: #7742

was caused by csp policy when using templates.
(thats what my console reports me)
I removed the javascript and replaced it with php.

Works on chromium, firefox and konqueror.

Contribution is MIT licensed.
Please review, @butonic @PVince81