<?php /***************************************************************************\ * SPIP, Systeme de publication pour l'internet * * * * Copyright (c) 2001-2011 * * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * * * * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * \***************************************************************************/ // // Ce fichier definit les boucles standard de SPIP // if (!defined('_ECRIRE_INC_VERSION')) return; /** * Afficher la puce de statut pour les documents * * @param unknown_type $id_document * @param unknown_type $statut * @param unknown_type $id_rubrique * @param unknown_type $type * @param unknown_type $ajax * @return unknown */ function medias_puce_statut_document($id_document, $statut){ if ($statut=='publie') { $puce='puce-verte.gif'; } else if ($statut == "prepa") { $puce = 'puce-blanche.gif'; } else if ($statut == "poubelle") { $puce = 'puce-poubelle.gif'; } else $puce = 'puce-blanche.gif'; return http_img_pack($puce, $statut, "class='puce'"); } // // <BOUCLE(DOCUMENTS)> // // http://doc.spip.org/@boucle_DOCUMENTS_dist function boucle_DOCUMENTS($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; // on ne veut pas des fichiers de taille nulle, // sauf s'ils sont distants (taille inconnue) array_unshift($boucle->where,array("'($id_table.taille > 0 OR $id_table.distant=\\'oui\\')'")); // Supprimer les vignettes if (!isset($boucle->modificateur['criteres']['mode']) AND !isset($boucle->modificateur['criteres']['tout'])) { array_unshift($boucle->where,array("'IN'", "'$id_table.mode'", "'(\\'image\\',\\'document\\')'")); } return calculer_boucle($id_boucle, $boucles); } function lien_objet($id,$type,$longueur=80,$connect=NULL){ include_spip('inc/liens'); $titre = traiter_raccourci_titre($id, $type, $connect); $titre = typo($titre['titre']); if (!strlen($titre)) $titre = _T('info_sans_titre'); $url = generer_url_entite($id,$type); return "<a href='$url' class='$type'>".couper($titre,$longueur)."</a>"; } function critere_DOCUMENTS_orphelins_dist($idb, &$boucles, $crit) { $boucle = &$boucles[$idb]; $quoi = '@$Pile[0]["orphelins"]'; $cond = $crit->cond; $not = $crit->not?"":"NOT"; $select = sql_get_select("DISTINCT id_document","spip_documents_liens as oooo"); $where = "'".$boucle->id_table.".id_document $not IN ($select)'"; if ($cond) $where = "($quoi)?$where:''"; $boucle->where[]= $where; } ?>