blog->settings->addNamespace(Core::id()); self::$init = true; } return self::$init; } public static function process(): void { if (!self::$init) { return; } if (empty($_POST['save'])) { return; } # -- Set settings -- try { $pack_nocomment = !empty($_POST['pack_nocomment']); $pack_fixnewline = !empty($_POST['pack_fixnewline']); $pack_overwrite = !empty($_POST['pack_overwrite']); $pack_filename = (string) $_POST['pack_filename']; $secondpack_filename = (string) $_POST['secondpack_filename']; $pack_repository = (string) $_POST['pack_repository']; $pack_excludefiles = (string) $_POST['pack_excludefiles']; $check = Utils::is_configured( Utils::getRepositoryDir($pack_repository), $pack_filename, $secondpack_filename ); if ($check) { $s = dcCore::app()->blog->settings->__get(Core::id()); $s->put('pack_nocomment', $pack_nocomment); $s->put('pack_fixnewline', $pack_fixnewline); $s->put('pack_overwrite', $pack_overwrite); $s->put('pack_filename', $pack_filename); $s->put('secondpack_filename', $secondpack_filename); $s->put('pack_repository', $pack_repository); $s->put('pack_excludefiles', $pack_excludefiles); dcPage::addSuccessNotice( __('Configuration has been successfully updated.') ); http::redirect( dcCore::app()->admin->__get('list')->getURL('module=' . Core::id() . '&conf=1&redir=' . dcCore::app()->admin->__get('list')->getRedir()) ); } } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } } public static function render() { if (!self::$init) { return false; } # -- Get settings -- $s = dcCore::app()->blog->settings->__get(Core::id()); # -- Display form -- echo '

' . __('Root') . '

' . '

' . sprintf( __('Preconization: %s'), dcCore::app()->blog->public_path ? dcCore::app()->blog->public_path : __("Blog's public directory") ) . '
' . __('Leave it empty to use Dotclear VAR directory') . '

' . __('Files') . '

' . sprintf(__('Preconization: %s'), '%type%-%id%') . '

' . sprintf(__('Preconization: %s'), '%type%-%id%-%version%') . '

' . __('Content') . '

' . sprintf(__('Preconization: %s'), '*.zip,*.tar,*.tar.gz') . '

'; } }