Array
* (
* [0] => 200$a
* [1] => 7XX
* )
* Donc dc.title correspond aux champs 'titre' et 'auteur'.
* */
public function get_automap_config($filename) {
$result = array("cql_____" => array("XXX"));
$file = file_get_contents($filename);
$dom = new xml_dom_sru($file);
$node = $dom->get_nodes('auto_map_indexes/map');
foreach ($node as $map) {
$map_elements = explode("\n", $dom->get_datas($map));
$mmap = array();
foreach($map_elements as $map_element) {
$trimmed = trim($map_element);
if ($trimmed){
$mmap[] = $trimmed;
}
}
$attribs = $dom->get_attributes($map);
$result[$attribs["set"]."____".$attribs["name"]] = $mmap;
}
$long_formats = explode("\n", $dom->get_datas($schema));
foreach ($long_formats as $long_format) {
$trimmed = trim($long_format);
if ($trimmed)
$result[$id]['long_formats'][] = $trimmed;
}
return $result;
}
/*G�n�re un multi select avec la liste des champs PMB dedans.
* Pour le mapping des champs serveur / PMB
*/
public function make_field_combo_box($fiels, $field_name, $selected=array()) {
global $msg, $charset;
$r="";
return $r;
}
/*Renvoi le formulaire de propri�t� de la source
*/
public function source_get_property_form($source_id) {
global $charset, $base_path;
//
//R�cup�ration des param�tres de la source
//
$params=$this->get_source_params($source_id);
if ($params["PARAMETERS"]) {
$vars=unserialize($params["PARAMETERS"]);
foreach ($vars as $key=>$val) {
global ${$key};
${$key}=$val;
}
}
if (!isset($allowed_indexes))
$allowed_indexes = array();
if (!isset($max_record_per_search))
$max_record_per_search = 100;
if (!isset($style_sheets))
$style_sheets = array();
// highlight_string(print_r($style_sheets, true));
//
//URL de la source
//
$form="
";
if (!$url)
$form.="
".$this->msg["rec_addr"]."
";
else {
//
//Demande au serveur des propri�t�s de la source
//
$parameters = array('version' => '1.1');
$this->get_schemas_config();
$request = new sru_request($url, "explain", $parameters, $this->schema_config);
if (!$request->error) {
$source_properties = $request->analyse_response('ISO-8859-1');
}
else {
print $request->error_message;
}
if ($source_properties) {
//
//Titre du serveur
//
if ($source_properties["databaseinfo"]["title"]["value"])
$form.="