132,7 → 132,8 |
$url_max = $illustration['about']; |
|
$value=array($url_miniature,$url_max); |
// Priorite aux images en png |
|
// Priorite aux images en png |
if (strstr($fichier, '.png')) { |
break; |
} |
140,8 → 141,7 |
|
} |
|
$json = new Services_JSON(); |
$output = $json->encode($value); |
$output = json_encode($value); |
print($output); |
} |
|
154,47 → 154,41 |
|
function analyserFichierRdf($chemin) |
{ |
$aso_info = array(); |
$dom = new DOMDocument(); |
$dom->validateOnParse = true; |
if (preg_match('/^http:\/\//', $chemin)) { |
@$dom->loadXML(file_get_contents($chemin)); |
} else { |
@$dom->load($chemin); |
} |
|
//print $chemin; |
|
$aso_info = array(); |
$dom = new DOMDocument(); |
$dom->validateOnParse = true; |
if (preg_match('/^http:\/\//', $chemin)) { |
@$dom->loadXML(file_get_contents($chemin)); |
$tab_infos = array(); |
foreach ($dom->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'Description') as $rdf_description) { |
$aso_info['about'] = $rdf_description->getAttribute('about'); |
$aso_info['dc:identifier'] = $rdf_description->getAttribute('identifier'); |
$aso_info['dc:title'] = utf8_decode($rdf_description->getAttribute('title')); |
$aso_info['dc:creator'] = utf8_decode($rdf_description->getAttribute('creator')); |
$aso_info['dc:contributor'] = utf8_decode($rdf_description->getAttribute('contributor')); |
$aso_info['dc:publisher'] = utf8_decode($rdf_description->getAttribute('publisher')); |
$aso_info['dc:type'] = utf8_decode($rdf_description->getAttribute('type')); |
$aso_info['dc:format'] = utf8_decode($rdf_description->getAttribute('format')); |
if (function_exists('date_default_timezone_set')) { |
date_default_timezone_set('Europe/Paris'); |
} |
if (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/', $rdf_description->getAttribute('created'))) { |
$aso_info['dcterms:created'] = date('j-m-Y � H:i:s', strtotime($rdf_description->getAttribute('created'))); |
} else { |
@$dom->load($chemin); |
$aso_info['dcterms:created'] = $rdf_description->getAttribute('created'); |
} |
$aso_info['dcterms:dateSubmitted'] = utf8_decode($rdf_description->getAttribute('dateSubmitted')); |
$aso_info['dcterms:spatial'] = utf8_decode($rdf_description->getAttribute('spatial')); |
$aso_info['dcterms:licence'] = utf8_decode($rdf_description->getAttribute('licence')); |
$tab_infos[$rdf_description->getAttribute('identifier')] = $aso_info; |
} |
|
|
$tab_infos = array(); |
foreach ($dom->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'Description') as $rdf_description) { |
$aso_info['about'] = $rdf_description->getAttribute('about'); |
$aso_info['dc:identifier'] = $rdf_description->getAttribute('identifier'); |
$aso_info['dc:title'] = utf8_decode($rdf_description->getAttribute('title')); |
$aso_info['dc:creator'] = utf8_decode($rdf_description->getAttribute('creator')); |
$aso_info['dc:contributor'] = utf8_decode($rdf_description->getAttribute('contributor')); |
$aso_info['dc:publisher'] = utf8_decode($rdf_description->getAttribute('publisher')); |
$aso_info['dc:type'] = utf8_decode($rdf_description->getAttribute('type')); |
$aso_info['dc:format'] = utf8_decode($rdf_description->getAttribute('format')); |
if (function_exists('date_default_timezone_set')) { |
date_default_timezone_set('Europe/Paris'); |
} |
if (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/', $rdf_description->getAttribute('created'))) { |
$aso_info['dcterms:created'] = date('j-m-Y � H:i:s', strtotime($rdf_description->getAttribute('created'))); |
} else { |
$aso_info['dcterms:created'] = $rdf_description->getAttribute('created'); |
} |
$aso_info['dcterms:dateSubmitted'] = utf8_decode($rdf_description->getAttribute('dateSubmitted')); |
$aso_info['dcterms:spatial'] = utf8_decode($rdf_description->getAttribute('spatial')); |
$aso_info['dcterms:licence'] = utf8_decode($rdf_description->getAttribute('licence')); |
$tab_infos[$rdf_description->getAttribute('identifier')] = $aso_info; |
} |
//echo '<pre>'.$chemin.print_r($tab_infos, true).'</pre>'; |
|
|
//print_r($tab_infos); |
return $tab_infos; |
return $tab_infos; |
} |
|
|