diff --git a/lib/WebGUI/Help/Asset.pm b/lib/WebGUI/Help/Asset.pm index d92bd10d5..be74bdbe9 100644 --- a/lib/WebGUI/Help/Asset.pm +++ b/lib/WebGUI/Help/Asset.pm @@ -105,6 +105,11 @@ our $HELP = { 'asset template' => { title => 'asset template title', body => 'asset template body', + variables => [ + { + name => 'controls', + }, + ], fields => [ ], related => [ diff --git a/lib/WebGUI/Help/Asset_Article.pm b/lib/WebGUI/Help/Asset_Article.pm index 1ea8a6861..7c8afd2ac 100644 --- a/lib/WebGUI/Help/Asset_Article.pm +++ b/lib/WebGUI/Help/Asset_Article.pm @@ -47,10 +47,16 @@ our $HELP = { 'article template' => { title => '72', body => '73', - isa => { - namespace => "Asset_Template", - tag => "template variables" + isa => [ + { + namespace => "Asset_Template", + tag => "template variables" }, + { + namespace => "Asset", + tag => "asset template" + }, + ], fields => [ ], variables => [ diff --git a/lib/WebGUI/Help/Asset_File.pm b/lib/WebGUI/Help/Asset_File.pm index 1ee97acb9..ae6b80c05 100644 --- a/lib/WebGUI/Help/Asset_File.pm +++ b/lib/WebGUI/Help/Asset_File.pm @@ -43,10 +43,16 @@ our $HELP = { 'file template' => { title => 'file template title', body => 'file template body', - isa => { - namespace => "Asset_Template", - tag => "template variables" + isa => [ + { + namespace => "Asset_Template", + tag => "template variables" }, + { + namespace => "Asset", + tag => "asset template" + }, + ], variables => [ { 'name' => 'fileSize' diff --git a/lib/WebGUI/Help/Asset_Folder.pm b/lib/WebGUI/Help/Asset_Folder.pm index ef717cf02..8c9b87443 100644 --- a/lib/WebGUI/Help/Asset_Folder.pm +++ b/lib/WebGUI/Help/Asset_Folder.pm @@ -5,10 +5,12 @@ our $HELP = { 'folder add/edit' => { title => 'folder add/edit title', body => 'folder add/edit body', - isa => { - namespace => "Asset_Wobject", - tag => "wobject add/edit" + isa => [ + { + namespace => "Asset_Wobject", + tag => "wobject add/edit", }, + ], fields => [ { title => 'visitor cache timeout', @@ -33,10 +35,16 @@ our $HELP = { 'folder template' => { title => 'folder template title', body => 'folder template body', - isa => { - namespace => "Asset_Wobject", - tag => "wobject template" + isa => [ + { + namespace => "Asset_Wobject", + tag => "wobject template" }, + { + namespace => "Asset", + tag => "asset template", + }, + ], fields => [ ], variables => [ { diff --git a/lib/WebGUI/Help/Asset_Image.pm b/lib/WebGUI/Help/Asset_Image.pm index a93db695e..b01104f28 100644 --- a/lib/WebGUI/Help/Asset_Image.pm +++ b/lib/WebGUI/Help/Asset_Image.pm @@ -50,10 +50,16 @@ our $HELP = { 'image template' => { title => 'image template title', body => 'image template body', - isa => { - namespace => "Asset_Template", - tag => "template variables" + isa => [ + { + namespace => "Asset_Template", + tag => "template variables" }, + { + namespace => "Asset", + tag => "asset template" + }, + ], fields => [ ], variables => [ diff --git a/lib/WebGUI/Help/Asset_Layout.pm b/lib/WebGUI/Help/Asset_Layout.pm index ead5fd039..3b8cf5273 100644 --- a/lib/WebGUI/Help/Asset_Layout.pm +++ b/lib/WebGUI/Help/Asset_Layout.pm @@ -37,10 +37,16 @@ our $HELP = { 'layout template' => { title => 'layout template title', body => 'layout template body', - isa => { - namespace => "Asset_Template", - tag => "template variables" + isa => [ + { + namespace => "Asset_Template", + tag => "template variables" }, + { + namespace => "Asset", + tag => "asset template" + }, + ], variables => [ { 'name' => 'showAdmin' diff --git a/lib/WebGUI/Help/Asset_MultiSearch.pm b/lib/WebGUI/Help/Asset_MultiSearch.pm index c1d34ef60..57ac6e42a 100644 --- a/lib/WebGUI/Help/Asset_MultiSearch.pm +++ b/lib/WebGUI/Help/Asset_MultiSearch.pm @@ -32,10 +32,16 @@ our $HELP = { 'multisearch template' => { title => 'multisearch template title', body => 'multisearch template body', - isa => { - namespace => "Asset_Template", - tag => "template variables" + isa => [ + { + namespace => "Asset_Template", + tag => "template variables" }, + { + namespace => "Asset", + tag => "asset template" + }, + ], variables => [ { 'name' => 'search', diff --git a/lib/WebGUI/Help/Asset_Shortcut.pm b/lib/WebGUI/Help/Asset_Shortcut.pm index 19e35a99b..0b3dab653 100644 --- a/lib/WebGUI/Help/Asset_Shortcut.pm +++ b/lib/WebGUI/Help/Asset_Shortcut.pm @@ -60,10 +60,16 @@ our $HELP = { 'shortcut template' => { title => 'shortcut template title', body => 'shortcut template body', - isa => { - namespace => "Asset_Template", - tag => "template variables" + isa => [ + { + namespace => "Asset_Template", + tag => "template variables" }, + { + namespace => "Asset", + tag => "asset template" + }, + ], variables => [ { 'name' => 'shortcut.content' diff --git a/lib/WebGUI/Help/Asset_Wobject.pm b/lib/WebGUI/Help/Asset_Wobject.pm index 2250d27ce..57016b7ad 100644 --- a/lib/WebGUI/Help/Asset_Wobject.pm +++ b/lib/WebGUI/Help/Asset_Wobject.pm @@ -30,10 +30,12 @@ our $HELP = { 'wobject add/edit' => { title => '677', body => '632', - isa => { + isa => [ + { tag => 'asset fields', namespace => 'Asset' }, + ], fields => [ { title => '174', diff --git a/lib/WebGUI/Help/Asset_ZipArchive.pm b/lib/WebGUI/Help/Asset_ZipArchive.pm index a1d5a1123..5d421ee2d 100644 --- a/lib/WebGUI/Help/Asset_ZipArchive.pm +++ b/lib/WebGUI/Help/Asset_ZipArchive.pm @@ -42,10 +42,16 @@ our $HELP = { 'zip archive template' => { title => 'zip archive template title', body => 'zip archive template body', - isa => { - namespace => "Asset_Template", - tag => "template variables" + isa => [ + { + namespace => "Asset_Template", + tag => "template variables" }, + { + namespace => "Asset", + tag => "asset template" + }, + ], fields => [ ], variables => [ diff --git a/lib/WebGUI/Help/Macro_L_loginBox.pm b/lib/WebGUI/Help/Macro_L_loginBox.pm index db67770a9..d71d30042 100644 --- a/lib/WebGUI/Help/Macro_L_loginBox.pm +++ b/lib/WebGUI/Help/Macro_L_loginBox.pm @@ -5,10 +5,12 @@ our $HELP = { 'login box' => { title => 'login box title', body => 'login box body', - isa => { - namespace => "Asset_Template", - tag => "template variables" + isa => [ + { + namespace => "Asset_Template", + tag => "template variables" }, + ], variables => [ { 'name' => 'user.isVisitor' diff --git a/lib/WebGUI/Help/_help.skeleton b/lib/WebGUI/Help/_help.skeleton index a89044c44..a3695f0a9 100644 --- a/lib/WebGUI/Help/_help.skeleton +++ b/lib/WebGUI/Help/_help.skeleton @@ -9,11 +9,13 @@ our $HELP = { ##hashref of hashes title => 'help article title', #The title and body are looked up in the body => 'help article title', #i18n file of the same name - # use the following to inherit stuff from another help entry - isa => { + # use the following to inherit stuff other help entries + isa => [ + { tag => 'some other help tag', namespace => 'some other help file', }, + ]; fields => [ #This array is used to list hover help for form fields. { title => 'form label 1', @@ -31,6 +33,7 @@ our $HELP = { ##hashref of hashes { name => "template.variable.name", description => "international tag in this namespace describing this var" + required => "is this variable required for the template to work correctly?" }, ], related => [ ##This lists other help articles that are related to this one diff --git a/lib/WebGUI/Operation/Help.pm b/lib/WebGUI/Operation/Help.pm index 5d3cf537d..49f78e85d 100644 --- a/lib/WebGUI/Operation/Help.pm +++ b/lib/WebGUI/Operation/Help.pm @@ -54,8 +54,12 @@ sub _load { my $help = dclone($hash); foreach my $tag (keys %{ $help }) { $help->{$tag}{related} = [ _related($session, $help->{$tag}{related}) ]; - if ($help->{$tag}{isa}{namespace}) { - my $isa = $hash->{$tag}{isa}; + ##Add an ISA link unless it already exists. + ##This simplifies handling later. + unless (exists $help->{$tag}{isa} and ref $help->{$tag}{isa} eq 'ARRAY') { + $help->{$tag}{isa} = []; + } + foreach my $isa ( @{ $help->{$tag}{isa} } ) { my $other = _load($session, $isa->{namespace}); my $otherHelp = $other->{ $isa->{tag} }; my $add = $otherHelp->{fields}; diff --git a/t/Help/related.t b/t/Help/related.t index 167313867..fb3df5ccc 100644 --- a/t/Help/related.t +++ b/t/Help/related.t @@ -44,18 +44,18 @@ my @relatedHelp = (); my @isaHelp = (); foreach my $topic ( keys %helpTable ) { foreach my $entry ( keys %{ $helpTable{$topic} }) { - my @related = WebGUI::Operation::Help::_related($session, $helpTable{$topic}{$entry}{related}); + my @related = @{ $helpTable{$topic}{$entry}{related} }; foreach my $relHash (@related) { ##Inplace modify $relHash->{parentEntry} = $entry; $relHash->{parentTopic} = $topic; } push @relatedHelp, @related; - if ( scalar keys %{ $helpTable{$topic}{$entry}{isa} } > 0 ) { - my $isaHash = $helpTable{$topic}{$entry}{isa}; + my @isas = @{ $helpTable{$topic}{$entry}{isa} }; + foreach my $isaHash ( @isas ) { $isaHash->{parentEntry} = $entry; $isaHash->{parentTopic} = $topic; - push @isaHelp, $isaHash; } + push @isaHelp, @isas; } }