/** * @param $item CommonGLPI object * @param $tabnum (default 1) * @param $withtemplate (default 0) **/ static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { global $CFG_GLPI; if ($item->getType() == 'Preference') { $config = new self(); $user = new User(); if ($user->getFromDB(Session::getLoginUserID())) { $user->computePreferences(); $config->showFormUserPrefs($user->fields); } } else { if ($item->getType() == 'User') { $config = new self(); $item->computePreferences(); $config->showFormUserPrefs($item->fields); } else { if ($item->getType() == __CLASS__) { switch ($tabnum) { case 1: $item->showFormDisplay(); break; case 2: $item->showFormUserPrefs($CFG_GLPI); break; case 3: $item->showFormInventory(); break; case 4: $item->showFormHelpdesk(); break; case 5: $item->showSystemInformations(); break; case 6: $item->showFormDBSlave(); break; } } } } return true; }
*/ // ---------------------------------------------------------------------- // Original Author of file: // Purpose of file: // ---------------------------------------------------------------------- define('GLPI_ROOT', '..'); include GLPI_ROOT . "/inc/includes.php"; header("Content-Type: text/html; charset=UTF-8"); header_nocache(); if (!isset($_REQUEST['glpi_tab'])) { exit; } checkLoginUser(); $user = new User(); switch ($_REQUEST['glpi_tab']) { case 2: $config = new Config(); $user->getFromDB(getLoginUserID()); $user->computePreferences(); $config->showFormUserPrefs($user->fields); break; case 3: DisplayPreference::showForUser(getLoginUserID()); break; default: $pref = new Preference(); if (!Plugin::displayAction($pref, $_REQUEST['glpi_tab'])) { $user->showMyForm($CFG_GLPI['root_doc'] . "/front/preference.php", getLoginUserID()); } } ajaxFooter();