use dcPage open/close module

master
Jean-Christian Paul Denis 2023-03-05 23:00:17 +01:00
parent 3f347f0330
commit 32c2d73daf
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
1 changed files with 14 additions and 15 deletions

View File

@ -113,7 +113,7 @@ class Manage extends dcNsProcess
} }
} }
} }
dcCore::app()->blog->settings->get(Core::id())->put('preferences', serialize($preferences), 'string', null, true, true); dcCore::app()->blog->settings->get(Core::id())->put('preferences', json_encode($preferences), 'string', null, true, true);
dcAdminNotices::addSuccessNotice(__('Configuration successfully updated')); dcAdminNotices::addSuccessNotice(__('Configuration successfully updated'));
return true; return true;
@ -220,20 +220,19 @@ class Manage extends dcNsProcess
return; return;
} }
$bc = empty($_REQUEST['config']) ? dcPage::openModule(
(self::$type == 'theme' ? __('Themes actions') : __('Plugins actions')) : Core::name(),
__('Configure module');
echo '<html><head><title>' . __('improve') . '</title>' .
dcPage::jsModuleLoad(Core::id() . '/js/index.js') . dcPage::jsModuleLoad(Core::id() . '/js/index.js') .
(self::$action === null ? '' : self::$action->header()) . (self::$action === null ? '' : self::$action->header())
'</head><body>' . );
dcPage::notices() .
echo
dcPage::breadcrumb([ dcPage::breadcrumb([
__('Plugins') => '', __('Plugins') => '',
__('improve') => '', Core::name() => '',
$bc => '', empty($_REQUEST['config']) ? (self::$type == 'theme' ? __('Themes actions') : __('Plugins actions')) : __('Configure module') => '',
]); ]) .
dcPage::notices();
if (empty($_REQUEST['config'])) { if (empty($_REQUEST['config'])) {
self::displayActions(); self::displayActions();
@ -241,7 +240,7 @@ class Manage extends dcNsProcess
self::displayConfigurator(); self::displayConfigurator();
} }
echo '</body></html>'; dcPage::closeModule();
} }
private static function displayConfigurator(): void private static function displayConfigurator(): void
@ -278,7 +277,7 @@ class Manage extends dcNsProcess
'<p class="anchor-nav"><label for="type" class="classic">' . __('Goto:') . ' </label>' . '<p class="anchor-nav"><label for="type" class="classic">' . __('Goto:') . ' </label>' .
form::combo('type', [__('Plugins') => 'plugin', __('Themes') => 'theme'], self::$type) . ' ' . form::combo('type', [__('Plugins') => 'plugin', __('Themes') => 'theme'], self::$type) . ' ' .
'<input type="submit" value="' . __('Ok') . '" />' . '<input type="submit" value="' . __('Ok') . '" />' .
form::hidden('p', 'improve') . '</p>' . form::hidden('p', Core::id()) . '</p>' .
'</form>'; '</form>';
$combo_modules = self::comboModules(); $combo_modules = self::comboModules();