Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

> > > > accueil_gadget

accueil_gadget

This pipeline is used to add links above the content of the home page in the private zone, within the frame that lists the various actions available (create a section, an article, a news item, etc.).

  1. $gadget = pipeline('accueil_gadgets', $gadget);

This pipeline accepts a text argument and returns the supplemented text as output.

Example

The "breves" plugin, if it existed, would use this pipeline to add a link at the top to allow the user to create or view the list of news item depending on the status of the author currently connected:

  1. function breves_accueil_gadgets($texte){
  2. if ($GLOBALS['meta']['activer_breves'] != 'non') {
  3. // create, otherwise view
  4. if ($GLOBALS['visiteur_session']['statut'] == "0minirezo") {
  5. $ajout = icone_horizontale(_T('icone_nouvelle_breve'), generer_url_ecrire("breves_edit","new=oui"), "breve-24.png","new", false);
  6. } else {
  7. $ajout = icone_horizontale (_T('icone_breves'), generer_url_ecrire("breves",""), "breve-24.png", "", false);
  8. }
  9. $texte = str_replace("</tr></table>", "<td>$ajout</td></tr></table>", $texte);
  10. }
  11. return $texte;
  12. }

Download

  • Author :
  • Published :
  • Updated : 31/05/10
  • Translations : English, français