Chat
FossilOrigin-Name: 7129d3c344032bab229fdc356df7522608a95af3696d92d22ec8f40d557c5734
This commit is contained in:
parent
a6d119833c
commit
19b19b900b
2 changed files with 63 additions and 1 deletions
35
perl/chat.pm
Normal file
35
perl/chat.pm
Normal file
|
@ -0,0 +1,35 @@
|
|||
package chat;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Exporter 'import';
|
||||
|
||||
our @EXPORTS = qw( content_chats );
|
||||
|
||||
use template_helpers 'to_template';
|
||||
|
||||
sub construct_chat
|
||||
{
|
||||
my ($ssn, $data, $chat) = @_;
|
||||
|
||||
my %vars = (
|
||||
prefix => '',
|
||||
ssn => $ssn,
|
||||
chat => $chat,
|
||||
);
|
||||
|
||||
to_template(\%vars, \$data->{'chat.tt'});
|
||||
}
|
||||
|
||||
sub content_chats
|
||||
{
|
||||
my ($ssn, $data, $chats) = @_;
|
||||
|
||||
my %vars = (
|
||||
prefix => '',
|
||||
ssn => $ssn,
|
||||
chats => $chats,
|
||||
);
|
||||
|
||||
to_template(\%vars, \$data->{'content_chats.tt'});
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ use strict;
|
|||
use warnings;
|
||||
use Exporter 'import';
|
||||
|
||||
our @EXPORTS = qw( content_search );
|
||||
our @EXPORTS = qw( content_search search_tags search_accounts search_statuses );
|
||||
|
||||
use template_helpers 'to_template';
|
||||
|
||||
|
@ -28,6 +28,33 @@ sub search_page
|
|||
to_template(\%vars, \$data->{'search.tt'});
|
||||
}
|
||||
|
||||
sub search_tags
|
||||
{
|
||||
my ($ssn, $data, $tags) = @_;
|
||||
|
||||
my %vars = (
|
||||
prefix => '',
|
||||
ssn => $ssn,
|
||||
statuses => $statuses,
|
||||
);
|
||||
|
||||
search_page($ssn, $data, SEARCH_CAT_STATUSES, to_template(\%vars, \$data->{'search_tags.tt'}));
|
||||
}
|
||||
|
||||
sub search_accounts
|
||||
{
|
||||
my ($ssn, $data, $statuses) = @_;
|
||||
|
||||
my %vars = (
|
||||
prefix => '',
|
||||
ssn => $ssn,
|
||||
statuses => $statuses,
|
||||
);
|
||||
|
||||
search_page($ssn, $data, SEARCH_CAT_STATUSES, to_template(\%vars, \$data->{'search_accounts.tt'}));
|
||||
}
|
||||
|
||||
|
||||
sub search_statuses
|
||||
{
|
||||
my ($ssn, $data, $statuses) = @_;
|
||||
|
|
Loading…
Reference in a new issue