The contents of a (PHP) exec file

In the absence of a prive/exec/name.html SPIP template file, a call from the private zone to a ?exec=name page loads a exec_name_dist() function in a exec/name.php code file.

Such functions are mostly broken down as follows: the call to the start of the page, the declaration of a left column, a right column and a page centre. There are some pipelines that exist so that plugins will be able to add data to these page blocks.

Example of an empty "name" page

<?php
if (!defined("_ECRIRE_INC_VERSION")) return;

include_spip('inc/presentation');

function exec_nom_dist(){

    // if not authorised: error message
    if (!autoriser('voir', 'nom')) {
        include_spip('inc/minipres');
        echo minipres();
        exit;
    }

    // initialisation pipeline
    pipeline('exec_init', array('args'=>array('exec'=>'nom'),'data'=>''));

    // headers
    $commencer_page = charger_fonction('commencer_page', 'inc');
    // titre, partie, sous_partie (pour le menu)
    echo $commencer_page(_T('plugin:titre_nom'), "editer", "editer");
   
    // title
    echo "<br /><br /><br />\n"; // outch ! aie aie aie ! au secours !
    echo gros_titre(_T('plugin:titre_nom'),'', false);
   
    // left column
    echo debut_gauche('', true);
    echo pipeline('affiche_gauche', array('args'=>array('exec'=>'nom'),'data'=>''));
   
    // right column
    echo creer_colonne_droite('', true);
    echo pipeline('affiche_droite', array('args'=>array('exec'=>'nom'),'data'=>''));
   
    // centre
    echo debut_droite('', true);

    // contents
    // ...
    echo "display whatever you want to here!";
    // ...
    // end of contents

    echo pipeline('affiche_milieu', array('args'=>array('exec'=>'nom'),'data'=>''));

    echo fin_gauche(), fin_page();
}
?>

Author Mark Baber Published : Updated : 16/02/10

Translations : English, français