From 2d68d5274c8d04296ea35a1d470a52dcc2cb502c Mon Sep 17 00:00:00 2001 From: totoro Date: Sun, 21 Sep 2025 09:36:20 +0900 Subject: [PATCH] [+] add l3 files with helper to construct dropdown for available languages and chapters present in collection --- web/l3/l3.anubis | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+), 0 deletions(-) create mode 100644 web/l3/l3.anubis diff --git a/web/l3/l3.anubis b/web/l3/l3.anubis new file mode 100644 index 0000000..5b26a2d --- /dev/null +++ b/web/l3/l3.anubis @@ -0,0 +1,54 @@ +/* + * Created by PyramIDE. + * User: フランスのトトロ aka (David RENÉ) + * Date: 16/06/2025 + * Time: 18:18 + * © David RENÉ + */ + +read xlib/web/making_a_web_site.anubis + +transmit locale/L3.anubis +transmit locale/L3LanguageInfo.anubis + +define List(HTML_Off_Form) + construct_language_option_list + ( + List(HTML_Off_Form) so_far, + List(L3LanguageInfo) lang_list + ) = + if lang_list is + { + [] then so_far, + [h . t] then + if h is lang_info(code_list, english_name, self_name, _, _, _, _) then + with code_lang = get_first_code(code_list), + construct_language_option_list( [option(value(code_lang), text(code_lang +" | " + english_name + " | " + self_name)) . so_far], t) + }. + +public define List(HTML_Off_Form) + l3_get_language_option_list = + construct_language_option_list([], standard_languages) + . + +public define List(HTML_Off_Form) + _l3_get_all_chapters_options_list + ( + List(HTML_Off_Form) so_far, + List(String) chapters_list + )= + if chapters_list is + { + [] then so_far, + [h . t] then + _l3_get_all_chapters_options_list( [option(value(h), text(h)) . so_far], t) + } +. + +public define List(HTML_Off_Form) + l3_get_all_chapters_options_list + ( + String collection_name + )= + _l3_get_all_chapters_options_list([], l3_get_all_chapters(collection_name)) +. -- libgit2 0.21.4