Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 45ea86a9

Von Werner Hahn vor mehr als 8 Jahren hinzugefügt

  • ID 45ea86a92fbad522a1f28233b8688977b1dedaea
  • Vorgänger a2a746b0
  • Nachfolger a42d9378

mend

Unterschiede anzeigen:

SL/Controller/ShopPart.pm
70 70
  my ($self, %params) = @_;
71 71

  
72 72
  my $attributes                   = $::form->{ $::form->{form_prefix} } || die "Missing attributes";
73
  $main::lxdebug->dump(0, 'WH: ATTRIBUTES: ', \$attributes);
74

  
73 75
  $attributes->{filename} = ((($::form->{ATTACHMENTS} || {})->{ $::form->{form_prefix} } || {})->{file_content} || {})->{filename};
74 76

  
75 77
  my @errors;
......
103 105
  }
104 106

  
105 107
  my @errors;
108
  my @type_error = SL::Controller::FileUploader->validate_filetype($attributes->{filename},$::form->{aft});
109
  push @errors,@type_error if @type_error;
106 110
  $self->file->assign_attributes(%{ $attributes });
107 111
  my @file_errors = $self->file->validate if $attributes->{file_content};;
108 112
  push @errors,@file_errors if @file_errors;
109 113

  
110
  my @type_error = SL::Controller::FileUploader->validate_filetype($attributes->{filename},$::form->{aft});
111
  push @errors,@type_error if @type_error;
112 114

  
113 115
  return $self->js->error(@errors)->render($self) if @errors;
114 116

  
SL/DB/Helper/ThumbnailCreator.pm
2 2

  
3 3
use strict;
4 4

  
5
use parent qw(SL::Controller::Base);
6

  
7
use SL::Locale::String qw(t8);
5 8
use Carp;
6 9
use GD;
7 10
use Image::Info;
templates/webpages/common/file_upload.html
1 1
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE JavaScript -%][% USE Base64 %]
2 2
[% SET style="width: 500px" %]
3
[% SET id_base_bak = "fileupload" %]
4
[% SET id_base = 'fileupload_' _ (SELF.file.id ? SELF.file.id : 'new') %]
5
[%  L.dump(data) %]
3
[% SET id_base_bak  = "fileupload" %]
4
[% SET id_base      = 'fileupload_' _ (SELF.file.id ? SELF.file.id : 'new') %]
5
[% SET trans_id     = SELF.file.id ? SELF.file.trans_id : data.trans_id %]
6
[% SET modul        = SELF.file.id ? SELF.file.modul : data.modul %]
7

  
6 8
<form method="post" id="fileupload_form" method="POST" enctype="multipart/form-data">
7
 [% L.hidden_tag('form_prefix',                    id_base,         id=id_base _ '_form_prefix') %]
8
 [% L.hidden_tag(id_base _ '.id',                             SELF.file.id, no_id=1) %]
9
 [% L.hidden_tag(id_base _ '.trans_id',                       SELF.file.trans_id) %]
10
 [% L.hidden_tag(id_base _ '.modul',                          SELF.file.modul) %]
9
 [% L.hidden_tag('form_prefix',                    id_base,      id=id_base _ '_form_prefix') %]
10
 [% L.hidden_tag(id_base _ '.id',                  SELF.file.id, no_id=1) %]
11
 [% L.hidden_tag(id_base _ '.trans_id',            trans_id) %]
12
 [% L.hidden_tag(id_base _ '.modul',               modul) %]
11 13
 [% L.hidden_tag('aft',                            data.aft) %]
12 14

  
13 15
 <h2>
......
39 41
[% IF SELF.file.file_content %]
40 42
  <tr>
41 43
   <th align="right">[%- LxERP.t8("File name") %]:</th>
42
   <td>[% HTML.escape(SELF.file.filename) %][% L.hidden_tag(id_base _ '.filename', SELF.file.filename) %][% L.hidden_tag('id',                             SELF.file.id, no_id=1) %]</td>
44
   <td>[% HTML.escape(SELF.file.filename) %][% L.hidden_tag(id_base _ '.filename', SELF.file.filename) %][% L.hidden_tag('id', SELF.file.id, no_id=1) %]</td>
43 45
  </tr>
44 46

  
45 47
  <tr>

Auch abrufbar als: Unified diff