Allow apostrophes in page control menus attribs

Translations may contain apostrophes, but this would break the resulting
JavaScript.
Let's encode those strings with json_encode...
Merge pull request #1689 from mlocati/fix-page-controls-apostrophes

Allow apostrophes in page control menus attribs