Exemple #1
0
 static function getMenuContent()
 {
     global $CFG_GLPI;
     $menu = array();
     $menu['title'] = self::getMenuName();
     $menu['page'] = "/plugins/badges/front/badge.php";
     $menu['links']['search'] = PluginBadgesBadge::getSearchURL(false);
     if (PluginBadgesBadge::canCreate()) {
         $menu['links']['add'] = PluginBadgesBadge::getFormURL(false);
     }
     return $menu;
 }
Exemple #2
0
along with Badges. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$badge = new PluginBadgesBadge();
if (isset($_POST["add"])) {
    $badge->check(-1, CREATE, $_POST);
    $newID = $badge->add($_POST);
    if ($_SESSION['glpibackcreated']) {
        Html::redirect($badge->getFormURL() . "?id=" . $newID);
    }
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $badge->check($_POST['id'], DELETE);
        $badge->delete($_POST);
        $badge->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $badge->check($_POST['id'], PURGE);
            $badge->restore($_POST);
            $badge->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $badge->check($_POST['id'], PURGE);