Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ee51b82f

Von Tamino Steinert vor etwa 2 Jahren hinzugefügt

  • ID ee51b82f6206a33d436cb453ebe835d6fbbb4c2c
  • Vorgänger a0a10e44
  • Nachfolger 84dfd7a5

Presenter: nutze link_tag anstelle von html im perl-code

(cherry picked aus Kundenprojekt)

Unterschiede anzeigen:

SL/Presenter/EmailJournal.pm
3 3
use strict;
4 4

  
5 5
use SL::Presenter::EscapedText qw(escape is_escaped);
6
use SL::Presenter::Tag         qw(link_tag);
6 7

  
7 8
use Exporter qw(import);
8 9
our @EXPORT_OK = qw(email_journal);
......
16 17

  
17 18
  croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
18 19

  
19
  my $text = join '', (
20
    $params{no_link} ? '' : '<a href="controller.pl?action=EmailJournal/show&amp;id=' . escape($email_journal_entry->id) . '">',
21
    escape($email_journal_entry->subject),
22
    $params{no_link} ? '' : '</a>',
23
  );
20
  my $text = escape($email_journal_entry->subject);
21
  if (! delete $params{no_link}) {
22
    my $href = 'controller.pl?action=EmailJournal/show'
23
               . '&id=' . escape($email_journal_entry->id);
24
    $text = link_tag($href, $text, %params);
25
  }
24 26

  
25 27
  is_escaped($text);
26 28
}
......
57 59
L<SL::Presenter::EscapedText>) of the email journal object C<$object>
58 60
.
59 61

  
60

  
61
C<%params> can include:
62
Remaining C<%params> are passed to the function
63
C<SL::Presenter::Tag::link_tag>. It can include:
62 64

  
63 65
=over 2
64 66

  
65 67
=item * display
66 68

  
67
Either C<inline> (the default) or C<table-cell>. At the moment both
68
representations are identical and produce the invoice number linked
69
to the corresponding 'edit' action.
69
Either C<inline> (the default) or C<table-cell>. Is passed to the function C<SL::Presenter::Tag::link_tag>.
70 70

  
71 71
=item * no_link
72 72

  

Auch abrufbar als: Unified diff