get_source_params($source_id);
if ($params["PARAMETERS"]) {
//Affichage du formulaire avec $params["PARAMETERS"]
$vars=unserialize($params["PARAMETERS"]);
foreach ($vars as $key=>$val) {
global ${$key};
${$key}=$val;
}
}
if (!isset($es_selected)) $es_selected = array();
if (!isset($use_in_a2z)) $use_in_a2z = 0;
if (!isset($libelle)) $libelle = "External";
if (!isset($infobulle)) $infobulle = "";
if (!isset($source_as_origine)) $source_as_origine="";
$form ="
".$this->msg["es_list_list"]."
";
// on regarde les connecteurs existants !
$query = "select source_id, name from connectors_sources where id_connector != 'es_list' order by name";
$result = pmb_mysql_query($query);
if(pmb_mysql_num_rows($result)){
while($row = pmb_mysql_fetch_object($result)){
$form.="
source_id,$es_selected) ? " selected='selected'" : "").">".htmlentities($row->name,ENT_QUOTES,$charset)." ";
}
}
$form.="
";
return $form;
}
public function make_serialized_source_properties($source_id) {
global $es_selected;
global $use_in_a2z;
global $libelle;
global $infobulle;
global $source_as_origine;
$t['es_selected'] = $es_selected;
$t['use_in_a2z'] = $use_in_a2z;
$t['libelle'] = $libelle;
$t['infobulle'] = $infobulle;
$t['source_as_origine'] = $source_as_origine;
$this->sources[$source_id]["PARAMETERS"]=serialize($t);
}
public function enrichment_is_allow(){
return true;
}
public function getEnrichmentHeader(){
$header= array();
return $header;
}
public function getTypeOfEnrichment($source_id){
global $libelle, $infobulle;
$params=$this->get_source_params($source_id);
if ($params["PARAMETERS"]) {
//Affichage du formulaire avec $params["PARAMETERS"]
$vars=unserialize($params["PARAMETERS"]);
foreach ($vars as $key=>$val) {
global ${$key};
${$key}=$val;
}
}
$type['type'] = array(
array(
'code' => str_replace(array(" ","%","-","?","!",";",",",":"),"",strip_empty_chars(strtolower($libelle))),
'label' => $libelle,
'infobulle' => $infobulle
)
);
$type['source_id'] = $source_id;
return $type;
}
public function getEnrichment($notice_id,$source_id,$type="",$enrich_params=array(),$page=1){
$params=$this->get_source_params($source_id);
if ($params["PARAMETERS"]) {
//Affichage du formulaire avec $params["PARAMETERS"]
$vars=unserialize($params["PARAMETERS"]);
foreach ($vars as $key=>$val) {
global ${$key};
${$key}=$val;
}
}
$enrichment= array();
//on renvoi ce qui est demandé... si on demande rien, on renvoi tout..
switch ($type){
case "external" :
default :
$rqt="select code from notices where notice_id = '$notice_id'";
$res=pmb_mysql_query($rqt);
if(pmb_mysql_num_rows($res)){
$code = pmb_mysql_result($res,0,0);
$queries = array();
for($i=0 ; $irecid);
}
}else{
$enrichment['external']['content'] = $query."".$this->msg["es_list_no_preview"]." ";
}
}
break;
}
$enrichment['source_label']=$this->msg['es_list_enrichment_source'];
return $enrichment;
}
}
?>