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
word_functions.html.php
repaired tables in content
Christian Fraß
commited
459c086
at 2016-08-08 21:50:25
word_functions.html.php
Blame
History
Raw
<?php global $configuration; include_once("source/logic/server/misc.php"); include_once("source/logic/server/data.php"); include_once("source/logic/server/table.php"); ?> <section class="section" id="word_functions"> <header>Word Functions</header> <?php proposal(); ?> <?php $table = new class_table ( [ new class_column ( "Affix", "affix", function ($value) { return mark($value, ["word", "lang_fs"]); } ), new class_column ( "Type", "type_", function ($value) { return ( implode ( " → ", array_map ( function ($group) { return ("{" . implode(",", $group) . "}"); }, $value ) ) ); } ), new class_column ( "Description", "description_", function ($value) { $output = ""; if ($value["name"] != null) $output .= (mark($value["name"], ["grammarterm"]) . ": "); if ($value["description"] != null) $output .= ($value["description"]); return $output; } ), /* new class_column ( "Cognates", "cognates", function ($value) { return implode(", ", array_map(function ($entry) {return ($entry["language"] . ": " . mark($entry["affix"], ["word", "lang_" . $entry["language"]]));}, $value)); } ), */ new class_column ( "Example", "example_", _bar("word") ), ], sql_condense ( read_json("source/data/word_functions.json"), ["type_from","type_to","name","description","example"], ["type_","description_","example_"], [ "type_" => function ($values) {return [$values["type_from"], $values["type_to"]];}, "description_" => function ($values) {return ["name" => $values["name"], "description" => $values["description"]];}, "example_" => function ($values) {global $configuration; return ["original" => [$values["example"]["word"]], "translated" => $values["example"]["translations"][$configuration["target"]]];}, ] ) ); $table->generate(); ?> <p> Some complex examples: <ul> <?php $fun = _bar("word"); ?> <li><?php echo($fun(["original" => ["unmanlikhed"], "translated" => ["inhumanity"]])); ?></li> <li><?php echo($fun(["original" => ["seberenung"], "translated" => ["visualization"]])); ?></li> <li><?php echo($fun(["original" => ["kraftigenar"], "translated" => ["fortifier"]])); ?></li> </ul> </p> </section>