Location: PHPKode > projects > Toutateam Groupware > toutateam-v1.56/translations.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans nom</title>
</head>

<body>
<div align="center">
<?php
$myReferenceFile="./lang/fr.inc.php";
$myReferenceTable="langtable";
$$myReferenceTable=array();
include $myReferenceFile;
//$myReferenceFile="./lang/fr.inc.php";
//include $myReferenceFile;

?>
	<textarea name="resultat" cols="100" rows="10">
<?php
$file=$_FILES["file"];
//print_r($_FILES);
if(isset($file))
{
	//echo ($file);
	$myFichier=file($file["tmp_name"]);
	$myTrans=array();
	// |<[^>]+>(.*)</[^>]+>|U
	foreach($myFichier as $texte)
	{
		$texte=str_replace("\\n","",str_replace("\\r","",$texte));
		//echo "Recherche dans : ".($texte)."<br>\n";
		$myTab=array();
		
		$myNbMatch=preg_match_all("|getTranslation\([\"'](.*)[\"']\)|U",stripslashes($texte),$myTab,PREG_PATTERN_ORDER);
		if(count($myNbMatch)>0)
		{
			foreach($myTab[1] as $key => $myCurMatch)
			{
				if(!isset($$myReferenceTable[$myCurMatch])) 
				{
					$myTrans[$myCurMatch]=$myCurMatch;
					//echo $$myReferenceTable[$myCurMatch]."\n";
				}
			}
			//print_r($myTab);
		}
		else
		{
			//echo "Aucune chaine trouvée : ".print_r($myMatch)."<br>\n";
		}
	}
	if(count($myTrans)>0)
	{
		foreach($myTrans as $myCurMatch)
		{
			if(!array_key_exists($myCurMatch,$$myReferenceTable)) echo "\$langtable[\"".$myCurMatch."\"]=\"".$myCurMatch."\";\n";
		}
	}
}

?>
</textarea>
</div>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
	<table width="60%" border="0" align="center">

		<tr>
			<td><div align="right">Fichier</div></td>
			<td><input type="file" name="file" /></td>
		</tr>
		<tr>
			<td width="50%"><div align="right">Ok</div></td>
			<td><input type="submit" name="Submit" value="Envoyer" /></td>
		</tr>
	</table>
</form>
</body>
</html>
Return current item: Toutateam Groupware