Skip to content

Commit

Permalink
Merge pull request #2207 from ubtue/alysohor
Browse files Browse the repository at this point in the history
Upload Hinweis auf pdf #2133
  • Loading branch information
mtrojan-ub authored Jun 3, 2022
2 parents f76baec + 2834674 commit 82c4f59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ public function publishAction()
$collectionID = $collection->id;
}

if ($uploadedFile['type'] != "application/pdf") {
$uploadInfos[] = ["Invalid file type!: " . $uploadedFile['type'],"text-danger"];
$PDFMediaTypesArray = array('application/pdf', 'application/x-pdf', 'application/x-bzpdf', 'application-gzpdf');

if (!in_array($uploadedFile['type'], $PDFMediaTypesArray)) {
$uploadInfos[] = ["You can upload only PDF file!","text-danger"];
$uploadError = 1;
}

Expand Down
6 changes: 1 addition & 5 deletions themes/tuefind/templates/myresearch/publish.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
</div>
<?php endif;?>




<h3><?=$this->transEsc('Upload new publication');?></h3>

<h4><?=$this->transEsc('Publication title');?>: <?=$this->dublinCore['DC.title'][0]?> </h4>
Expand All @@ -39,10 +36,9 @@
</select>
</div>

<p class="text-center tf-m-0"><i><?=$this->transEsc('You can upload only PDF file');?></i></p>
<!-- File -->
<div class="form-group">
<label><?=$this->transEsc('file');?></label>
<label><?=$this->transEsc('file');?> (<i><?=$this->transEsc('You can upload only PDF file');?></i>)</label>
<input class="form-control" type="file" name="file" required>
</div>
<div>
Expand Down

0 comments on commit 82c4f59

Please sign in to comment.