diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 52c0a1c14..e72274758 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,4 +1,5 @@ 6.6.2 + - Changed the back to site link in the admin console to act intuitively rather than logically. - fix [ 1220552 ] moderation of postings/threads - fix [ 1218870 ] !! Bugs in Article.pm (old 'Discussion allowed' feature) - Fixed help for LDAP connections. diff --git a/docs/upgrades/upgrade_6.6.1-6.6.2.sql b/docs/upgrades/upgrade_6.6.1-6.6.2.sql index 0cfb0ec71..3d6068b35 100644 --- a/docs/upgrades/upgrade_6.6.1-6.6.2.sql +++ b/docs/upgrades/upgrade_6.6.1-6.6.2.sql @@ -1,3 +1,4 @@ insert into webguiVersion values ('6.6.2','upgrade',unix_timestamp()); alter table Shortcut add disableContentLock int(11) NOT NULL default '0'; update template set template='

Price:
Product Number:




Features


Benefits


Specifications

:

Accessories


Related Products


' where assetId='PBtmpl0000000000000056'; +update template set template='^StyleSheet(^Extras;/adminConsole/adminConsole.css);\r\n^JavaScript(^Extras;/adminConsole/adminConsole.js);\r\n\r\n
\r\n \r\n \" target=\"_blank\">\"?\"\r\n \r\n
\r\n
\r\n \" border=\"0\" title=\"\" alt=\"\" />\r\n
\r\n
\r\n\"*\"\r\n
\r\n
\r\n \" border=\"0\" title=\"\" alt=\"\" />\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n  \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n  \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \" >
\r\n
\r\n
\r\n
\r\n \">
\r\n ^AdminToggle;
\r\n ^LoginToggle;
\r\n
\r\n
\r\n\r\n' where assetId='PBtmpl0000000000000001'; diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 9e50ba2dc..93ef0b455 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,6 +1,6 @@ package WebGUI; our $VERSION = "6.6.2"; -our $STATUS = "beta"; +our $STATUS = "gamma"; #------------------------------------------------------------------- # WebGUI is Copyright 2001-2005 Plain Black Corporation. diff --git a/lib/WebGUI/AdminConsole.pm b/lib/WebGUI/AdminConsole.pm index d396c01f3..459f45baf 100644 --- a/lib/WebGUI/AdminConsole.pm +++ b/lib/WebGUI/AdminConsole.pm @@ -399,6 +399,18 @@ sub render { $var{"console.canUse"} = $acParams->{canUse}; $var{"console.icon"} = $acParams->{icon}; $var{"help.url"} = $self->{_helpUrl}; + if (exists $session{asset}) { + my $importNode = $session{asset}->getImportNode; + my $importNodeLineage = $importNode->get("lineage"); + my $assetLineage = $session{asset}->get("lineage"); + if ($assetLineage =~ /^$importNodeLineage/) { + $var{"backtosite.url"} = $session{asset}->getDefault->getUrl; + } else { + $var{"backtosite.url"} = $session{asset}->getContainer->getUrl; + } + } else { + $var{"backtosite.url"} = WebGUI::URL::page(); + } $var{"application_loop"} = $self->getAdminFunction; return WebGUI::Style::process(WebGUI::Asset::Template->new($session{setting}{AdminConsoleTemplate})->process(\%var),"PBtmpl0000000000000137"); } diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 0e2c728cf..f78fc4655 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -51,10 +51,10 @@ A lineage is a concatenated series of sequence numbers, each six digits long, th use WebGUI::Asset; - $AssetObject= WebGUI::Asset->addChild(\%properties); - $integer= WebGUI::Asset->canEdit("An_Id_AbCdeFGHiJkLMNOP"); - $integer= WebGUI::Asset->canView("An_Id_AbCdeFGHiJkLMNOP"); - WebGUI::Asset->cascadeLineage(100001,100101110111); + $newAsset = $asset->addChild(\%properties); + $boolean = $asset->canEdit("An_Id_AbCdeFGHiJkLMNOP"); + $boolean = $asset->canView("An_Id_AbCdeFGHiJkLMNOP"); + $asset->cascadeLineage(100001,100101110111); $html= WebGUI::Asset->checkExportPath(); WebGUI::Asset->cut(); $arrayRef= WebGUI::Asset->definition(\@arr); @@ -71,7 +71,8 @@ A lineage is a concatenated series of sequence numbers, each six digits long, th $JavaScript= WebGUI::Asset->getAssetManagerControl(\%hashref, $string, $bool); $arrayRef= WebGUI::Asset->getAssetsInClipboard($boolean, $string); $arrayRef= WebGUI::Asset->getAssetsInTrash($boolean, $string); - $containerRef= WebGUI::Asset->getContainer(); + $containerRef= $asset->getContainer(); + $asset = WebGUI::Asset->getDefault(); $tabform= WebGUI::Asset->getEditForm(); getFirstChild getIcon @@ -83,6 +84,7 @@ A lineage is a concatenated series of sequence numbers, each six digits long, th getMetaDataFields getName getNextChildRank + getNotFound getParent getParentLineage getRank @@ -966,6 +968,20 @@ sub getContainer { } +#------------------------------------------------------------------- + +=head2 getDefault ( ) + +Returns the default object, which is also known by some as the "Home Page". The default object is set in the settings. + +=cut + +sub getDefault { + my $class = shift; + return $class->newByDynamicClass($session{setting}{defaultPage}); +} + + #------------------------------------------------------------------- =head2 getEditForm ( ) @@ -976,7 +992,7 @@ Creates and returns a tabform to edit parameters of an Asset. sub getEditForm { my $self = shift; - my $tabform = WebGUI::TabForm->new(); + my $tabform = WebGUI::TabForm->new(undef,undef,$self->getContainer->getUrl()); $tabform->hidden({ name=>"func", value=>"editSave" @@ -1539,6 +1555,20 @@ sub getNextChildRank { return $self->formatRank($rank); } +#------------------------------------------------------------------- + +=head2 getNotFound ( ) + +Returns the not found object. The not found object is set in the settings. + +=cut + +sub getNotFound { + my $class = shift; + return $class->newByDynamicClass($session{setting}{notFoundPage}); +} + + #------------------------------------------------------------------- =head2 getPackageList ( ) @@ -1884,7 +1914,7 @@ sub newByDynamicClass { if ($className eq "") { WebGUI::HTTP::setStatus('404',"Page Not Found"); WebGUI::ErrorHandler::fatal("The page not found page doesn't exist.") if ($assetId eq $session{setting}{notFoundPage}); - return WebGUI::Asset->newByDynamicClass($session{setting}{notFoundPage}); + return $class->getNotFound; } my $cmd = "use ".$className; eval ($cmd); @@ -1972,10 +2002,10 @@ sub newByUrl { if ($asset->{assetId} ne "" || $asset->{className} ne "") { return WebGUI::Asset->newByDynamicClass($asset->{assetId}, $asset->{className}); } else { - return $class->newByDynamicClass($session{setting}{notFoundPage}); + return $class->getNotFound; } } - return $class->newByDynamicClass($session{setting}{defaultPage}); + return $class->getDefault; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/TabForm.pm b/lib/WebGUI/TabForm.pm index 46ff5a22a..d66891f77 100644 --- a/lib/WebGUI/TabForm.pm +++ b/lib/WebGUI/TabForm.pm @@ -185,6 +185,10 @@ A hash reference containing the definition of the tabs. It should be constructed A string containing the link to the tab-CascadingStyleSheet default = extrasPath.'/tabs/tabs.css' + +=head3 cancelUrl + +A URL to go to when the cancel button is pressed. =cut @@ -192,6 +196,7 @@ sub new { my $class = shift; my $startingTabs = shift; my $css = shift || $session{config}{extrasURL}.'/tabs/tabs.css'; + my $cancelUrl = shift || WebGUI::URL::page(); my %tabs; tie %tabs, 'Tie::IxHash'; foreach my $key (keys %{$startingTabs}) { @@ -201,7 +206,7 @@ sub new { } my $cancel = WebGUI::Form::button({ value=>WebGUI::International::get('cancel'), - extras=>q|onClick="location.href='|.WebGUI::URL::page().q|'"| + extras=>q|onClick="location.href='|.$cancelUrl.q|'"| }); bless { _cancel=>$cancel, _submit=>WebGUI::Form::submit(), _form=>WebGUI::Form::formHeader(), _hidden=>"", _tab=>\%tabs, _css=>$css }, $class; }