- template#set "canonical_hostname" canonical_hostname;
- template#conditional "has_global_css" has_global_css;
- template#conditional "edit_anon" edit_anon;
- template#conditional "create_account_anon" create_account_anon;
- template#conditional "has_theme_css" has_theme_css;
- template#set "theme_name" theme_name;
- template#set "theme_description" theme_description;
- template#conditional "has_feedback_email" has_feedback_email;
- template#set "feedback_email" feedback_email;
- template#conditional "mailing_list" mailing_list;
- template#conditional "search_box" search_box;
- template#conditional "navigation" navigation;
- template#conditional "view_anon" view_anon;
+ let canonical_hostname, has_global_css, edit_anon, create_account_anon,
+ has_theme_css, theme_name, theme_description, has_feedback_email,
+ feedback_email, mailing_list, search_box, navigation, view_anon =
+ match sth#fetch1 () with
+ [ `String canonical_hostname; `Bool has_global_css;
+ `Bool edit_anon; `Bool create_account_anon; `Bool has_theme_css;
+ (`String _ | `Null) as theme_name;
+ (`String _ | `Null) as theme_description;
+ (`String _ | `Null) as feedback_email;
+ `Bool mailing_list; `Bool search_box; `Bool navigation;
+ `Bool view_anon ] ->
+ let theme_name =
+ match theme_name with `String s -> s | `Null -> "" in
+ let theme_description =
+ match theme_description with `String s -> s | `Null -> "" in
+ let feedback_email, has_feedback_email =
+ match feedback_email with
+ `String s -> s, true
+ | `Null -> "", false in
+ canonical_hostname, has_global_css, edit_anon, create_account_anon,
+ has_theme_css, theme_name, theme_description, has_feedback_email,
+ feedback_email, mailing_list, search_box, navigation, view_anon
+ | _ -> assert false in
+
+ template#set "canonical_hostname" canonical_hostname;
+ template#conditional "has_global_css" has_global_css;
+ template#conditional "edit_anon" edit_anon;
+ template#conditional "create_account_anon" create_account_anon;
+ template#conditional "has_theme_css" has_theme_css;
+ template#set "theme_name" theme_name;
+ template#set "theme_description" theme_description;
+ template#conditional "has_feedback_email" has_feedback_email;
+ template#set "feedback_email" feedback_email;
+ template#conditional "mailing_list" mailing_list;
+ template#conditional "search_box" search_box;
+ template#conditional "navigation" navigation;
+ template#conditional "view_anon" view_anon
+ );