123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?php
- //////////////////////////////////////////////////////////////////////////
- //
- // WikiHiero - A PHP convert from text using "Manual for the encoding of
- // hieroglyphic texts for computer input" syntax to HTML entities (table and
- // images).
- //
- // Copyright (C) 2004 Guillaume Blanchard (Aoineko)
- //
- // This program is free software; you can redistribute it and/or
- // modify it under the terms of the GNU General Public License
- // as published by the Free Software Foundation; either version 2
- // of the License, or any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program; if not, write to the Free Software
- // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- //
- //////////////////////////////////////////////////////////////////////////
- require "wh_language.php";
- require "wikihiero.php";
- #
- # Initialization
- #
- # Fixme ! webRequest :)
- if(array_key_exists("table", $_GET)) {
- $table = $_GET["table"];
- } else {
- $table = "All";
- }
- if(array_key_exists("lang", $_GET)) {
- $lang = $_GET["lang"];
- } else {
- $lang = "fr";
- }
- function WH_Text( $index ) {
- global $wh_language;
- global $lang;
- if(isset($wh_language[$index])) {
- if(isset($wh_language[$index][$lang])) {
- return $wh_language[$index][$lang];
- } else {
- return $wh_language[$index]["en"];
- }
- }
- return '';
- }
- ?>
- <html lang=<?php echo htmlspecialchars($lang); ?>>
- <head>
- <title><?php echo htmlspecialchars($table)." - ".WH_Text($table); ?> - WikiHiero</title>
- <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
- <link rel="shortcut icon" href="/favicon.ico">
- </head>
- <body bgcolor="#DDDDDD">
- <?php
- echo "<b>" . htmlspecialchars( $table ) . "</b> - ".WH_Text($table)."<br /><br />";
- if($dh = opendir(WH_IMG_DIR)) {
- while(($file = readdir($dh)) !== false) {
- if($table == "All")
- {
- $code = WH_GetCode($file);
- if(in_array($code, $wh_phonemes))
- echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" " .
- "title=\"" . htmlspecialchars( $code ) . " [".
- htmlspecialchars( array_search($code, $wh_phonemes) ) . "]\">\n";
- else
- echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" title=\"" .
- htmlspecialchars( $code ) . "\">\n";
- }
- else if($table == "Phoneme")
- {
- $code = WH_GetCode($file);
- if(in_array($code, $wh_phonemes))
- echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" " .
- "title=\"" . htmlspecialchars( $code ) . " [".
- htmlspecialchars( array_search($code, $wh_phonemes) )."]\">\n";
- }
- else if($table == "Aa")
- {
- $code = WH_GetCode($file);
- if((substr($code, 0, 2) == $table) && ctype_digit($code[2]))
- {
- if(in_array($code, $wh_phonemes))
- echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file) . "\" title=\"" .
- htmlspecialchars( $code ) . " [".
- htmlspecialchars( array_search($code, $wh_phonemes) )."]\">\n";
- else
- echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" title=\"" .
- htmlspecialchars( $code ) . "\">\n";
- }
- }
- else
- {
- $code = WH_GetCode($file);
- if(($code[0] == $table) && ctype_digit($code[1]))
- {
- if(in_array($code, $wh_phonemes))
- echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" title=\"" .
- htmlspecialchars( $code ) . "[".
- htmlspecialchars( array_search($code, $wh_phonemes) )."]\">\n";
- else
- echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ). "\" title=\"" .
- htmlspecialchars( $code ) . "\">\n";
- }
- }
- }
- closedir($dh);
- }
- ?>
- </body>
- </html>
|