2021-06-09 01:26:10 +03:00
|
|
|
[ExtrasElement::] Extras Element.
|
|
|
|
|
|
|
|
To write the Extras element (Xt) in the index.
|
|
|
|
|
2021-07-25 17:11:01 +03:00
|
|
|
@ This is to sweep up rulebooks and activities not covered by other elements,
|
|
|
|
really, and most of the code here is just to arrange them in some logical order.
|
2021-06-09 01:26:10 +03:00
|
|
|
|
|
|
|
=
|
2021-07-26 15:48:49 +03:00
|
|
|
void ExtrasElement::render(OUTPUT_STREAM, index_session *session) {
|
|
|
|
localisation_dictionary *LD = Indexing::get_localisation(session);
|
|
|
|
inter_tree *I = Indexing::get_tree(session);
|
|
|
|
tree_inventory *inv = Indexing::get_inventory(session);
|
2022-02-03 01:35:38 +02:00
|
|
|
InterNodeList::array_sort(inv->rulebook_nodes, MakeSynopticModuleStage::module_order);
|
|
|
|
InterNodeList::array_sort(inv->activity_nodes, MakeSynopticModuleStage::module_order);
|
2021-06-09 01:26:10 +03:00
|
|
|
|
2021-07-25 00:04:35 +03:00
|
|
|
inter_package *E;
|
|
|
|
LOOP_OVER_INVENTORY_PACKAGES(E, i, inv->module_nodes)
|
2021-06-09 01:26:10 +03:00
|
|
|
if (Metadata::read_optional_numeric(E, I"^category") == 1)
|
|
|
|
@<Index rulebooks occurring in this part of the source text@>;
|
2021-07-25 00:04:35 +03:00
|
|
|
LOOP_OVER_INVENTORY_PACKAGES(E, i, inv->module_nodes)
|
2021-06-09 01:26:10 +03:00
|
|
|
if (Metadata::read_optional_numeric(E, I"^category") == 2)
|
|
|
|
@<Index rulebooks occurring in this part of the source text@>;
|
|
|
|
}
|
|
|
|
|
|
|
|
@<Index rulebooks occurring in this part of the source text@> =
|
|
|
|
int c = 0;
|
2021-07-25 00:04:35 +03:00
|
|
|
inter_package *rb_pack;
|
|
|
|
LOOP_OVER_INVENTORY_PACKAGES(rb_pack, i, inv->rulebook_nodes)
|
2022-01-05 01:10:34 +02:00
|
|
|
if (MakeSynopticModuleStage::module_containing(rb_pack->package_head) == E) {
|
2021-07-25 00:04:35 +03:00
|
|
|
if (Metadata::read_optional_numeric(rb_pack, I"^automatically_generated"))
|
2021-06-09 01:26:10 +03:00
|
|
|
continue;
|
|
|
|
if (c++ == 0) @<Heading for these@>;
|
2021-07-11 00:17:39 +03:00
|
|
|
IndexRules::rulebook_box(OUT, inv,
|
2022-03-01 00:24:58 +02:00
|
|
|
Metadata::optional_textual(rb_pack, I"^printed_name"),
|
2021-07-27 02:42:09 +03:00
|
|
|
NULL, rb_pack, NULL, 1, TRUE, session);
|
2021-06-09 01:26:10 +03:00
|
|
|
}
|
2021-07-25 00:04:35 +03:00
|
|
|
inter_package *av_pack;
|
|
|
|
LOOP_OVER_INVENTORY_PACKAGES(av_pack, i, inv->activity_nodes)
|
2022-01-05 01:10:34 +02:00
|
|
|
if (MakeSynopticModuleStage::module_containing(av_pack->package_head) == E) {
|
2021-06-09 01:26:10 +03:00
|
|
|
if (c++ == 0) @<Heading for these@>;
|
2021-07-27 02:42:09 +03:00
|
|
|
IndexRules::activity_box(OUT, I, av_pack, 1, session);
|
2021-06-09 01:26:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@<Heading for these@> =
|
|
|
|
HTML_OPEN("p");
|
2021-07-25 17:11:01 +03:00
|
|
|
WRITE("<b>");
|
2021-06-09 01:26:10 +03:00
|
|
|
if (Metadata::read_optional_numeric(E, I"^category") == 1) {
|
2021-07-26 02:34:51 +03:00
|
|
|
Localisation::roman(OUT, LD, I"Index.Elements.Xt.FromSourceText");
|
2021-06-09 01:26:10 +03:00
|
|
|
} else {
|
2021-07-26 02:34:51 +03:00
|
|
|
Localisation::roman_t(OUT, LD, I"Index.Elements.Xt.FromExtension",
|
2022-03-01 00:24:58 +02:00
|
|
|
Metadata::optional_textual(E, I"^credit"));
|
2021-06-09 01:26:10 +03:00
|
|
|
}
|
2021-07-25 17:11:01 +03:00
|
|
|
WRITE("</b>");
|
2021-06-09 01:26:10 +03:00
|
|
|
HTML_CLOSE("p");
|