* Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/admin/debugbar.php * \ingroup debugbar * \brief Setup page for debugbar module */ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; global $conf; if (!$user->admin) { accessforbidden(); } // Load translation files required by the page $langs->loadLangs(array("admin", "other")); $error = 0; $action = GETPOST('action', 'aZ09'); /* * Actions */ // Set modes if ($action == 'set') { $db->begin(); $result1 = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOSTINT('DEBUGBAR_LOGS_LINES_NUMBER'), 'chaine', 0, '', 0); $result2 = dolibarr_set_const($db, "DEBUGBAR_USE_LOG_FILE", GETPOSTINT('DEBUGBAR_USE_LOG_FILE'), 'chaine', 0, '', 0); if ($result1 < 0 || $result2 < 0) { $error++; } if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); setEventMessages($error, null, 'errors'); } } /* * View */ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-debugbar'); $form = new Form($db); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("DebugBarSetup"), $linkback, 'title_setup'); if (!function_exists('mb_check_encoding')) { $langs->load("errors"); print info_admin($langs->trans("ErrorPHPNeedModule", 'mbstring'), 0, 0, 'error'); } print '
'; // Level print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DEBUGBAR_USE_LOG_FILE").''; print $form->selectyesno('DEBUGBAR_USE_LOG_FILE', getDolGlobalString('DEBUGBAR_USE_LOG_FILE'), 1); print ''; print ' '.$langs->trans("UsingLogFileShowAllRecordOfSubrequestButIsSlower").''; print '
'.$langs->trans("DEBUGBAR_LOGS_LINES_NUMBER").''; // This slow seriously output print ''; print ''.$langs->trans("WarningValueHigherSlowsDramaticalyOutput").''; print '
'; print "
\n"; // End of page llxFooter(); $db->close();