the first major round of changes for versioning
This commit is contained in:
parent
e535c5d43f
commit
5531a9b3d2
10 changed files with 443 additions and 303 deletions
|
|
@ -40,25 +40,23 @@ sub process {
|
|||
$var{'clipboard.label'} = WebGUI::International::get(1082,'Macro_AdminBar');
|
||||
if (exists $session{asset}) {
|
||||
foreach my $package (@{$session{asset}->getPackageList}) {
|
||||
my $title = $package->{title};
|
||||
my $title = $package->getTitle;
|
||||
$title =~ s/'//g; # stops it from breaking the javascript menus
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($package->{assetId},$package->{className});
|
||||
push(@{$var{'package_loop'}},{
|
||||
'url'=>$session{asset}->getUrl("func=deployPackage&assetId=".$package->{assetId}),
|
||||
'url'=>$session{asset}->getUrl("func=deployPackage&assetId=".$package->getId),
|
||||
'label'=>$title,
|
||||
'icon.small'=>$asset->getIcon(1),
|
||||
'icon'=>$asset->getIcon()
|
||||
'icon.small'=>$package->getIcon(1),
|
||||
'icon'=>$package->getIcon()
|
||||
});
|
||||
}
|
||||
$var{contentTypes_loop} = $session{asset}->getAssetAdderLinks;
|
||||
$var{container_loop} = $session{asset}->getAssetAdderLinks(undef,"assetContainers");
|
||||
foreach my $item (@{$session{asset}->getAssetsInClipboard(1)}) {
|
||||
my $title = $item->{title};
|
||||
foreach my $asset (@{$session{asset}->getAssetsInClipboard(1)}) {
|
||||
my $title = $asset->getTitle;
|
||||
$title =~ s/'//g; # stops it from breaking the javascript menus
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($item->{assetId},$item->{className});
|
||||
push(@{$var{clipboard_loop}}, {
|
||||
'label'=>$title,
|
||||
'url'=>$session{asset}->getUrl("func=paste&assetId=".$item->{assetId}),
|
||||
'url'=>$session{asset}->getUrl("func=paste&assetId=".$asset->getId),
|
||||
'icon.small'=>$asset->getIcon(1),
|
||||
'icon'=>$asset->getIcon()
|
||||
});
|
||||
|
|
@ -67,36 +65,7 @@ sub process {
|
|||
#--admin functions
|
||||
$var{adminConsole_loop} = WebGUI::AdminConsole->getAdminFunction;
|
||||
return WebGUI::Asset::Template->new($templateId)->process(\%var);
|
||||
%hash = (
|
||||
'http://validator.w3.org/check?uri=referer'=>WebGUI::International::get(399,'Macro_AdminBar'),
|
||||
);
|
||||
my $acParams = WebGUI::AdminConsole->getAdminConsoleParams;
|
||||
$hash{$acParams->{url}} = $acParams->{title} if ($acParams->{canUse});
|
||||
# $acParams = WebGUI::AdminConsole->getAdminFunction("users");
|
||||
# $hash{$acParams->{url}} = $acParams->{title} if ($acParams->{canUse});
|
||||
# $acParams = WebGUI::AdminConsole->getAdminFunction("groups");
|
||||
# $hash{$acParams->{url}} = $acParams->{title} if ($acParams->{canUse});
|
||||
$acParams = WebGUI::AdminConsole->getAdminFunction("assets");
|
||||
$hash{$acParams->{url}} = $acParams->{title} if ($acParams->{canUse});
|
||||
|
||||
%hash = sortHash(%hash);
|
||||
%hash = (
|
||||
WebGUI::URL::page('op=switchOffAdmin')=>WebGUI::International::get(12,'Macro_AdminBar'),
|
||||
%hash
|
||||
);
|
||||
$var{'admin.label'} = WebGUI::International::get(82,'Macro_AdminBar');
|
||||
my @admin;
|
||||
my $i = 0;
|
||||
foreach my $key (keys %hash) {
|
||||
push(@admin,{
|
||||
'admin.url'=>$key,
|
||||
'admin.label'=>$hash{$key},
|
||||
'admin.count'=>$i
|
||||
});
|
||||
$i++;
|
||||
}
|
||||
$var{'admin_loop'} = \@admin;
|
||||
return WebGUI::Asset::Template->new($templateId)->process(\%var);
|
||||
# 'http://validator.w3.org/check?uri=referer'=>WebGUI::International::get(399,'Macro_AdminBar'),
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,37 +11,31 @@ package WebGUI::Macro::H_homeLink;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my (@param, $temp);
|
||||
@param = WebGUI::Macro::getParams($_[0]);
|
||||
if ($session{setting}{defaultPage} eq $session{page}{pageId}) {
|
||||
$temp = $session{page}{urlizedTitle};
|
||||
} else {
|
||||
($temp) = WebGUI::SQL->quickArray("select url from asset where assetId=".quote($session{setting}{defaultPage}),WebGUI::SQL->getSlave);
|
||||
}
|
||||
$temp = WebGUI::URL::gateway($temp);
|
||||
if ($param[0] ne "linkonly") {
|
||||
my ($label, $templateUrl) = WebGUI::Macro::getParams(shift);
|
||||
my $home = WebGUI::Asset->getDefault;
|
||||
if ($label ne "linkonly") {
|
||||
my %var;
|
||||
$var{'homelink.url'} = $temp;
|
||||
if ($param[0] ne "") {
|
||||
$var{'homeLink.text'} = $param[0];
|
||||
$var{'homelink.url'} = $home->getUrl;
|
||||
if ($label ne "") {
|
||||
$var{'homeLink.text'} = $label;
|
||||
} else {
|
||||
$var{'homeLink.text'} = WebGUI::International::get(47,'Macro_H_homeLink');
|
||||
}
|
||||
if ($param[1]) {
|
||||
$temp = WebGUI::Asset::Template->newByUrl($param[1])->process(\%var);
|
||||
if ($templateUrl) {
|
||||
return WebGUI::Asset::Template->newByUrl($templateUrl)->process(\%var);
|
||||
} else {
|
||||
$temp = WebGUI::Asset::Template->new("PBtmpl0000000000000042")->process(\%var);
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000042")->process(\%var);
|
||||
}
|
||||
}
|
||||
return $temp;
|
||||
return $home->getUrl;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue