Skip to content
Snippets Groups Projects
Commit 9a3be241 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

correctly display original name, fixes #4419

Closes #4419

Merge request studip/studip!3277
parent 61d41bbf
No related branches found
No related tags found
No related merge requests found
...@@ -214,6 +214,9 @@ class Course_ContentmodulesController extends AuthenticatedController ...@@ -214,6 +214,9 @@ class Course_ContentmodulesController extends AuthenticatedController
$this->module = PluginManager::getInstance()->getPluginById($module_id); $this->module = PluginManager::getInstance()->getPluginById($module_id);
$this->metadata = $this->module->getMetadata(); $this->metadata = $this->module->getMetadata();
$this->original_name = $this->metadata['diplayname'] ?? $this->module->getPluginName();
PageLayout::setTitle(_('Werkzeug umbenennen')); PageLayout::setTitle(_('Werkzeug umbenennen'));
$this->tool = ToolActivation::find([$context->id, $module_id]); $this->tool = ToolActivation::find([$context->id, $module_id]);
......
<?php
/**
* @var Course_ContentmodulesController $controller
* @var StudipModule $module
* @var string $original_name
* @var array $metadata
* @var ToolActivation $tool
*/
?>
<form class="default" <form class="default"
action="<?= $controller->link_for('course/contentmodules/rename/' . $module->getPluginId()) ?>" action="<?= $controller->link_for('course/contentmodules/rename/' . $module->getPluginId()) ?>"
method="post"> method="post">
...@@ -7,17 +16,17 @@ ...@@ -7,17 +16,17 @@
<?= _('Neuer Name des Werkzeugs') ?> <?= _('Neuer Name des Werkzeugs') ?>
<input type="text" <input type="text"
name="displayname" name="displayname"
value="<?= $tool && $tool['metadata'] ? htmlReady($tool['metadata']['displayname']) : ''?>" value="<?= htmlReady($tool['metadata']['displayname'] ?? '') ?>"
placeholder="<?= htmlReady($metadata['displayname'] ?? '') ?>"> placeholder="<?= htmlReady($original_name) ?>">
</label> </label>
<div> <div>
<?= htmlReady(sprintf(_('Ursprünglicher Werkzeugname ist "%s".'), $metadata['displayname'] ?? '')) ?> <?= htmlReady(sprintf(_('Ursprünglicher Werkzeugname ist "%s".'), $original_name)) ?>
</div> </div>
</fieldset> </fieldset>
<div data-dialog-button> <div data-dialog-button>
<?= \Studip\Button::create(_('Speichern'))?> <?= \Studip\Button::create(_('Speichern'))?>
<? if ($tool && $tool['metadata'] && $tool['metadata']['displayname']) : ?> <? if (!empty($tool['metadata']['displayname'])) : ?>
<?= \Studip\Button::create(_('Namen löschen'), 'delete') ?> <?= \Studip\Button::create(_('Namen löschen'), 'delete') ?>
<? endif ?> <? endif ?>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment