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
$this->module = PluginManager::getInstance()->getPluginById($module_id);
$this->metadata = $this->module->getMetadata();
$this->original_name = $this->metadata['diplayname'] ?? $this->module->getPluginName();
PageLayout::setTitle(_('Werkzeug umbenennen'));
$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"
action="<?= $controller->link_for('course/contentmodules/rename/' . $module->getPluginId()) ?>"
method="post">
......@@ -7,17 +16,17 @@
<?= _('Neuer Name des Werkzeugs') ?>
<input type="text"
name="displayname"
value="<?= $tool && $tool['metadata'] ? htmlReady($tool['metadata']['displayname']) : ''?>"
placeholder="<?= htmlReady($metadata['displayname'] ?? '') ?>">
value="<?= htmlReady($tool['metadata']['displayname'] ?? '') ?>"
placeholder="<?= htmlReady($original_name) ?>">
</label>
<div>
<?= htmlReady(sprintf(_('Ursprünglicher Werkzeugname ist "%s".'), $metadata['displayname'] ?? '')) ?>
<?= htmlReady(sprintf(_('Ursprünglicher Werkzeugname ist "%s".'), $original_name)) ?>
</div>
</fieldset>
<div data-dialog-button>
<?= \Studip\Button::create(_('Speichern'))?>
<? if ($tool && $tool['metadata'] && $tool['metadata']['displayname']) : ?>
<? if (!empty($tool['metadata']['displayname'])) : ?>
<?= \Studip\Button::create(_('Namen löschen'), 'delete') ?>
<? endif ?>
</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