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
adpositions.html.php
repaired tables in content
Christian Fraß
commited
459c086
at 2016-08-08 21:50:25
adpositions.html.php
Blame
History
Raw
<?php include_once("source/logic/server/data.php"); include_once("source/logic/server/table.php"); include_once("source/logic/server/misc.php"); ?> <section class="section" id="adpositions"> <header>Adpositions</header> <?php proposal(); ?> <!-- <p>The following list gives an overview over prepositions:</p> --> <?php $data_adpositions = read_json("source/data/adpositions.json"); $data = $data_adpositions["words"]; { { $data = sql_cross($data, $data_adpositions["situations"]); $data = sql_select($data, function ($row) {return ($row["situation_id"] == $row["id"]);}); $data = sql_delete($data, ["situation_id", "id"]); $data = sql_rename($data, "name", "situation_name"); } { $data = sql_cross($data, $data_adpositions["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_cross($data, $data_adpositions["kinds"]); $data = sql_select($data, function ($row) {return ($row["kind_id"] == $row["id"]);}); $data = sql_delete($data, ["kind_id", "id"]); $data = sql_rename($data, "name", "kind_name"); } } $table = new class_table ( [ new class_column("Language", "language_id"), new class_column("Situation", "situation_name"), new class_column("Type", "type_name"), new class_column("Kind", "kind_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], ], "label_horizontal" => function ($column, $value) {return $value;}, "columns_horizontal" => [ $table->columns_get()[2], $table->columns_get()[3], ], "columns_data" => [ $table->columns_get()[0], $table->columns_get()[4], ], "data_aggregator" => function ($values) { return $values; }, "data_formatter" => function ($value) { return ( _bar("word") ( [ "original" => $value[0]["words"], "translated" => $value[1]["words"], ] ) ); return json_encode($value); }, ] ); $table->generate(); ?> </section>