Skip to content

Instantly share code, notes, and snippets.

sub _hdlr_entry_body_has_width {
my($ctx, $args, $cond) = @_;
return 0 if ( ! $ctx->stash('entry') );
unless( $args->{'width'} ) {
## tut nado chto-to sdelat s soobsheniem - ono ne sootwetstvuet logike
&MT::log('Unexpected parameter width for tag <MTIfEntryBodyHasWidth>');
return 0;
}
use File::Find;
use File::Copy;
use Cwd;
my $workdir = getcwd;
find(sub {
return if -d;
return if -l;
return if /^\./;
use File::Find;
use File::Copy;
use Cwd;
use File::Path qw(make_path);
my $workdir = getcwd;
find(sub {
return if -d;
return if -l;
#!perl
package Gate;
use Data::Dumper;
use warnings;
use Carp;
sub new {
my $self = bless {}, 'Gate';
use v6;
grammar JSON::Tiny::Grammar;
rule TOP { ^[ <object> | <array> ]$ }
rule object { '{' ~ '}' <pairlist> }
rule pairlist { [ <pair> ** [ \, ] ]? }
rule pair { <string> ':' <value> }
rule array { '[' ~ ']' [ <value> ** [ \, ] ]? }
proto token value { <...> };
class StompClient extends Stomp
{
var $config;
var $server;
var $failover_servers;
public function __construct() {
global $HP;
$config_string = file_get_contents($HP['topdir']."/conf/activemq.json");
#!perl
use strict;
use warnings;
use DateTime;
use Data::Dumper;
use DateTime::Format::Strptime;
my $p = DateTime::Format::Strptime->new(pattern => '%F %T',
time_zone => 'local');
# Routes
my $r = $self->routes;
$r->route('/intra/login')->via('get')->to('auth#login')->name('login');
$r->route('/intra/login')->via('post')->to('auth#login_post')->name('post_login');
$r->route('/intra/logout')->via('get')->to('auth#logout')->name('logout');
my $auth = $r->bridge('/intra')->to('auth#check_auth');
$auth->route('/main')->to('main#index')->name('main');
% layout 'default', page_title=>'Администрирование';
<%= include 'admin/menu', active => 'reports' %>
<h2>Список отчетов</h2>
<% for my $report ( @$reports ) { %>
<h3> <%= $report->{name} %> </h3>
<% } %>
<a href="<%= url_for 'add_report' %>">Добавить отчет</a>
my $users_sth = $self->app->dbh->prepare("SELECT
u.fullname, tu.user_type
FROM
report_template_users tu
JOIN
users u
ON tu.user_id = u.id
WHERE report_template_id = ?");
$users_sth->execute($row->{id});
my @users;