コード例 #1
0
ファイル: config.php プロジェクト: jewelhuq/okatea
 * @brief La page de configuration
 *
 */
# Accès direct interdit
if (!defined('ON_ESTIMATE_MODULE')) {
    die;
}
/* Initialisations
----------------------------------------------------------*/
# chargement des locales
l10n::set(__DIR__ . '/../../locales/' . $okt->user->language . '/admin.config');
# Gestionnaires de templates
$oTemplatesForm = new oktTemplatesSet($okt, $okt->estimate->config->templates['form'], 'estimate/form', 'form');
$oTemplatesForm->setBaseUrl('module.php?m=estimate&action=config&');
$oTemplatesSummary = new oktTemplatesSet($okt, $okt->estimate->config->templates['summary'], 'estimate/summary', 'summary');
$oTemplatesSummary->setBaseUrl('module.php?m=estimate&action=config&');
/* Traitements
----------------------------------------------------------*/
# enregistrement configuration
if (!empty($_POST['form_sent'])) {
    $p_enable_accessories = !empty($_POST['p_enable_accessories']) ? true : false;
    $p_captcha = !empty($_POST['p_captcha']) ? $_POST['p_captcha'] : '';
    $p_enable_notifications = !empty($_POST['p_enable_notifications']) ? true : false;
    $p_notifications_recipients = !empty($_POST['p_notifications_recipients']) ? $_POST['p_notifications_recipients'] : '';
    $p_notifications_recipients = array_map('trim', explode(',', $p_notifications_recipients));
    foreach ($p_notifications_recipients as $i => $sEmail) {
        if ($sEmail != '' && !text::isEmail($sEmail)) {
            $okt->error->set(sprintf(__('c_c_error_invalid_email'), html::escapeHTML($sEmail)));
        }
        $p_notifications_recipients[$i] = $sEmail;
    }