// puce statut doit etre charge pour le prive...
// (changement rapide de statut)
function puce_statut_fh_formation_dist($id, $statut, $id_rubrique, $type='fh_formation', $ajax = false) {
global $lang_objet;
static $coord = array('publie' => 2,
'prepa' => 0,
'prop' => 1,
'refuse' => 3,
'poubelle' => 4);
if (!$id) {
$id = $id_rubrique;
$ajax_node ='';
}
else $ajax_node = " id='imgstatut$type$id'";
if ($ajax) {
$statut = sql_getfetsel('statut', 'spip_fh_formations', 'id_formation='.$id);
}
$inser_puce = puce_statut($statut, " width='9' height='9' style='margin: 1px;'$ajax_node");
if (!autoriser('publier', 'formation', $id)
OR !_ACTIVER_PUCE_RAPIDE)
return $inser_puce;
$titles = array(
"blanche" => _T('texte_statut_en_cours_redaction'),
"orange" => _T('texte_statut_propose_evaluation'),
"verte" => _T('texte_statut_publie'),
"rouge" => _T('texte_statut_refuse'),
"poubelle" => _T('texte_statut_poubelle'));
$clip = 1+ (11*$coord[$statut]);
if ($ajax){
return ""
. $inser_puce
. ""
. "";
}
$nom = "puce_statut_";
if ((! _SPIP_AJAX) AND $type != 'fh_formation')
$over ='';
else {
$action = generer_url_ecrire('puce_statut',"",true);
$action = "if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut('$nom', '$type', '$id', '$action'); }";
$over = "\nonmouseover=\"$action\"";
}
return ""
. $inser_puce
. '';
}