Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b9882bee

Von Moritz Bunkus vor etwa 17 Jahren hinzugefügt

  • ID b9882bee823f393f2071c790c1d73407c7d8ea51
  • Vorgänger 858ce394
  • Nachfolger 1a39394f

Umstellung der Vorlagen in templates/webpages/am von HTML::Template auf Template.

Unterschiede anzeigen:

bin/mozilla/amtemplates.pl
145 145

  
146 146
      push(@values,
147 147
           { "value"   => $file,
148
             "label"   => ref($setup) ? $setup->{"translation"} : $setup,
149
             "default" => $file eq $form->{"formname"} });
148
             "label"   => ref($setup) ? $setup->{"translation"} : $setup });
150 149
    }
151 150

  
152 151
    # "zahlungserinnerung" => $locale->text('Payment Reminder'),
......
155 154
      next if !$ref->{"template"};
156 155

  
157 156
      push(@values,
158
           { "value"   => $ref->{"template"},
159
             "label"   => $locale->text('Payment Reminder') . ": " . $ref->{"dunning_description"},
160
             "default" => $ref->{"template"} eq $form->{"formname"} });
157
           { "value" => $ref->{"template"},
158
             "label" => $locale->text('Payment Reminder') . ": " . $ref->{"dunning_description"} });
161 159
    }
162 160

  
163 161
    @values = sort({ $a->{"label"} cmp $b->{"label"} } @values);
164 162

  
165
    $options{"FORMNAME"} = [ @values ];
163
    $options{FORMNAME} = [ @values ];
166 164

  
167 165
    #
168 166
    # Setup "language" selection
169 167
    #
170 168

  
171
    @values = ( { "value" => "", "label" => "", "default" => 0 } );
169
    @values = ();
172 170

  
173 171
    foreach my $item (@{ $form->{"ALL_LANGUAGES"} }) {
174 172
      next unless ($item->{"template_code"});
175 173

  
176
      my $key = "$item->{id}--$item->{template_code}";
177

  
178 174
      push(@values,
179
           { "value"   => $key,
180
             "label"   => $item->{"description"},
181
             "default" => $key eq $form->{"language"} });
175
           { "value" => "$item->{id}--$item->{template_code}",
176
             "label" => $item->{"description"} });
182 177
    }
183 178

  
184
    $options{"LANGUAGE"} = [ @values ];
185
    $options{"SHOW_LANGUAGE"} = scalar(@values) > 1;
186

  
187
    @values = ( { "value" => "", "label" => "", "default" => 0 } );
179
    $options{LANGUAGE} = [ @values ];
188 180

  
189 181
    #
190 182
    # Setup "printer" selection
191 183
    #
192 184

  
185
    @values = ();
186

  
193 187
    foreach my $item (@{ $form->{"ALL_PRINTERS"} }) {
194 188
      next unless ($item->{"template_code"});
195 189

  
196
      my $key = "$item->{id}--$item->{template_code}";
197

  
198 190
      push(@values,
199
           { "value"   => $key,
200
             "label"   => $item->{"printer_description"},
201
             "default" => $key eq $form->{"printer"} });
191
           { "value" => "$item->{id}--$item->{template_code}",
192
             "label" => $item->{"printer_description"} });
202 193
    }
203 194

  
204
    $options{"PRINTER"} = [ @values ];
205
    $options{"SHOW_PRINTER"} = scalar(@values) > 1;
195
    $options{PRINTER} = [ @values ];
206 196

  
207 197
  } else {
208 198
    push(@hidden, qw(formname language printer));
......
231 221
  $options{"HIDDEN"} = [ map(+{ "name" => $_, "value" => $form->{$_} }, @hidden) ];
232 222

  
233 223
  $form->header;
234
  print($form->parse_html_template("am/edit_templates", \%options));
224
  print($form->parse_html_template2("am/edit_templates", \%options));
235 225

  
236 226
  $lxdebug->leave_sub();
237 227
}

Auch abrufbar als: Unified diff