Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK!> # # COPYRIGHT # Copyright (C) 1996-2022 Andy Wardley. All Rights Reserved. # # This module is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # #============================================================================ package Template::Plugin::Datafile; use strict; use warnings; use base 'Template::Plugin'; our $VERSION = '3.106'; sub new { my ($class, $context, $filename, $params) = @_; my ($delim, $encoding, $line, @fields, @data, @results); my $self = [ ]; local *FD; local $/ = "\n"; $params ||= { }; $delim = $params->{'delim'} || ':'; $delim = quotemeta($delim); $encoding = defined $params->{'encoding'} ? ':encoding('.$params->{'encoding'}.')' : ''; return $class->error("No filename specified") unless $filename; open(FD, '<'.$encoding, $filename) || return $class->error("$filename: $!"); # first line of file should contain field definitions while (! $line || $line =~ /^#/) { $line = ; last unless defined $line; chomp $line; $line =~ s/\r$//; } return $class->error("first line of file must contain field names") unless defined $line; (@fields = split(/\s*$delim\s*/, $line)) || return $class->error("first line of file must contain field names"); # read each line of the file while () { chomp; s/\r$//; # ignore comments and blank lines next if /^#/ || /^\s*$/; # split line into fields @data = split(/\s*$delim\s*/); # create hash record to represent data my %record; @record{ @fields } = @data; push(@$self, \%record); } # return $self; bless $self, $class; } sub as_list { return $_[0]; } 1; __END__ =head1 NAME Template::Plugin::Datafile - Plugin to construct records from a simple data file =head1 SYNOPSIS [% USE mydata = datafile('/path/to/datafile') %] [% USE mydata = datafile('/path/to/datafile', delim = '|') %] [% USE mydata = datafile('/path/to/datafile', encoding = 'UTF-8') %] [% FOREACH record = mydata %] [% record.this %] [% record.that %] [% END %] =head1 DESCRIPTION This plugin provides a simple facility to construct a list of hash references, each of which represents a data record of known structure, from a data file. [% USE datafile(filename) %] A absolute filename must be specified (for this initial implementation at least - in a future version it might also use the C). An optional C parameter may also be provided to specify an alternate delimiter character. The optional C parameter may be used to specify the input file encoding. [% USE userlist = datafile('/path/to/file/users') %] [% USE things = datafile('items', delim = '|') %] The format of the file is intentionally simple. The first line defines the field names, delimited by colons with optional surrounding whitespace. Subsequent lines then defines records containing data items, also delimited by colons. e.g. id : name : email : tel abw : Andy Wardley : abw@tt2.org : 555-1234 sam : Simon Matthews : sam@tt2.org : 555-9876 Each line is read, split into composite fields, and then used to initialise a hash array containing the field names as relevant keys. The plugin returns a blessed list reference containing the hash references in the order as defined in the file. [% FOREACH user = userlist %] [% user.id %]: [% user.name %] [% END %] The first line of the file B contain the field definitions. After the first line, blank lines will be ignored, along with comment line which start with a 'C<#>'. =head1 BUGS Should handle file names relative to C. Doesn't permit use of 'C<:>' in a field. Some escaping mechanism is required. =head1 AUTHOR Andy Wardley Eabw@wardley.orgE L =head1 COPYRIGHT Copyright (C) 1996-2022 Andy Wardley. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L =cut # Local Variables: # mode: perl # perl-indent-level: 4 # indent-tabs-mode: nil # End: # # vim: expandtab shiftwidth=4: PK!;++File.pmnu6$#============================================================= -*-Perl-*- # # Template::Plugin::File # # DESCRIPTION # Plugin for encapsulating information about a system file. # # AUTHOR # Originally written by Michael Stevens as the # Directory plugin, then mutilated by Andy Wardley # into separate File and Directory plugins, with some additional # code for working with views, etc. # # COPYRIGHT # Copyright 2000-2022 Michael Stevens, Andy Wardley. # # This module is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # #============================================================================ package Template::Plugin::File; use strict; use warnings; use Cwd; use File::Spec; use File::Basename; use base 'Template::Plugin'; our $VERSION = '3.106'; our @STAT_KEYS = qw( dev ino mode nlink uid gid rdev size atime mtime ctime blksize blocks ); #------------------------------------------------------------------------ # new($context, $file, \%config) # # Create a new File object. Takes the pathname of the file as # the argument following the context and an optional # hash reference of configuration parameters. #------------------------------------------------------------------------ sub new { my $config = ref($_[-1]) eq 'HASH' ? pop(@_) : { }; my ($class, $context, $path) = @_; my ($root, $home, @stat, $abs); return $class->throw('no file specified') unless defined $path and length $path; # path, dir, name, root, home if (File::Spec->file_name_is_absolute($path)) { $root = ''; } elsif (($root = $config->{ root })) { # strip any trailing '/' from root $root =~ s[/$][]; } else { $root = ''; } my ($name, $dir, $ext) = fileparse($path, '\.\w+'); # fixup various items $dir =~ s[/$][]; $dir = '' if $dir eq '.'; $name = $name . $ext; $ext =~ s/^\.//g; my @fields = File::Spec->splitdir($dir); shift @fields if @fields && ! length $fields[0]; $home = join('/', ('..') x @fields); $abs = File::Spec->catfile($root ? $root : (), $path); my $self = { path => $path, name => $name, root => $root, home => $home, dir => $dir, ext => $ext, abs => $abs, user => '', group => '', isdir => '', stat => defined $config->{ stat } ? $config->{ stat } : ! $config->{ nostat }, map { ($_ => '') } @STAT_KEYS, }; if ($self->{ stat }) { (@stat = stat( $abs )) || return $class->throw("$abs: $!"); @$self{ @STAT_KEYS } = @stat; unless ($config->{ noid }) { $self->{ user } = eval { getpwuid( $self->{ uid }) || $self->{ uid } }; $self->{ group } = eval { getgrgid( $self->{ gid }) || $self->{ gid } }; } $self->{ isdir } = -d $abs; } bless $self, $class; } #------------------------------------------------------------------------- # rel($file) # # Generate a relative filename for some other file relative to this one. #------------------------------------------------------------------------ sub rel { my ($self, $path) = @_; $path = $path->{ path } if ref $path eq ref $self; # assumes same root return $path if $path =~ m[^/]; return $path unless $self->{ home }; return $self->{ home } . '/' . $path; } #------------------------------------------------------------------------ # present($view) # # Present self to a Template::View. #------------------------------------------------------------------------ sub present { my ($self, $view) = @_; $view->view_file($self); } sub throw { my ($self, $error) = @_; die (Template::Exception->new('File', $error)); } 1; __END__ =head1 NAME Template::Plugin::File - Plugin providing information about files =head1 SYNOPSIS [% USE File(filepath) %] [% File.path %] # full path [% File.name %] # filename [% File.dir %] # directory =head1 DESCRIPTION This plugin provides an abstraction of a file. It can be used to fetch details about files from the file system, or to represent abstract files (e.g. when creating an index page) that may or may not exist on a file system. A file name or path should be specified as a constructor argument. e.g. [% USE File('foo.html') %] [% USE File('foo/bar/baz.html') %] [% USE File('/foo/bar/baz.html') %] The file should exist on the current file system (unless C option set, see below) as an absolute file when specified with as leading 'C' as per 'C', or otherwise as one relative to the current working directory. The constructor performs a C on the file and makes the 13 elements returned available as the plugin items: dev ino mode nlink uid gid rdev size atime mtime ctime blksize blocks e.g. [% USE File('/foo/bar/baz.html') %] [% File.mtime %] [% File.mode %] ... In addition, the C and C items are set to contain the user and group names as returned by calls to C and C for the file C and C elements, respectively. On Win32 platforms on which C and C are not available, these values are undefined. [% USE File('/tmp/foo.html') %] [% File.uid %] # e.g. 500 [% File.user %] # e.g. abw This user/group lookup can be disabled by setting the C option. [% USE File('/tmp/foo.html', noid=1) %] [% File.uid %] # e.g. 500 [% File.user %] # nothing The C flag will be set if the file is a directory. [% USE File('/tmp') %] [% File.isdir %] # 1 If the C on the file fails (e.g. file doesn't exists, bad permission, etc) then the constructor will throw a C exception. This can be caught within a C block. [% TRY %] [% USE File('/tmp/myfile') %] File exists! [% CATCH File %] File error: [% error.info %] [% END %] Note the capitalisation of the exception type, 'C', to indicate an error thrown by the C plugin, to distinguish it from a regular C exception thrown by the Template Toolkit. Note that the C plugin can also be referenced by the lower case name 'C'. However, exceptions are always thrown of the C type, regardless of the capitalisation of the plugin named used. [% USE file('foo.html') %] [% file.mtime %] As with any other Template Toolkit plugin, an alternate name can be specified for the object created. [% USE foo = file('foo.html') %] [% foo.mtime %] The C option can be specified to prevent the plugin constructor from performing a C on the file specified. In this case, the file does not have to exist in the file system, no attempt will be made to verify that it does, and no error will be thrown if it doesn't. The entries for the items usually returned by C will be set empty. [% USE file('/some/where/over/the/rainbow.html', nostat=1) [% file.mtime %] # nothing =head1 METHODS All C plugins, regardless of the C option, have set a number of items relating to the original path specified. =head2 path The full, original file path specified to the constructor. [% USE file('/foo/bar.html') %] [% file.path %] # /foo/bar.html =head2 name The name of the file without any leading directories. [% USE file('/foo/bar.html') %] [% file.name %] # bar.html =head2 dir The directory element of the path with the filename removed. [% USE file('/foo/bar.html') %] [% file.name %] # /foo =head2 ext The file extension, if any, appearing at the end of the path following a 'C<.>' (not included in the extension). [% USE file('/foo/bar.html') %] [% file.ext %] # html =head2 home This contains a string of the form 'C<../..>' to represent the upward path from a file to its root directory. [% USE file('bar.html') %] [% file.home %] # nothing [% USE file('foo/bar.html') %] [% file.home %] # .. [% USE file('foo/bar/baz.html') %] [% file.home %] # ../.. =head2 root The C item can be specified as a constructor argument, indicating a root directory in which the named file resides. This is otherwise set empty. [% USE file('foo/bar.html', root='/tmp') %] [% file.root %] # /tmp =head2 abs This returns the absolute file path by constructing a path from the C and C options. [% USE file('foo/bar.html', root='/tmp') %] [% file.path %] # foo/bar.html [% file.root %] # /tmp [% file.abs %] # /tmp/foo/bar.html =head2 rel(path) This returns a relative path from the current file to another path specified as an argument. It is constructed by appending the path to the 'C' item. [% USE file('foo/bar/baz.html') %] [% file.rel('wiz/waz.html') %] # ../../wiz/waz.html =head1 EXAMPLES [% USE file('/foo/bar/baz.html') %] [% file.path %] # /foo/bar/baz.html [% file.dir %] # /foo/bar [% file.name %] # baz.html [% file.home %] # ../.. [% file.root %] # '' [% file.abs %] # /foo/bar/baz.html [% file.ext %] # html [% file.mtime %] # 987654321 [% file.atime %] # 987654321 [% file.uid %] # 500 [% file.user %] # abw [% USE file('foo.html') %] [% file.path %] # foo.html [% file.dir %] # '' [% file.name %] # foo.html [% file.root %] # '' [% file.home %] # '' [% file.abs %] # foo.html [% USE file('foo/bar/baz.html') %] [% file.path %] # foo/bar/baz.html [% file.dir %] # foo/bar [% file.name %] # baz.html [% file.root %] # '' [% file.home %] # ../.. [% file.abs %] # foo/bar/baz.html [% USE file('foo/bar/baz.html', root='/tmp') %] [% file.path %] # foo/bar/baz.html [% file.dir %] # foo/bar [% file.name %] # baz.html [% file.root %] # /tmp [% file.home %] # ../.. [% file.abs %] # /tmp/foo/bar/baz.html # calculate other file paths relative to this file and its root [% USE file('foo/bar/baz.html', root => '/tmp/tt2') %] [% file.path('baz/qux.html') %] # ../../baz/qux.html [% file.dir('wiz/woz.html') %] # ../../wiz/woz.html =head1 AUTHORS Michael Stevens wrote the original C plugin on which this is based. Andy Wardley split it into separate C and C plugins, added some extra code and documentation for C support, and made a few other minor tweaks. =head1 COPYRIGHT Copyright 2000-2022 Michael Stevens, Andy Wardley. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L, L, L PK!; List.pmnu6$#============================================================= -*-Perl-*- # # Template::Plugin::List # # DESCRIPTION # Template Toolkit plugin to implement an OO List object. # (work in progress) # # AUTHOR # Andy Wardley # # COPYRIGHT # Copyright (C) 2001-2022 Andy Wardley. All Rights Reserved. # # This module is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # #============================================================================ package Template::Plugin::List; use strict; use warnings; use base 'Template::Plugin'; use Template::Exception; use overload q|""| => "text", fallback => 1; our $VERSION = '3.106'; our $ERROR = ''; local $" = ', '; #------------------------------------------------------------------------ sub new { my ($class, @args) = @_; my $context = ref $class ? undef : CORE::shift(@args); my $config = @args && ref $args[-1] eq 'HASH' ? CORE::pop(@args) : { }; $class = ref($class) || $class; my $list = defined $config->{ list } ? $config->{ list } : (scalar @args == 1 && ref $args[0] eq 'ARRAY' ? CORE::shift(@args) : [ @args ] ); my $joint = defined $config->{ joint } ? $config->{ joint } : $config->{ join } ? $config->{ join } : ', '; bless { list => $list, joint => $joint, _CONTEXT => $context, }, $class; } sub list { return $_[0]->{ list }; } sub item { $_[0]->{ list }->[ $_[1] || 0 ]; } sub hash { ### not sure about this one ### my $self = shift; my $n = 0; return { map { ($n++, $_) } @{ $self->{ list } } }; } sub text { my $self = CORE::shift; return CORE::join($self->{ joint }, @{ $self->{ list } }); } sub copy { my $self = CORE::shift; $self->new([ @{ $self->{ list } } ]); } sub throw { my $self = CORE::shift; die (Template::Exception->new('List', CORE::join('', @_))); } #------------------------------------------------------------------------ sub push { my $self = CORE::shift; CORE::push(@{ $self->{ list } }, @_); return $self; } sub unshift { my $self = CORE::shift; CORE::unshift(@{ $self->{ list } }, @_); return $self; } sub pop { my $self = CORE::shift; CORE::pop(@{ $self->{ list } }); return $self; } sub shift { my $self = CORE::shift; CORE::shift(@{ $self->{ list } }); return $self; } sub max { local $^W = 0; my $list = $_[0]->{ list }; return $#$list; } sub size { local $^W = 0; my $list = $_[0]->{ list }; return $#$list + 1; } 1; __END__ PK!^!paa Procedural.pmnu6$#============================================================================== # # Template::Plugin::Procedural # # DESCRIPTION # A Template Plugin to provide a Template Interface to Data::Dumper # # AUTHOR # Mark Fowler # # COPYRIGHT # Copyright (C) 2002 Mark Fowler. All Rights Reserved # # This module is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # #============================================================================== package Template::Plugin::Procedural; use strict; use warnings; use base 'Template::Plugin'; our $VERSION = '3.106'; our $DEBUG = 0 unless defined $DEBUG; our $AUTOLOAD; #------------------------------------------------------------------------ # load #------------------------------------------------------------------------ sub load { my ($class, $context) = @_; # create a proxy namespace that will be used for objects my $proxy = "Template::Plugin::" . $class; # okay, in our proxy create the autoload routine that will # call the right method in the real class no strict "refs"; unless( defined( *{ $proxy . "::AUTOLOAD" } ) ) { *{ $proxy . "::AUTOLOAD" } = sub { # work out what the method is called $AUTOLOAD =~ s!^.*::!!; print STDERR "Calling '$AUTOLOAD' in '$class'\n" if $DEBUG; # look up the sub for that method (but in a OO way) my $uboat = $class->can($AUTOLOAD); # if it existed call it as a subroutine, not as a method if ($uboat) { shift @_; return $uboat->(@_); } print STDERR "Eeek, no such method '$AUTOLOAD'\n" if $DEBUG; return ""; }; } # create a simple new method that simply returns a blessed # scalar as the object. unless( defined( *{ $proxy . "::new" } ) ) { *{ $proxy . "::new" } = sub { my $this; return bless \$this, $_[0]; }; } return $proxy; } 1; __END__ =head1 NAME Template::Plugin::Procedural - Base class for procedural plugins =head1 SYNOPSIS package Template::Plugin::LWPSimple; use base qw(Template::Plugin::Procedural); use LWP::Simple; # exports 'get' 1; [% USE LWPSimple %] [% LWPSimple.get("http://www.tt2.org/") %] =head1 DESCRIPTION C is a base class for Template Toolkit plugins that causes defined subroutines to be called directly rather than as a method. Essentially this means that subroutines will not receive the class name or object as its first argument. This is most useful when creating plugins for modules that normally work by exporting subroutines that do not expect such additional arguments. Despite the fact that subroutines will not be called in an OO manner, inheritance still function as normal. A class that uses C can be subclassed and both subroutines defined in the subclass and subroutines defined in the original class will be available to the Template Toolkit and will be called without the class/object argument. =head1 AUTHOR Mark Fowler Emark@twoshortplanks.comE L =head1 COPYRIGHT Copyright (C) 2002 Mark Fowler Emark@twoshortplanks.comE This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L