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 { $packman_pack_nocomment = !empty($_POST['packman_pack_nocomment']); $packman_pack_fixnewline = !empty($_POST['packman_pack_fixnewline']); $packman_pack_overwrite = !empty($_POST['packman_pack_overwrite']); $packman_pack_filename = (string) $_POST['packman_pack_filename']; $packman_secondpack_filename = (string) $_POST['packman_secondpack_filename']; $packman_pack_repository = (string) path::real($_POST['packman_pack_repository'], false); $packman_pack_excludefiles = (string) $_POST['packman_pack_excludefiles']; $check = Utils::is_configured( $packman_pack_repository, $packman_pack_filename, $packman_secondpack_filename ); if ($check) { $s = dcCore::app()->blog->settings->__get(Core::id()); $s->put('packman_pack_nocomment', $packman_pack_nocomment); $s->put('packman_pack_fixnewline', $packman_pack_fixnewline); $s->put('packman_pack_overwrite', $packman_pack_overwrite); $s->put('packman_pack_filename', $packman_pack_filename); $s->put('packman_secondpack_filename', $packman_secondpack_filename); $s->put('packman_pack_repository', $packman_pack_repository); $s->put('packman_pack_excludefiles', $packman_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") ) . '

' . __('Files') . '

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

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

' . __('Content') . '

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

'; } }