Bibelversionen verfügbar, nach Sprache | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||
Englisch |
| ||||||||||||||
Italienisch |
| ||||||||||||||
Latein |
| ||||||||||||||
Spanisch |
|
For developers:
The information in the above table is obtained dynamically, using cURL in PHP against the BibleGet metadata endpoint.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | <?php //TODO: cache the results in a transient so we don't make a call to the endpoint every time the page is loaded $bibleversions_by_lang = []; $ch = curl_init(); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, true); curl_setopt( $ch , CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); $result = curl_exec( $ch ); curl_close ( $ch ); $bibleversions = json_decode( $result ); foreach ( $bibleversions ->validversions_fullname as $key => $value ){ $version_info = explode ( "|" , $value ); //fullname | year | language $copyrighted_version = false; if (in_array( $key , $bibleversions ->copyrightversions)){ $copyrighted_version = true; } $version = new stdClass(); $version ->abbrev = $key ; $version ->fullname = $version_info [0]; $version ->year = $version_info [1]; $version ->language = Locale::getDisplayLanguage( $version_info [2], $locale ); $version ->iscopyrighted = $copyrighted_version ; array_push ( $bibleversions_by_lang , $version ); } usort( $bibleversions_by_lang , fn( $a , $b ) => strcmp ( $a ->language, $b ->language)); $version_languages = []; foreach ( $bibleversions_by_lang as $bibleversion ){ array_push ( $version_languages , $bibleversion ->language); } $version_languages = array_unique ( $version_languages ); ?> <table id= "BibleVersionsTable" style= "font-size:.8em;" > <thead> <tr><th colspan= "2" style= "text-align:center;font-size:1.5em;padding:12px;" ><?php pll_e( "Bible versions available, by language" ); ?></th></tr> <tr> <th></th> <th> <table class = "BibleVersionTable" > <colgroup> <col span= "1" style= "width: 10%" > <col span= "1" style= "width: 27%" > <col span= "1" style= "width: 8%" > <col span= "1" style= "width: 8%" > <col span= "1" style= "width: 27%" > <col span= "1" style= "width: 10%" > <col span= "1" style= "width: 10%" > </colgroup> <thead> <tr> <th class = "rotate" ><div><span><?php pll_e( "Abbreviation" ); ?></span></div></th> <th class = "rotate" ><div><span><?php pll_e( "Full Name" ); ?></span></div></th> <th class = "rotate" ><div><span><?php pll_e( "Year" ); ?></span></div></th> <th class = "rotate" ><div><span><?php pll_e( "Copyright" ); ?></span></div></th> <th class = "rotate" ><div><span><?php pll_e( "Copyright holder" ); ?></span></div></th> <th class = "rotate" ><div><span><?php pll_e( "Canon" ); ?></span></div></th> <th class = "rotate" ><div><span>Imprimatur</span></div></th> </tr> </thead> </table> </th> </tr> </thead> <tbody> <?php foreach ( $version_languages as $language ){ echo "<tr><td>$language</td>" ; echo "<td><table class=\"BibleVersionTable\">" ; echo "<colgroup>" ; echo "<col span=\"1\" style=\"width: 12%;\">" ; echo "<col span=\"1\" style=\"width: 27%;\">" ; echo "<col span=\"1\" style=\"width: 8%;\">" ; echo "<col span=\"1\" style=\"width: 5%;\">" ; echo "<col span=\"1\" style=\"width: 27%;\">" ; echo "<col span=\"1\" style=\"width: 16%;\">" ; echo "<col span=\"1\" style=\"width: 5%;\">" ; echo "</colgroup>" ; echo "<tbody>" ; foreach ( $bibleversions_by_lang as $bibleversion ){ if ( $bibleversion ->language === $language ){ echo "<tr>" ; echo "<td><a href=\"$bibleversion->abbrev/\">$bibleversion->abbrev</a></td>" ; echo "<td>$bibleversion->fullname</td>" ; echo "<td>$bibleversion->year</td>" ; echo "<td>" . ( $bibleversion ->iscopyrighted? "©" : "" ). "</td>" ; echo "<td>" . $bibleversion ->copyright_holder . "</td>" ; echo "<td>" . $bibleversion ->canon . "</td>" ; echo "<td>" . $bibleversion ->imprimatur . "</td>" ; echo "</tr>" ; } } echo "</tbody></table></td></tr>" ; } ?> </tbody> </table> |