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;
}
}
$form ="
";
return $form;
}
public function make_serialized_source_properties($source_id) {
global $libelle,$infobulle,$source_name;
global $cp_field;
global $width,$height;
$t=array();
$t['libelle'] = $libelle;
$t['infobulle'] = $infobulle;
$t['source_name'] = $source_name;
$t['cp_field'] = $cp_field;
$t['width'] = $width;
$t['height'] = $height;
$this->sources[$source_id]["PARAMETERS"]=serialize($t);
}
public function enrichment_is_allow(){
return true;
}
public function getEnrichmentHeader($source_id){
$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;
}
}
$header= array();
$header[] ="
";
return $header;
}
public function getTypeOfEnrichment($source_id){
global $charset, $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()){
$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 str_replace(array(" ","%","-","?","!",";",",",":"),"",strip_empty_chars(strtolower($libelle))) :
default :
$enrichment[str_replace(array(" ","%","-","?","!",";",",",":"),"",strip_empty_chars(strtolower($libelle)))]['content'] = $this->urlsInfos($notice_id,$source_id);
break;
}
$enrichment['source_label']= sprintf($this->msg['urlslist_enrichment_source'],$source_name);
return $enrichment;
}
public function urlsInfos($notice_id,$source_id){
$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;
}
}
if($cp_field){
$query = "select datatype from notices_custom where idchamp = ".$cp_field;
$datatype = pmb_mysql_result(pmb_mysql_query($query),0,0);
$query = "select notices_custom_".$datatype." from notices_custom_values where notices_custom_champ = ".$cp_field." and notices_custom_origine= ".$notice_id;
//return $query;
$result = pmb_mysql_query($query);
if(pmb_mysql_num_rows($result)){
$html_to_return = "