* Copyright (C) 2023-2024 Lionel Vessiller * Copyright (C) 2023-2024 Patrice Andreani * * 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/webportal/admin/configcss.php * \ingroup webportal * \brief WebPortal setup page. */ // Load Dolibarr environment require_once "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; require_once DOL_DOCUMENT_ROOT . "/webportal/lib/webportal.lib.php"; // Translations $langs->loadLangs(array("admin", "hrm", "other", "website")); // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('webportalsetup', 'globalsetup')); // Parameters $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); if (empty($action)) { $action = 'edit'; } // Access control if (!$user->admin) { accessforbidden(); } /* * Actions */ $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } // Convert action set_XXX and del_XXX to set var (this is used when no javascript on for ajax_constantonoff) $regs = array(); if (preg_match('/^(set|del)_([A-Z_]+)$/', $action, $regs)) { if ($regs[1] == 'set') { dolibarr_set_const($db, $regs[2], 1, 'chaine', 0, '', $conf->entity); } else { dolibarr_del_const($db, $regs[2], $conf->entity); } } if ($action == 'updatecss') { dolibarr_set_const($db, "WEBPORTAL_CUSTOM_CSS", GETPOST('WEBPORTAL_CUSTOM_CSS', 'restricthtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "WEBPORTAL_PARAMS_REV", ((int) $conf->global->WEBPORTAL_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); } /* * View */ $title = "WebPortalSetup"; $wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader( '', $langs->trans($title), $wikihelp, '', 0, 0, array( '/includes/ace/src/ace.js', '/includes/ace/src/ext-statusbar.js', '/includes/ace/src/ext-language_tools.js', ), array() ); // Subheader $linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($langs->trans($title), $linkback, 'title_setup'); // Configuration header $head = webportalAdminPrepareHead(); print dol_get_fiche_head($head, 'css', $langs->trans($title), -1, "webportal"); // Setup page goes here echo '' . $langs->trans("WebPortalCSS") . '

'; //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; print '
'; print ''; print ''; clearstatcache(); // editeur CSS print '
'; print ''; print ''; print '' . "\n"; print '
'; $customcssValue = getDolGlobalString('WEBPORTAL_CUSTOM_CSS'); $doleditor = new DolEditor('WEBPORTAL_CUSTOM_CSS', $customcssValue, '80%', 400, 'Basic', 'In', true, false, 'ace', 10, '90%'); $doleditor->Create(0, '', true, 'css', 'css'); print '
' . "\n"; print '
'; print '
'; print ''; //print ''; print '
'; print '
'; // Page end print dol_get_fiche_end(); // End of page llxFooter(); $db->close();