function show_sources(id) { if (document.getElementById(id).style.display=='none') { document.getElementById(id).style.display=''; } else { document.getElementById(id).style.display='none'; } } "; $contrs=new connecteurs(); $parity=1; foreach ($contrs->catalog as $id=>$prop) { if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $comment=$prop["COMMENT"]; $sign=$prop["NAME"]." : ".$comment." - "; if ($prop["STATUS"]!="open") $sign.="(c) "; $sign.="Auteur : ".$prop["AUTHOR"]." - ".$prop["ORG"]." - "; $sign.=formatdate($prop["DATE"]); //Recherche du nombre de sources $n_sources=0; if (is_file($base_path."/admin/connecteurs/in/".$prop["PATH"]."/".$prop["NAME"].".class.php")) { require_once($base_path."/admin/connecteurs/in/".$prop["PATH"]."/".$prop["NAME"].".class.php"); eval("\$conn=new ".$prop["NAME"]."(\"".$base_path."/admin/connecteurs/in/".$prop["PATH"]."\");"); $conn->get_sources(); $n_sources=count($conn->sources); } $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" onmousedown=\"if (event) e=event; else e=window.event; if (e.srcElement) target=e.srcElement; else target=e.target; if ((target.nodeName!='IMG')&&(target.nodeName!='INPUT')) document.location='./admin.php?categ=connecteurs&sub=in&act=modif&id=".$id."';\" "; print "\n"; if ($n_sources) { print ""; } } print "
  Service Sources  
".($n_sources?"":" ")."".htmlentities($comment,ENT_QUOTES,$charset)." ".sprintf($msg["connecteurs_count_sources"],$n_sources)."
"; } switch ($act) { case "modif": $contrs=new connecteurs(); print $contrs->show_connector_form($id); break; case "update": if ($id) { $contrs=new connecteurs(); require_once($base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."/".$contrs->catalog[$id]["NAME"].".class.php"); eval("\$conn=new ".$contrs->catalog[$id]["NAME"]."(\"".$base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."\");"); if ($conn) { $conn->timeout=$timeout; $conn->retry=$retry; $conn->ttl=$ttl; $conn->repository=$repository; $conn->rep_upload=$rep_upload; $conn->upload_doc_num=$upload_doc_num; $conn->save_property_form(); } } show_connectors(); break; case "cancel_sync": $sql = "DELETE FROM source_sync WHERE source_id = $source_id AND cancel > 0"; mysql_query($sql); show_connectors(); break; case "abort_sync": $sql = "DELETE FROM source_sync WHERE source_id = $source_id "; mysql_query($sql); show_connectors(); break; case "add_source": $contrs=new connecteurs(); print $contrs->show_source_form($id,$source_id); break; case "update_source": if ($id) { $contrs=new connecteurs(); require_once($base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."/".$contrs->catalog[$id]["NAME"].".class.php"); eval("\$conn=new ".$contrs->catalog[$id]["NAME"]."(\"".$base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."\");"); if (!$source_id) $source_id=0; if ($conn) { $conn->sources[$source_id]["TIMEOUT"]=$timeout; $conn->sources[$source_id]["RETRY"]=$retry; $conn->sources[$source_id]["TTL"]=$ttl; $conn->sources[$source_id]["REPOSITORY"]=$repository; $conn->sources[$source_id]["NAME"]=stripslashes($name); $conn->sources[$source_id]["COMMENT"]=stripslashes($comment); $conn->sources[$source_id]["OPAC_ALLOWED"]=stripslashes($opac_allowed); $conn->sources[$source_id]["REP_UPLOAD"]=stripslashes($rep_upload); $conn->sources[$source_id]["ENRICHMENT"]=stripslashes($enrichment); $conn->sources[$source_id]["UPLOAD_DOC_NUM"]=stripslashes($upload_doc_num); $conn->sources[$source_id]["OPAC_AFFILIATE_SEARCH"]=stripslashes($opac_affiliate_search); $conn->sources[$source_id]["OPAC_SELECTED"]=stripslashes($opac_selected); $conn->sources[$source_id]["TYPE_ENRICHMENT_ALLOWED"]=$type_enrichment_allowed; //Vérification du nom $requete="select count(*) from connectors_sources where name='".$name."' and source_id!=$source_id and id_connector='".addslashes($contrs->catalog[$id]["NAME"])."'"; $resultat=mysql_query($requete); if (mysql_result($resultat,0,0)==0) { $conn->source_save_property_form($source_id); show_connectors(); } else { error_form_message($msg["connecteurs_name_exists"]); } } } break; case "delete_source": if ($id) { $contrs=new connecteurs(); require_once($base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."/".$contrs->catalog[$id]["NAME"].".class.php"); eval("\$conn=new ".$contrs->catalog[$id]["NAME"]."(\"".$base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."\");"); if (($source_id)&&($conn)) { $conn->del_source($source_id); } show_connectors(); } break; case "sync": if ($id) { $contrs=new connecteurs(); require_once($base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."/".$contrs->catalog[$id]["NAME"].".class.php"); eval("\$conn=new ".$contrs->catalog[$id]["NAME"]."(\"".$base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."\");"); //Si on doit afficher un formulaire de synchronisation $syncr_form = $conn->form_pour_maj_entrepot($source_id); if (!$go && $syncr_form) { print '
'; print $syncr_form; print ""; print '
'; } else { if (($source_id)&&($conn)) { require_once($base_path."/admin/connecteurs/in/sync.inc.php"); } } } else show_connectors(); break; case "sync_custom_page": if ($id) { $contrs=new connecteurs(); require_once($base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."/".$contrs->catalog[$id]["NAME"].".class.php"); eval("\$conn=new ".$contrs->catalog[$id]["NAME"]."(\"".$base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."\");"); print $conn->sync_custom_page($source_id); } break; case "empty": if ($id) { $contrs=new connecteurs(); require_once($base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."/".$contrs->catalog[$id]["NAME"].".class.php"); eval("\$conn=new ".$contrs->catalog[$id]["NAME"]."(\"".$base_path."/admin/connecteurs/in/".$contrs->catalog[$id]["PATH"]."\");"); if (($source_id)&&($conn)) { $conn->del_notices($source_id); } $sql = "UPDATE connectors_sources SET last_sync_date = '0000-00-00 00:00:00' WHERE source_id = $source_id "; mysql_query($sql); } else show_connectors(); default: show_connectors(); break; } ?>