blog->settings->addNamespace('arlequinMulti'); [$mt_cfg, $mt_exclude] = adminArlequin::loadSettings(dcCore::app()->blog->settings); if (adminArlequin::$initialized) { dcAdminNotices::AddSuccessNotice(__('Settings have been reinitialized.')); } // Enregistrement des données depuis les formulaires if (isset($_POST['mt_action_config'])) { $mt_cfg['e_html'] = $_POST['e_html']; $mt_cfg['a_html'] = $_POST['a_html']; $mt_cfg['s_html'] = $_POST['s_html']; $mt_exclude = $_POST['mt_exclude']; } // Traitement des requêtes if (isset($_POST['mt_action_config'])) { dcCore::app()->blog->settings->arlequinMulti->put('mt_cfg', serialize($mt_cfg)); dcCore::app()->blog->settings->arlequinMulti->put('mt_exclude', $mt_exclude); dcAdminNotices::AddSuccessNotice(__('System settings have been updated.')); dcCore::app()->blog->triggerBlog(); dcCore::app()->adminurl->redirect('admin.plugin.' . basename(__DIR__), ['config' => 1]); } if (isset($_POST['mt_action_restore'])) { dcCore::app()->blog->settings->arlequinMulti->drop('mt_cfg'); dcCore::app()->blog->settings->arlequinMulti->drop('mt_exclude'); dcAdminNotices::AddSuccessNotice(__('Settings have been reinitialized.')); dcCore::app()->blog->triggerBlog(); dcCore::app()->adminurl->redirect('admin.plugin.' . basename(__DIR__), ['restore' => 1]); } } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } // Headers $jsModels = ''; $cslashes = "\n\"\'"; foreach ($mt_models as $m) { // @phpstan-ignore-line $jsModels .= "\t" . 'arlequin.addModel(' . '"' . html::escapeJS($m['name']) . '",' . '"' . addcslashes($m['s_html'], $cslashes) . '",' . '"' . addcslashes($m['e_html'], $cslashes) . '",' . '"' . addcslashes($m['a_html'], $cslashes) . '"' . ");\n"; } // DISPLAY echo '