_T('podcast:titre_podcasts'), 'id_article' => $id_objet ) ); if (autoriser('creerpodcastdans', 'articles', $id_objet)) { include_spip('inc/presentation'); $flux['data'] .= icone_verticale( _T('podcast:icone_creer_podcast'), generer_url_ecrire('podcast_edit', "id_article=$id_objet"), 'podcast-24.png', 'new', 'right' ) . "
"; } } if ($e['type'] === 'podcast') { $flux['data'] .= recuperer_fond( 'prive/objets/liste/chapitres', array( 'titre' => _T('chapitre:titre_chapitres'), 'id_podcast' => $id_objet ) ); if (autoriser('creerchapitredans', 'podcasts', $id_objet)) { include_spip('inc/presentation'); $flux['data'] .= icone_verticale( _T('chapitre:icone_creer_chapitre'), generer_url_ecrire('chapitre_edit', "id_podcast=$id_objet"), 'chapitre-24.png', 'new', 'right' ) . "
"; } } } return $flux; } /** * Afficher le nombre d'éléments dans les parents * * @pipeline boite_infos * @param array $flux Données du pipeline * @return array Données du pipeline **/ function podcast_boite_infos($flux) { if (isset($flux['args']['type']) and isset($flux['args']['id']) and $id = intval($flux['args']['id'])) { $texte = ''; if ($flux['args']['type'] == 'article' and $nb = sql_countsel('spip_podcasts', array('id_article=' . $id))) { $texte .= '
' . singulier_ou_pluriel($nb, 'podcast:info_1_podcast', 'podcast:info_nb_podcasts') . "
\n"; } if ($flux['args']['type'] == 'podcast' and $nb = sql_countsel('spip_chapitres', array('id_podcast=' . $id))) { $texte .= '
' . singulier_ou_pluriel($nb, 'chapitre:info_1_chapitre', 'chapitre:info_nb_chapitres') . "
\n"; } if ($texte and $p = strpos($flux['data'], '')) { $flux['data'] = substr_replace($flux['data'], $texte, $p, 0); } } return $flux; } /** * Compter les enfants d'un objet * * @pipeline objets_compte_enfants * @param array $flux Données du pipeline * @return array Données du pipeline **/ function podcast_objet_compte_enfants($flux) { if ($flux['args']['objet'] == 'article' and $id_article = intval($flux['args']['id_objet'])) { $flux['data']['podcasts'] = sql_countsel('spip_podcasts', 'id_article= ' . intval($id_article)); } if ($flux['args']['objet'] == 'podcast' and $id_podcast = intval($flux['args']['id_objet'])) { $flux['data']['chapitres'] = sql_countsel('spip_chapitres', 'id_podcast= ' . intval($id_podcast)); } return $flux; }