* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * * 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/api/admin/api.php * \ingroup api * \brief Page to setup api module */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $langs->load("admin"); if (! $user->admin) accessforbidden(); $action=GETPOST("action"); //Activate ProfId if ($action == 'setproductionmode') { $status = GETPOST('status','alpha'); if (dolibarr_set_const($db, 'API_PRODUCTION_MODE', $status, 'chaine', 0, '', $conf->entity) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); } } /* * View */ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("ApiSetup"),$linkback,'title_setup'); print $langs->trans("ApiDesc")."
\n"; print "
\n"; //print '
'; print ''; print ''; print ''; print ""; print ""; print ""; print ""; print ''; print ''; $production_mode=(empty($conf->global->API_PRODUCTION_MODE)?false:true); if ($production_mode) { print ''; } else { print ''; } print ''; print ''; print '
".$langs->trans("Parameter")."".$langs->trans("Value")." 
'.$langs->trans("ApiProductionMode").''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print ' 
'; print '

'; // API endpoint print ''.$langs->trans("ApiEndPointIs").':
'; $url=DOL_MAIN_URL_ROOT.'/public/api/'; print img_picto('','object_globe.png').' '.$url."
\n"; $url=DOL_MAIN_URL_ROOT.'/public/api/.json'; print img_picto('','object_globe.png').' '.$url."
\n"; // Explorer print ''.$langs->trans("ApiExporerIs").':
'; $url=DOL_MAIN_URL_ROOT.'/public/api/explorer/index.html'; print img_picto('','object_globe.png').' '.$url."
\n"; print '
'; print '
'; print $langs->trans("OnlyActiveElementsAreExposed", DOL_URL_ROOT.'/admin/modules.php'); llxFooter(); $db->close();