Database efficiency improvements.
This commit is contained in:
parent
547e10affd
commit
f0ebc98582
12 changed files with 100 additions and 52 deletions
|
|
@ -10,7 +10,7 @@ package WebGUI::Macro::AdminBar;
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use strict qw(refs vars);
|
||||
use Tie::IxHash;
|
||||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
|
|
@ -31,7 +31,10 @@ sub _replacement {
|
|||
$hash{WebGUI::URL::page('op=selectPackageToDeploy')} = WebGUI::International::get(376);
|
||||
}
|
||||
foreach $key (keys %{$session{wobject}}) {
|
||||
$hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$key)} = $session{wobject}{$key};
|
||||
my $cmd = "\$WebGUI::Wobject::".$key."::name";
|
||||
#$hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$key)} = $session{wobject}{$key};
|
||||
$hash{WebGUI::URL::page('func=edit&wid=new&namespace='.$key)} = eval($cmd);
|
||||
WebGUI::ErrorHandler::warn("Could use wobject $key because: ".$@) if ($@);
|
||||
}
|
||||
%hash = sortHash(%hash);
|
||||
%hash = (%{{WebGUI::URL::page()=>WebGUI::International::get(1)}},%hash);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,11 @@ use WebGUI::SQL;
|
|||
sub _replacement {
|
||||
my (@param, $temp);
|
||||
@param = WebGUI::Macro::getParams($1);
|
||||
($temp) = WebGUI::SQL->quickArray("select urlizedTitle from page where pageId=$session{setting}{defaultPage}");
|
||||
if ($session{setting}{defaultPage} == $session{page}{pageId}) {
|
||||
$temp = $session{page}{urlizedTitle};
|
||||
} else {
|
||||
($temp) = WebGUI::SQL->quickArray("select urlizedTitle from page where pageId=$session{setting}{defaultPage}");
|
||||
}
|
||||
$temp = WebGUI::URL::gateway($temp);
|
||||
if ($param[0] ne "linkonly") {
|
||||
$temp = '<a class="homeLink" href="'.$temp.'">';
|
||||
|
|
@ -36,7 +40,7 @@ sub _replacement {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp, @param);
|
||||
my ($output);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^H\((.*?)\)\;/_replacement($1)/ge;
|
||||
$output =~ s/\^H\;/_replacement()/ge;
|
||||
|
|
|
|||
|
|
@ -17,18 +17,21 @@ use WebGUI::Session;
|
|||
use WebGUI::URL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp, $f);
|
||||
$output = $_[0];
|
||||
sub _replacement {
|
||||
my ($f);
|
||||
$f = WebGUI::HTMLForm->new(1);
|
||||
$f->hidden("op","search");
|
||||
$f->text("atLeastOne",'',$session{form}{atLeastOne});
|
||||
$f->submit(WebGUI::International::get(364));
|
||||
$temp = $f->print;
|
||||
$output =~ s/\^\?\;/$temp/g;
|
||||
return $output;
|
||||
return $f->print;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output);
|
||||
$output = $_[0];
|
||||
$output =~ s/\^\?\;/_replacement()/ge;
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue