public function action(Request $request)
 {
     switch ($request->get("action")) {
         case "delete":
             VariableAdmin::getInstance($request->query->get("id"))->delete();
             break;
         case "edit":
             VariableAdmin::getInstance($request->request->get("id"))->edit($request);
             break;
         case "add":
             VariableAdmin::getInstance()->add($request->request->get("nom"), $request->request->get("valeur"));
             break;
     }
 }
Exemplo n.º 2
0
            <table class="table table-striped">
                <tbody>
                    <tr class="<?php 
if ($addError && ($errorData->nom === '' || VariableAdmin::testVariableExists($errorData->nom))) {
    ?>
error<?php 
}
?>
">
                        <td>
                            <?php 
echo trad('Nom2', 'admin');
?>
 *
                            <?php 
if ($addError && VariableAdmin::testVariableExists($errorData->nom)) {
    ?>
                            <br /><?php 
    echo trad('variable_already_exists', 'admin');
    ?>
                            <?php 
}
?>
                        </td>
                        <td><input type="text" name="nom" value="<?php 
echo $addError ? $errorData->nom : '';
?>
"></td>
                    </tr>
                    <tr>
                        <td><?php