Defining page tabs

Declaring the tabs for the exec pages in the private zone follows exactly the same syntax as for the buttons. The name of the parent, however, is mandatory here and corresponds to a parameter passed in the call function for the tab in the exec file:

<onglet id='identifier' parent='tab bar identifier'>
    <titre>placeholder title</titre>
    <url>exec filename</url>

As for the buttons, if the URL is not provided, then the identifier name is used as the name of the file to be loaded.


Again as with the buttons, an authorisation is used to manage whether the tab is displayed or not.

function autoriser_identifiant_onglet_dist($faire, $type, $id, $qui, $opt) {
    return true; // or false


The "Champs Extras 2" (Extra fields v2) plugin adds a tab into the configuration page, into the toolbar quite appropriately named "configuration". Here are the declarations used in its plugin.xml file:

<onglet id='iextras' parent='configuration'>

Authorisations are defined in the inc/iextras_autoriser.php file. The tab only displays if the author is declared as a "webmestre (webmaster)".

if (!defined("_ECRIRE_INC_VERSION")) return;

// function for the pipeline, nothing to do
function iextras_autoriser(){}

// authorisation declarations
function autoriser_iextras_onglet_dist($faire, $type, $id, $qui, $opt) {
    return autoriser('configurer', 'iextras', $id, $qui, $opt);

function autoriser_iextras_configurer_dist($faire, $type, $id, $qui, $opt) {
    return autoriser('webmestre', $type, $id, $qui, $opt);

Finally, in the exec/iextras.php file, the toolbar is called as shown below. The first is the identifier of the requested toolbar, the second is the identifier of the current tab.

echo barre_onglets("configuration", "iextras");

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

Translations : English, français