// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
header_nocache();
if (!isset($_POST["id"])) {
    exit;
}
if (!isset($_REQUEST['glpi_tab'])) {
    exit;
}
if (empty($_POST["id"])) {
    $_POST["id"] = -1;
}
$kb = new KnowbaseItem();
if ($_POST['id'] > 0 && $kb->can($_POST['id'], 'r')) {
    switch ($_REQUEST['glpi_tab']) {
        case -1:
            $kb->showMenu();
            Document::showAssociated($kb);
            Plugin::displayAction($kb, $_REQUEST['glpi_tab']);
            break;
        default:
            if (!Plugin::displayAction($kb, $_REQUEST['glpi_tab'])) {
                $kb->showMenu();
                Document::showAssociated($kb);
            }
    }
}
ajaxFooter();