MishkaCmsCoreWeb.AdminLanguageController (Mishka CMS Core v0.0.1)

Copy Markdown View Source

Keeps the language an admin reads the dashboard in, chosen in the topbar's user menu.

PUT /admin/language with language and return_to. The language is kept in the session under MishkaCmsCore.Runtime.Languages.admin_session/0 when it is one of MishkaCmsCore.Runtime.Languages.admin_choices/1 for the request's site; any other is ignored. The browser is then sent back to return_to when it is an admin page, else to the dashboard.

A plugin on web:request:admin_language_chosen is handed the conn with the chosen language in meta, and may change the conn or halt it.

The language is the dashboard's alone: the site's visitors, and the admin reading the site, keep the one MishkaCmsCore.Runtime.Plugs.LanguagePlug remembers.

Summary

Functions

update(conn, params)