|
|
@ -46,6 +46,9 @@ sub _content_load { |
|
|
|
sub create { |
|
|
|
sub create { |
|
|
|
my ($self) = @_; |
|
|
|
my ($self) = @_; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$self->access_allowed($self->app->config->{zerobin}->{access}) |
|
|
|
|
|
|
|
or return; |
|
|
|
|
|
|
|
|
|
|
|
my @syntax = ($self->c(text => ['plaintext', 'markdown'])); |
|
|
|
my @syntax = ($self->c(text => ['plaintext', 'markdown'])); |
|
|
|
my $langs = $self->app->config->{zerobin}->{syntax}; |
|
|
|
my $langs = $self->app->config->{zerobin}->{syntax}; |
|
|
|
push @syntax, $self->c(code => $langs) |
|
|
|
push @syntax, $self->c(code => $langs) |
|
|
@ -79,6 +82,9 @@ sub view { |
|
|
|
sub save { |
|
|
|
sub save { |
|
|
|
my ($self) = @_; |
|
|
|
my ($self) = @_; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$self->access_allowed($self->app->config->{zerobin}->{access}) |
|
|
|
|
|
|
|
or return; |
|
|
|
|
|
|
|
|
|
|
|
eval { |
|
|
|
eval { |
|
|
|
my $source = $self->req->param('source') || '-'; |
|
|
|
my $source = $self->req->param('source') || '-'; |
|
|
|
my $expire = $self->req->param('expire') || 30; # 30 days or 1 month |
|
|
|
my $expire = $self->req->param('expire') || 30; # 30 days or 1 month |
|
|
|