WebGUI 3.1.0 release
This commit is contained in:
parent
d1c1445ea1
commit
71cd27d3bc
56 changed files with 2025 additions and 238 deletions
|
|
@ -24,7 +24,8 @@ sub _recurseCrumbTrail {
|
|||
$output .= _recurseCrumbTrail($data{parentId});
|
||||
}
|
||||
if ($data{title} ne "") {
|
||||
$output .= '<a class="crumbTrail" href="'.$session{env}{SCRIPT_NAME}.'/'.$data{urlizedTitle}.'">'.$data{title}.'</a> > ';
|
||||
$output .= '<a class="crumbTrail" href="'.$session{config}{scripturl}.
|
||||
'/'.$data{urlizedTitle}.'">'.$data{title}.'</a> > ';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
|
|||
38
lib/WebGUI/Macro/Execute.pm
Normal file
38
lib/WebGUI/Macro/Execute.pm
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package WebGUI::Macro::Execute;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Macro;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _replacement {
|
||||
my (@param, $temp);
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /WebGUI.conf/) {
|
||||
$temp = "SECURITY VIOLATION";
|
||||
} else {
|
||||
$temp = "<pre>".`$param[0]`."</pre>";
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^Execute\((.*?)\)\;/_replacement($1)/ge;
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
@ -35,7 +35,8 @@ sub _reversePageTree {
|
|||
if ($_[1] == $data[0]) {
|
||||
$output .= '<span class="selectedMenuItem">';
|
||||
}
|
||||
$output .= '<a class="verticalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[3].'">'.$data[2].'</a><br>';
|
||||
$output .= '<a class="verticalMenu" href="'.$session{config}{scripturl}.
|
||||
'/'.$data[3].'">'.$data[2].'</a><br>';
|
||||
if ($_[1] == $data[0]) {
|
||||
$output .= '</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use WebGUI::Session;
|
|||
sub _replacement {
|
||||
my (@param, $temp);
|
||||
@param = WebGUI::Macro::getParams($1);
|
||||
$temp = '<a class="homeLink" href="'.$session{env}{SCRIPT_NAME}.'/home">';
|
||||
$temp = '<a class="homeLink" href="'.$session{config}{scripturl}.'/home">';
|
||||
if ($param[0] ne "") {
|
||||
$temp .= $param[0];
|
||||
} else {
|
||||
|
|
|
|||
40
lib/WebGUI/Macro/I_imageWithTags.pm
Normal file
40
lib/WebGUI/Macro/I_imageWithTags.pm
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package WebGUI::Macro::I_imageWithTags;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _replacement {
|
||||
my (@param, $temp, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
%data = WebGUI::SQL->quickHash("select * from images where name='$param[0]'");
|
||||
$temp = '<img src="'.$session{setting}{attachmentDirectoryWeb}.'/images/'.
|
||||
$data{imageId}.'/'.$data{filename}.'" '.$data{parameters}.'>';
|
||||
return $temp;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^I\((.*?)\)\;/_replacement($1)/ge;
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
43
lib/WebGUI/Macro/Include.pm
Normal file
43
lib/WebGUI/Macro/Include.pm
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package WebGUI::Macro::Include;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use FileHandle;
|
||||
use WebGUI::Macro;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _replacement {
|
||||
my (@param, $temp, $file);
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /WebGUI.conf/) {
|
||||
$temp = "SECURITY VIOLATION";
|
||||
} else {
|
||||
$file = FileHandle->new($param[0],"r");
|
||||
while (<$file>) {
|
||||
$temp .= $_;
|
||||
}
|
||||
$file->close;
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^Include\((.*?)\)\;/_replacement($1)/ge;
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
25
lib/WebGUI/Macro/PageTitle.pm
Normal file
25
lib/WebGUI/Macro/PageTitle.pm
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package WebGUI::Macro::PageTitle;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^PageTitle\;/$session{page}{title}/g;
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -39,7 +39,8 @@ sub traversePageTree {
|
|||
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber");
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
$output .= $depth.'<a class="verticalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[0].'">'.$data[1].'</a><br>';
|
||||
$output .= $depth.'<a class="verticalMenu" href="'.
|
||||
$session{config}{scripturl}.'/'.$data[0].'">'.$data[1].'</a><br>';
|
||||
$output .= traversePageTree($data[2],$_[1]+1,$toLevel);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use WebGUI::Session;
|
|||
sub process {
|
||||
my ($output);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^\/\;/$session{ENV}{SCRIPT_NAME}/g;
|
||||
$output =~ s/\^\/\;/$session{config}{scripturl}/g;
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
39
lib/WebGUI/Macro/i_imageNoTags.pm
Normal file
39
lib/WebGUI/Macro/i_imageNoTags.pm
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package WebGUI::Macro::i_imageNoTags;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _replacement {
|
||||
my (@param, $temp, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
%data = WebGUI::SQL->quickHash("select * from images where name='$param[0]'");
|
||||
$temp = $session{setting}{attachmentDirectoryWeb}.'/images/'.$data{imageId}.'/'.$data{filename};
|
||||
return $temp;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^i\((.*?)\)\;/_replacement($1)/ge;
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
@ -28,7 +28,8 @@ sub _replacement {
|
|||
} else {
|
||||
$temp .= " · ";
|
||||
}
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{config}{scripturl}.
|
||||
'/'.$data[1].'">'.$data[0].'</a>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ sub _replacement {
|
|||
} else {
|
||||
$temp .= " · ";
|
||||
}
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{config}{scripturl}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ use WebGUI::SQL;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub _replacement {
|
||||
my ($temp, @data, $pageTitle, $parentId, $sth, $first);
|
||||
$pageTitle = $1;
|
||||
my ($temp, @data, $pageTitle, $parentId, $sth, $first, @param);
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
$temp = '<span class="horizontalMenu">';
|
||||
$first = 1;
|
||||
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$pageTitle'");
|
||||
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$param[0]'");
|
||||
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber");
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
|
|
@ -31,7 +31,8 @@ sub _replacement {
|
|||
} else {
|
||||
$temp .= " · ";
|
||||
}
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{config}{scripturl}.
|
||||
'/'.$data[1].'">'.$data[0].'</a>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -44,7 +45,7 @@ sub process {
|
|||
my ($output,@data, $pageTitle, $parentId, $sth, $first, $temp);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^s\((.*?)\)\;/_replacement($1)/ge;
|
||||
$output =~ s/\^s\;/_replacement()/ge;
|
||||
#$output =~ s/\^s\;/_replacement()/ge;
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ sub _replacement {
|
|||
} else {
|
||||
$temp .= " · ";
|
||||
}
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{config}{scripturl}.'/'
|
||||
.$data[1].'">'.$data[0].'</a>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue