aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/studyarea.php
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2023-06-28 13:27:46 +0000
committerThomas Hackl <hackl@data-quest.de>2023-06-28 13:27:46 +0000
commit559ab723fabd4d10f26e7df631808e4cb8d91c9b (patch)
tree91ef8cf94eba86973baf3efabca1cdbb8bf6826b /app/controllers/studyarea.php
parentb7f0f8bcaad8fefd96fd3e6316377eda53929ad3 (diff)
Resolve "Neuentwicklung Verzeichnisstrukturen"
Closes #1664, #2693, and #2692 Merge request studip/studip!1081
Diffstat (limited to 'app/controllers/studyarea.php')
-rw-r--r--app/controllers/studyarea.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/app/controllers/studyarea.php b/app/controllers/studyarea.php
new file mode 100644
index 0000000..e43c9b0
--- /dev/null
+++ b/app/controllers/studyarea.php
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * treenode.php - Controller for editing tree nodes
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * @author Thomas Hackl <hackl@data-quest.de>
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 or later
+ * @category Stud.IP
+ * @since 5.4
+ */
+
+class StudyareaController extends AuthenticatedController
+{
+ public function edit_action($id = '')
+ {
+ if ($id !== '') {
+ $object = StudipStudyArea::find($id);
+ } else {
+ $object = new StudipStudyArea();
+ }
+
+ PageLayout::setTitle($object->isNew() ? _('Studienbereich anlegen') : _('Studienbereich bearbeiten'));
+
+ $this->form = Studip\Forms\Form::fromSORM(
+ $object,
+ [
+ 'legend' => $object->isNew()
+ ? _('Neuer Studienbereich')
+ : sprintf(_('Studienbereich %s'), $object->name),
+ 'text' => ['text' => ''],
+ 'fields' => [
+ 'name' => [
+ 'label' => _('Name'),
+ 'type' => 'text',
+ 'required' => true
+ ],
+ 'info' => [
+ 'label' => _('Beschreibung'),
+ 'type' => 'textarea'
+ ]
+ ]
+ ]
+ )->setURL($this->url_for('studyarea/store', $object->id));
+ }
+
+}