Merge commit 'f2e0fb509a' into WebGUI8. Some tests still failing.

This commit is contained in:
Colin Kuskie 2010-06-27 22:32:31 -07:00
commit 385931aaab
92 changed files with 1966 additions and 650 deletions

View file

@ -49,20 +49,25 @@ sub handler {
# Only handle op=ajaxGetI18N
return undef unless ( $session->form->get( "op" ) eq "ajaxGetI18N" );
my $json = $session->form->get( "request" );
my $namespaces = JSON->new->decode( $json );
my $i18n = WebGUI::International->new( $session );
my $response = {};
my $json = $session->form->get( "request" );
my $namespaces = eval { JSON->new->decode( $json ) };
unless ($@) {
my $i18n = WebGUI::International->new( $session );
for my $ns ( keys %{ $namespaces } ) {
for my $key ( @{ $namespaces->{ $ns } } ) {
$response->{ $ns }->{ $key } = $i18n->get( $key, $ns );
for my $ns ( keys %{ $namespaces } ) {
for my $key ( @{ $namespaces->{ $ns } } ) {
$response->{ $ns }->{ $key } = $i18n->get( $key, $ns );
}
}
}
else {
$session->log->warn("User ".$session->user->username." tried to execute ajaxGetI18n but could not decode JSON string: $json");
}
$session->http->setMimeType( "application/json" );
return JSON->new->encode( $response );
}
1;

View file

@ -384,13 +384,20 @@ ENDHTML
### Crumbtrail
my $crumb_markup = '<li><a href="%s">%s</a> &gt;</li>';
my $ancestors = $currentAsset->getLineage( ['ancestors'], { returnObjects => 1 } );
my $ancestorIter = $currentAsset->getLineageIterator( ['ancestors'] );
$output .= '<ol id="crumbtrail">';
for my $asset ( @{ $ancestors } ) {
while ( 1 ) {
my $ancestor;
eval { $ancestor = $ancestorIter->() };
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
$session->log->error($x->full_message);
next;
}
last unless $ancestor;
$output .= sprintf $crumb_markup,
$asset->getUrl( 'op=assetManager;method=manage' ),
$asset->get( "menuTitle" ),
$ancestor->getUrl( 'op=assetManager;method=manage' ),
$ancestor->get( "menuTitle" ),
;
}
@ -476,6 +483,8 @@ EOHTML
. WebGUI::Form::hidden($session, {name=>"func", value=>"importPackage"})
. '<div><input type="file" name="packageFile" size="30" style="font-size: 10px;" /></div>'
. '<div style="font-size: 10px">'
. WebGUI::Form::checkbox($session, { label => $i18n->get('clear package flag'), checked => 0, name => 'clearPackageFlag', value => 1 })
. '<br />'
. WebGUI::Form::checkbox($session, { label => $i18n->get('inherit parent permissions'), checked => 1, name => 'inheritPermissions', value => 1 })
. ' &nbsp; ' . WebGUI::Form::submit($session, { value=>$i18n->get("import"), 'extras' => ' ' })
. '</div>'

View file

@ -61,7 +61,6 @@ sub handler {
}
my $pages = WebGUI::Asset->getRoot($session)->getLineageIterator(["self","descendants"],{
returnObjects => 1,
includeOnlyClasses => ["WebGUI::Asset::Wobject::Layout"],
whereClause => $whereClause,
limit => 20000