restruc
This commit is contained in:
@@ -12,40 +12,44 @@ use DBI;
|
||||
use Dojo::Conf;
|
||||
|
||||
sub new { bless {}, shift };
|
||||
my $data_path = path('lib/Dojo/Model/Data')->make_path;
|
||||
#just for fun
|
||||
|
||||
# Read vdg user ===============================================================
|
||||
sub mod{
|
||||
my $q="select nombre,contenido from casa;";
|
||||
my %h=map{ $_->{nombre} => $_->{contenido}}@{_read($q)};
|
||||
return %h;
|
||||
}
|
||||
# mensaje del día:mod,rmod,yt,fb,sc
|
||||
sub mod{
|
||||
my $q="select nombre,contenido from casa;";
|
||||
my %h=map{ $_->{nombre} => $_->{contenido}}@{_read($q)};
|
||||
return %h;
|
||||
}
|
||||
|
||||
sub md_to_hash{
|
||||
my ($self,@filelist)=@_;
|
||||
return {map { basename($_,".md") => load_md("public/$_")}@filelist};
|
||||
}
|
||||
sub pang_md{
|
||||
my $c=shift;
|
||||
my %h = map {$_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp))}
|
||||
("pang","helen","benjamin");
|
||||
return \%h;
|
||||
}
|
||||
|
||||
sub calendar_monthblock {
|
||||
return _read (path("public/home/cal/q1Block.q")->slurp);
|
||||
}
|
||||
sub calendar_events {
|
||||
return _read (path("public/home/cal/q3Event.q")->slurp);
|
||||
}
|
||||
sub calendar_monthblock {
|
||||
return _read ($data_path->child("cal/q1Block.q")->slurp);
|
||||
}
|
||||
sub calendar_events {
|
||||
return _read ($data_path->child("cal/q3Event.q")->slurp);
|
||||
}
|
||||
|
||||
sub event{
|
||||
my ($self,$id)=@_;
|
||||
return shift @{ _read (path("public/home/event/qEvent.q")->slurp,$id)};
|
||||
}
|
||||
sub store{
|
||||
return _read (path("public/home/store/qStore.q")->slurp);
|
||||
}
|
||||
sub tv_videos{
|
||||
return _read (path("public/home/tv/qSeries.q")->slurp); #group,name
|
||||
}
|
||||
sub tv_series{
|
||||
return _read (path("public/home/tv/qTable.q")->slurp); #name,order,group
|
||||
}
|
||||
sub event{
|
||||
my ($c,$id)=@_;
|
||||
return shift @{ _read ($data_path->child("event/qEvent.q")->slurp,$id)};
|
||||
}
|
||||
sub store{
|
||||
return _read ($data_path->child("/store/qStore.q")->slurp);
|
||||
}
|
||||
sub tv_videos{
|
||||
return _read ($data_path->child("/tv/qSeries.q")->slurp); #group,name
|
||||
}
|
||||
sub tv_series{
|
||||
return _read ($data_path->child("/tv/qTable.q")->slurp); #name,order,group
|
||||
}
|
||||
sub podcast_txt{
|
||||
# return "Hemos desarrollado con mucho cariño ejercicios gratuitos y descargables que pueden ser practicados por cualquier persona aún antes de asistir a uno de los cursos de instrucción.";
|
||||
return decode_utf8(path("public/home/podcast/text.txt")->slurp);
|
||||
@@ -90,13 +94,13 @@ sub new { bless {}, shift };
|
||||
sub eimgList{ return [get_names("public/home/cal/img/")] }
|
||||
#==============================================================================
|
||||
# Write vdg user ==============================================================
|
||||
sub contact{
|
||||
my $c=shift;
|
||||
my $q="insert into entrada (nombre,correo,pagina,texto,fecha) values(?,?,?,?,now() )" ;
|
||||
my @a=@_;
|
||||
#simple method to ignore spam
|
||||
return _writemsg($q,@a) unless $a[3]=~m/http|website|\<a/;
|
||||
return 0;
|
||||
sub contact{
|
||||
my $c=shift;
|
||||
my $q="insert into entrada (nombre,correo,pagina,texto,fecha) values(?,?,?,?,now() )" ;
|
||||
my @a=@_;
|
||||
#simple method to ignore spam
|
||||
return _writemsg($q,@a) unless $a[3]=~m/http|website|\<a/;
|
||||
return 0;
|
||||
}
|
||||
#==============================================================================
|
||||
# Write vdg admin ==============================================================
|
||||
|
||||
Reference in New Issue
Block a user