git.schokokeks.org
Repositories
Help
Report an Issue
fs-draft.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
459c086
Branches
Tags
master
midgard
vorlage
fs-draft.git
source
content
personal_pronouns.html.php
repaired tables in content
Christian Fraß
commited
459c086
at 2016-08-08 21:50:25
personal_pronouns.html.php
Blame
History
Raw
<?php global $configuration; include_once("source/logic/server/data.php"); include_once("source/logic/server/sql.php"); include_once("source/logic/server/table.php"); /* function convert_persona($persona) {return [0 => "impersonal", 1 => "1st person", 2 => "2nd person", 3 => "3rd person"][$persona];} function convert_numerus($numerus) {return [0 => null, 1 => "singular", 2 => "plural"][$numerus];} function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "feminine", 3 => "neuter"][$genus];} */ ?> <section class="subsection" id="personal_pronouns"> <header>Personal Pronouns</header> <?php $data_common = read_json("source/data/common.json"); $data_pronouns = read_json("source/data/personal_pronouns.json"); $data = $data_pronouns["words"]; { { $data = sql_cross($data, $data_common["counts"]); $data = sql_select($data, function ($row) {return ($row["count_id"] == $row["id"]);}); $data = sql_delete($data, ["count_id", "id"]); $data = sql_rename($data, "name", "count_name"); } { $data = sql_cross($data, $data_common["persons"]); $data = sql_select($data, function ($row) {return ($row["person_id"] == $row["id"]);}); $data = sql_delete($data, ["person_id", "id"]); $data = sql_rename($data, "name", "person_name"); } { $data = sql_cross($data, $data_common["genders"]); $data = sql_select($data, function ($row) {return ($row["gender_id"] == $row["id"]);}); $data = sql_delete($data, ["gender_id", "id"]); $data = sql_rename($data, "name", "gender_name"); } { $data = sql_cross($data, $data_pronouns["types"]); /* $data = sql_select($data, function ($row) {return ($row["type_id"] == $row["id"]);}); $data = sql_delete($data, ["type_id", "id"]); $data = sql_rename($data, "name", "type_name"); */ $data = sql_rename($data, "type_id", "type_name"); } { $data = sql_cross($data, $data_common["cases"]); /* $data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);}); $data = sql_delete($data, ["case_id", "id"]); $data = sql_rename($data, "name", "case_name"); */ $data = sql_rename($data, "case_id", "case_name"); } } $table = new class_table ( [ new class_column("Language", "language_id"), new class_column("Count", "count_name"), new class_column("Person", "person_name"), new class_column("Gender", "gender_name"), new class_column("Type", "type_name"), new class_column("Case", "case_name"), new class_column("Words", "words", function ($x) {return json_encode($x);}), ], $data ); $table = $table->snap ( [ "label_vertical" => function ($column) {return "";}, "columns_vertical" => [ $table->columns_get()[1], $table->columns_get()[2], $table->columns_get()[3], ], "label_horizontal" => function ($column, $value) {return $value;}, "columns_horizontal" => [ $table->columns_get()[4], $table->columns_get()[5], ], "columns_data" => [ $table->columns_get()[0], $table->columns_get()[6], ], "data_aggregator" => function ($values) { return $values; }, "data_formatter" => function ($value) { switch (-1) { case 0: { return _baz($value[0]["words"], "word", "fs"); // break; } case 1: { return ( _bar("word") ( [ "original" => $value[0]["words"], "translated" => $value[1]["words"], ] ) ); // break; } default: { return json_encode($value); // break; } } }, ] ); $table->generate(); ?> <p>For the flected and otherwise related forms of the personal pronouns see the section <a href="#declension">Declension</a>.</p> </section>