1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
<?php
/**
* @var AvatarController $controller
* @var string $type
* @var string $id
* @var string $avatar
* @var bool $customized
* @var string $cancel_link
*/
?>
<form class="default settings-avatar" enctype="multipart/form-data"
action="<?= $controller->link_for('avatar/upload', $type, $id) ?>" method="post">
<fieldset>
<legend>
<?= $type == 'user' ? _('Profilbild bearbeiten und zuschneiden') :
($type == 'course' ? _('Veranstaltungsbild bearbeiten und zuschneiden') :
_('Einrichtungsbild bearbeiten und zuschneiden')) ?>
</legend>
<div class="form-group">
<div id="avatar-preview">
<img class="avatar-normal" id="new-avatar" src="<?= htmlReady($avatar) ?>"
data-message-too-small="<?= _('Das Bild ist kleiner als 250 x 250 Pixel. Wollen Sie wirklich fortfahren?') ?>">
</div>
<label class="file-upload">
<?= _('Wählen Sie ein Bild von Ihrer Festplatte aus.') ?>
<input type="file" id="avatar-upload" accept="image/gif,image/png,image/jpeg,image/webp"
capture="camera"
data-max-size="<?= Avatar::MAX_FILE_SIZE ?>"
data-message-too-large="<?= _('Die hochgeladene Datei ist zu groß. Bitte wählen Sie ein anderes Bild.') ?>">
<p class="form-text">
<?= sprintf(
_('Die Bilddatei darf max. %s groß sein, es sind nur Dateien mit den Endungen .jpg, .png, .gif und .webp erlaubt!'),
relsize(Avatar::MAX_FILE_SIZE)
) ?>
</p>
<a class="button" tabindex="0"><?= _('Auswählen') ?></a>
</label>
<input type="hidden" name="cropped-image" id="cropped-image" value="">
<div id="avatar-buttons" class="hidden-js">
<a href="" id="avatar-zoom-in" title="<?= _('Vergrößern') ?>">
<?= Icon::create('zoom-in')->asImg(24) ?>
<?= _('Vergrößern') ?>
</a>
<a href="" id="avatar-zoom-out" title="<?= _('Verkleinern') ?>">
<?= Icon::create('zoom-out')->asImg(24) ?>
<?= _('Verkleinern') ?>
</a>
<a href="" id="avatar-rotate-clockwise" title="<?= _('Nach rechts drehen') ?>">
<?= Icon::create('rotate-right')->asImg(24) ?>
<?= _('Nach rechts drehen') ?>
</a>
<a href="" id="avatar-rotate-counter-clockwise" title="<?= _('Nach links drehen') ?>">
<?= Icon::create('rotate-left')->asImg(24) ?>
<?= _('Nach links drehen') ?>
</a>
</div>
</div>
<?= CSRFProtection::tokenTag() ?>
</fieldset>
<footer data-dialog-button>
<?= Studip\Button::createAccept(_('Absenden'), 'upload', ['id' => 'submit-avatar']) ?>
<? if ($customized): ?>
<?= Studip\LinkButton::create(
_('Aktuelles Bild löschen'),
$controller->url_for('avatar/delete', $type, $id)
) ?>
<? endif ?>
<?= Studip\LinkButton::createCancel(_('Abbrechen'), $cancel_link) ?>
</footer>
</form>
|