return $mime_types{$_[0]} || $_[1] || 'text/html';
}
-our (@fatal_errors, @errors, @debug, @msgs, @hints, @notes);
+our (@fatal_errors, @errors, @debug, @hints);
our $http_code;
sub reset {
- @fatal_errors = @errors = @debug = @msgs = @hints = @notes = ();
+ @fatal_errors = @errors = @debug = @hints = ();
$http_code = 200;
}
my $lvl = $_[1] || 0;
push(@debug, $_[0]) if $debug > $lvl;
}
-sub msg {
- push @msgs, $_[0];
-}
-sub note {
- push @notes, [ @_ ];
-}
sub get_errors { (@fatal_errors, @errors) }
sub get_debug {
return unless $debug && @debug;
return @debug;
}
-sub get_msgs { @msgs };
sub get_hints { @hints };
-sub get_notes { @notes };
sub get_all_messages {
return {
errors => [ @fatal_errors, @errors ],
debugs => $debug ? \@debug : [],
- msgs => \@msgs,
hints => \@hints,
- notes => \@notes,
};
}
use Packages::Config qw( $DBDIR @SUITES @ARCHIVES @SECTIONS
@ARCHITECTURES %FTP_SITES @DDTP_LANGUAGES);
use Packages::I18N::Locale;
-use Packages::CGI qw( :DEFAULT make_url make_search_url note );
+use Packages::CGI qw( :DEFAULT make_url make_search_url );
use Packages::DB;
use Packages::Search qw( :all );
use Packages::Page ();
<p>[% hint | html %]</p>
[% '</div>' IF loop.last -%]
[% END -%]
-[%- FOREACH msg IN msgs %]
-[%- '<div class="pmsgs">' IF loop.first %]
- <p>[% msg | html %]</p>
-[% '</div>' IF loop.last -%]
-[% END -%]
-[%- FOREACH note IN notes %]
-[%- '<div class="pnotes">' IF loop.first %]
-[%- IF note.1 %]
- <h2>[% note.0 | html %]</h2>
- <p>[% note.1 | html %]</p>
-[% ELSE %]
- <p>[% note.0 | html %]</p>
-[% END -%]
-[% '</div>' IF loop.last -%]
-[% END -%]