id_rss_flux = $id;
$this->getData();
} else {
$this->id_rss_flux = 0;
$this->getData();
}
}
// ---------------------------------------------------------------
// getData() : recuperation infos
// ---------------------------------------------------------------
function getData() {
global $dbh;
if (!$this->id_rss_flux) {
// pas d'identifiant. on retourne un tableau vide
$this->id_rss_flux=0;
$this->nom_rss_flux = "" ;
$this->link_rss_flux = "" ;
$this->descr_rss_flux = "" ;
$this->lang_rss_flux = "" ;
$this->copy_rss_flux = "" ;
$this->editor_rss_flux = "" ;
$this->webmaster_rss_flux = "" ;
$this->ttl_rss_flux = 0 ;
$this->img_url_rss_flux = "" ;
$this->img_title_rss_flux = "" ;
$this->img_link_rss_flux = "" ;
$this->format_flux = "";
$this->export_court_flux = 0;
$this->tpl_rss_flux = 0;
$this->compte_elements();
} else {
$requete = "SELECT id_rss_flux, nom_rss_flux, link_rss_flux, descr_rss_flux, lang_rss_flux, copy_rss_flux, editor_rss_flux, webmaster_rss_flux, ttl_rss_flux, img_url_rss_flux, img_title_rss_flux, img_link_rss_flux, format_flux, export_court_flux,tpl_rss_flux ";
$requete .= "FROM rss_flux WHERE id_rss_flux='".$this->id_rss_flux."' " ;
$result = mysql_query($requete, $dbh) or die ($requete."
in rss_flux.class.php : ".mysql_error());
if(mysql_num_rows($result)) {
$temp = mysql_fetch_object($result);
$this->id_rss_flux = $temp->id_rss_flux ;
$this->nom_rss_flux = $temp->nom_rss_flux ;
$this->link_rss_flux = $temp->link_rss_flux ;
$this->descr_rss_flux = $temp->descr_rss_flux ;
$this->lang_rss_flux = $temp->lang_rss_flux ;
$this->copy_rss_flux = $temp->copy_rss_flux ;
$this->editor_rss_flux = $temp->editor_rss_flux ;
$this->webmaster_rss_flux = $temp->webmaster_rss_flux ;
$this->ttl_rss_flux = $temp->ttl_rss_flux ;
$this->img_url_rss_flux = $temp->img_url_rss_flux ;
$this->img_title_rss_flux = $temp->img_title_rss_flux ;
$this->img_link_rss_flux = $temp->img_link_rss_flux ;
$this->format_flux = $temp->format_flux ;
$this->export_court_flux = $temp->export_court_flux;
$this->tpl_rss_flux = $temp->tpl_rss_flux;
$this->compte_elements();
} else {
// pas de flux avec cette cle
$this->id_rss_flux=0;
$this->nom_rss_flux = "" ;
$this->link_rss_flux = "" ;
$this->descr_rss_flux = "" ;
$this->lang_rss_flux = "" ;
$this->copy_rss_flux = "" ;
$this->editor_rss_flux = "" ;
$this->webmaster_rss_flux = "" ;
$this->ttl_rss_flux = 0 ;
$this->img_url_rss_flux = "" ;
$this->img_title_rss_flux = "" ;
$this->img_link_rss_flux = "" ;
$this->format_flux="";
$this->export_court_flux = 0;
$this->tpl_rss_flux = 0;
$this->compte_elements();
}
}
}
// ---------------------------------------------------------------
// show_form : affichage du formulaire de saisie
// ---------------------------------------------------------------
function show_form() {
global $msg, $charset;
global $dsi_flux_form;
global $dbh, $PMBuserid;
if($this->id_rss_flux) {
$action = "./dsi.php?categ=fluxrss&sub=&id_rss_flux=$this->id_rss_flux&suite=update";
$button_delete = "";
$libelle = $msg['dsi_flux_form_modif'];
} else {
$action = "./dsi.php?categ=fluxrss&sub=&id_rss_flux=0&suite=update";
$libelle = $msg['dsi_flux_form_creat'];
$button_delete ='';
}
$sel_notice_tpl=notice_tpl_gen::gen_tpl_select("notice_tpl",$this->tpl_rss_flux,$onchange);
$sel_default_format="";
$dsi_flux_form = str_replace('!!libelle!!', $libelle, $dsi_flux_form);
$dsi_flux_form = str_replace('!!id_rss_flux!!', $this->id_rss_flux, $dsi_flux_form);
$dsi_flux_form = str_replace('!!action!!', $action, $dsi_flux_form);
$dsi_flux_form = str_replace('!!nom_rss_flux!!' , htmlentities($this->nom_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!link_rss_flux!!' , htmlentities($this->link_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!descr_rss_flux!!' , htmlentities($this->descr_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!lang_rss_flux!!' , htmlentities($this->lang_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!copy_rss_flux!!' , htmlentities($this->copy_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!editor_rss_flux!!' , htmlentities($this->editor_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!webmaster_rss_flux!!' , htmlentities($this->webmaster_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!ttl_rss_flux!!' , htmlentities($this->ttl_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!img_url_rss_flux!!' , htmlentities($this->img_url_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!img_title_rss_flux!!' , htmlentities($this->img_title_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!img_link_rss_flux!!' , htmlentities($this->img_link_rss_flux ,ENT_QUOTES, $charset), $dsi_flux_form);
$dsi_flux_form = str_replace('!!format_flux_default!!' , $sel_default_format, $dsi_flux_form);
$dsi_flux_form = str_replace('!!sel_notice_tpl!!' , $sel_notice_tpl, $dsi_flux_form);
if($this->export_court_flux){
$dsi_flux_form = str_replace('!!export_court!!' , 'checked' , $dsi_flux_form);
$dsi_flux_form = str_replace('!!tpl_rss_flux!!' , '' , $dsi_flux_form);
}else{
$dsi_flux_form = str_replace('!!tpl_rss_flux!!' , 'checked' , $dsi_flux_form);
$dsi_flux_form = str_replace('!!export_court!!' , '' , $dsi_flux_form);
}
$rqt="select idcaddie as id_obj, name as name_obj from caddie where type='NOTI' ";
if ($PMBuserid!=1) $rqt.=" and (autorisations='$PMBuserid' or autorisations like '$PMBuserid %' or autorisations like '% $PMBuserid %' or autorisations like '% $PMBuserid') ";
$rqt.=" order by name ";
$result = mysql_query($rqt, $dbh) or die ($rqt."
in rss_flux.class.php : ".mysql_error());
$paniers = "";
while (($contenant = mysql_fetch_object($result))) {
if (array_search($contenant->id_obj,$this->num_paniers)!==false) $checked="checked" ;
else $checked="" ;
$paniers .= "