<?php

class ExamplePlugin
{
    static $moduleName = "Module example";
    //nom francais du module (sera afficher dans la listes des modules)
    static $requiredAdminLevel = 0;
    //Droit admin requis pour accéder au plugin
    static $documentation = "Ce module est un simple exemple";
    function getMenu()
    {
        if ($_SESSION['AdminLevel'] >= 2) {
            echo "Bonjour administrateur";
        } else {
            echo $_SESSION['username'] . " " . $_SESSION['AdminLevel'] . "<br/>";
        }
    }
}
if (isset($_GET['access'])) {
    session_start();
    $pluginExample = new ExamplePlugin();
    $pluginExample->getMenu();
}
Beispiel #2
0
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1 class="page-header">Example Plugin</h1>
<?php 
$plugin = new ExamplePlugin();
echo $plugin->example_function();
?>
</div>