From 8a6831f7d910f3ff7791d27fdf3988028982caa5 Mon Sep 17 00:00:00 2001 From: Murtaza Sultani Date: Fri, 5 Sep 2025 13:33:23 +0200 Subject: Resolve "Forum: Konfiguration auf Vue umsetzen" Closes #5784 Merge request studip/studip!4410 --- app/controllers/course/forum/configs.php | 18 ++++++-- app/views/course/forum/configs/edit.php | 53 ---------------------- lib/classes/Forum/BaseController.php | 2 +- resources/vue/apps/forum/configs/Edit.vue | 73 +++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 58 deletions(-) delete mode 100644 app/views/course/forum/configs/edit.php create mode 100644 resources/vue/apps/forum/configs/Edit.vue diff --git a/app/controllers/course/forum/configs.php b/app/controllers/course/forum/configs.php index c99f718..a065a6a 100644 --- a/app/controllers/course/forum/configs.php +++ b/app/controllers/course/forum/configs.php @@ -17,18 +17,28 @@ class Course_Forum_ConfigsController extends Forum\BaseController public function edit_action() { - $this->config = Context::get()->getConfiguration(); + $config = Context::get()->getConfiguration(); + + $this->render_vue_app( + Studip\VueApp::create('forum/configs/Edit') + ->withProps([ + 'config' => [ + 'moderator' => $config->FORUM_MODERATION_PERMISSION, + 'categories_navigation' => $config->FORUM_HIDE_CATEGORIES_NAVIGATION + ] + ]) + ); } public function save_action() { CSRFProtection::verifyUnsafeRequest(); - $this->config = Context::get()->getConfiguration(); + $config = Context::get()->getConfiguration(); - $this->config->store('FORUM_MODERATION_PERMISSION', trim(Request::option('forum_moderation_permission'))); + $config->store('FORUM_MODERATION_PERMISSION', trim(Request::option('moderator'))); - $this->config->store('FORUM_HIDE_CATEGORIES_NAVIGATION', Request::bool('forum_hide_categories_navigation')); + $config->store('FORUM_HIDE_CATEGORIES_NAVIGATION', Request::bool('categories_navigation')); PageLayout::postSuccess(_('Die Einstellungen wurden gespeichert.')); diff --git a/app/views/course/forum/configs/edit.php b/app/views/course/forum/configs/edit.php deleted file mode 100644 index ceb23d8..0000000 --- a/app/views/course/forum/configs/edit.php +++ /dev/null @@ -1,53 +0,0 @@ - - -
- - - - - - -
- -
-
diff --git a/lib/classes/Forum/BaseController.php b/lib/classes/Forum/BaseController.php index aa1bfd2..327e0bc 100644 --- a/lib/classes/Forum/BaseController.php +++ b/lib/classes/Forum/BaseController.php @@ -50,7 +50,7 @@ abstract class BaseController extends StudipController _('Forum verwalten'), $this->url_for('course/forum/configs/edit'), Icon::create('admin', Icon::ROLE_CLICKABLE, ['title' => _('Forum verwalten')]), - ['data-dialog' => 'width=500;height=300'] + ['data-dialog' => 'width=500;height=350'] ); } diff --git a/resources/vue/apps/forum/configs/Edit.vue b/resources/vue/apps/forum/configs/Edit.vue new file mode 100644 index 0000000..8357e05 --- /dev/null +++ b/resources/vue/apps/forum/configs/Edit.vue @@ -0,0 +1,73 @@ + + + + -- cgit v1.0