auth->makePermissions([ dcAuth::PERMISSION_ADMIN, ])); $s = dcCore::app()->blog->settings->get(basename(__dir__)); $action = $_REQUEST['action'] ?? null; $order_combo = [ __('Ascending') => 'asc', __('Descending') => 'desc', ]; if ($action == 'saveconfig') { try { if (empty($_POST['comliste_page_title'])) { throw new Exception(__('No page title.')); } $s->put('enable', !empty($_POST['comliste_enable'])); $s->put('comliste_page_title', $_POST['comliste_page_title']); $s->put('comliste_nb_comments_per_page', $_POST['comliste_nb_comments_per_page'] ?? 10); $s->put('comliste_comments_order', $_POST['comliste_comments_order'] == 'asc' ? 'asc' : 'desc'); dcCore::app()->blog->triggerBlog(); dcAdminNotices::addSuccessNotice( __('Configuration successfully updated.') ); dcCore::app()->adminurl->redirect( 'admin.plugin.' . basename(__DIR__) ); } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } } echo '