Commit 2ea3340a authored by Mathieu Loiseau's avatar Mathieu Loiseau
Browse files

oops lang_iso → Lex:M

parent 63e3e7bb
<?php
class LexInnovaLink{
require_once('./sys/load_iso.php');
class LexM_link{
private $user ;
private $lang_iso;
private $lexiconUrl = "http://totoro.imag.fr/lexinnova/api/Lexinnova@user@/@lang@/cdm-headword/*/cdm-headword/?strategy=NOT_EQUAL" ;
private $content ;
private $lang_codes = array("es"=>"esp",
"fr"=>"fre",
"en"=>"eng");
public function __construct($user){
$this->user = $user ;
$this->lang_iso = new IsoLang();
$this->lexiconUrl = str_replace(array("@user@", "@lang@"),
array($this->user->username,
$this->lang_codes[$this->user->langGame]),
$this->lang_iso->any_to_iso($this->user->langGame)),
$this->lexiconUrl);
$headers = get_headers($this->lexiconUrl, 1);
if($headers[0] == 'HTTP/1.1 200 OK'){
$this->content = simplexml_load_file($this->lexiconUrl);
$this->content = simplexml_load_file($this->lexiconUrl);
}
else{
$this->content = false ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment