$obj) { list($nb, $nb_lies, $ids) = cs_corbeille_gerer($table, -1); $ids = join(',', $ids); $infos = ($nb?_T('couteauprive:corbeille_objets', array('nb'=>$nb)):_T('couteauprive:corbeille_objets_vide')) .($nb_lies>0?' '._T('couteauprive:corbeille_objets_lies', array('nb_lies'=>$nb_lies)):''); $objets[] = ""; } return ajax_action_auteur('action_rapide', 'purge_corbeille', 'admin_couteau_suisse', "arg=corbeille|description_outil&cmd=descrip#cs_action_rapide", "\n
'); } // pour ajouter des tables dans la corbeille, utiliser le tableau : global $corbeille_params['nvelle_table_SPIP']; /* "statut" => nom du statut dans la base de donnees (bdd), "table" => nom eventuel de la table, pour definir plusieurs noisettes avec une meme table mais des statuts differents, "libelle" => libelle court, "tableliee" => tableau des tables spip � vider en meme temps ) */ function cs_corbeille_table_infos($table=false) { static $params = NULL; if(is_null($params)) { global $corbeille_params; $params = array ( "articles" => array( "statut" => "poubelle", "tableliee"=> array("spip_auteurs_articles","spip_documents_liens","spip_mots_articles","spip_signatures","spip_versions","spip_versions_fragments","spip_forum"), "libelle" => 'icone_articles', ), "auteurs" => array( "statut" => "5poubelle", "temps" => "maj", "libelle" => 'icone_auteurs', ), "breves" => array( "statut" => "refuse", "libelle" => defined('_SPIP30000')?'breves:icone_breves':'icone_breves', ), "signatures" => array( "statut" => "poubelle", "libelle" => 'couteau:objet_petitions', ), "sites" => array( "statut" => "refuse", "tableliee"=> array("spip_syndic_articles","spip_mots_syndic"), "libelle" => 'couteau:objet_syndics', ), ); // TODO: declaration de la corbeille dans le plugin _core/forum (SPIP 2.1) if(!defined('_SPIP20100')) $params = array_merge($params, array( "forums_publics" => array( "statut" => "off", "table"=>"forum", "libelle" => 'titre_forum', ), "forums_prives" => array( "statut" => "privoff", "table"=>"forum", "libelle" => 'icone_forum_administrateur', ), )); if(is_array($corbeille_params)) $params = array_merge($params, $corbeille_params); } if(!$table) return $params; if(isset($params[$table])) return $params[$table]; return false; } /** * supprime/compte les elements listes d'un type donne * * @param nom $table * @param tableau $ids (si $id==-1, on vide/compte tout) * @param booleen $compter * @return array(nb objets, nb objets lies, ids trouves) */ function cs_corbeille_gerer($table, $ids=array(), $vider=false) { $params = cs_corbeille_table_infos($table); if (isset($params['table'])) $table = $params['table']; include_spip('base/abstract_sql'); $type = objet_type($table); $table_sql = table_objet_sql($type); $id_table = id_table_objet($type); if (!$params['statut']) return false; //echo "$type - $table_sql - $id_table - ",table_objet_sql($type),'