diff --git a/lib/WebGUI/Help/Asset_Collaboration.pm b/lib/WebGUI/Help/Asset_Collaboration.pm index fc36c3d42..d14bd3054 100644 --- a/lib/WebGUI/Help/Asset_Collaboration.pm +++ b/lib/WebGUI/Help/Asset_Collaboration.pm @@ -203,6 +203,197 @@ our $HELP = { 'collaboration template labels' => { title => 'collaboration template labels title', body => 'collaboration template labels body', + variables => [ + { + 'name' => 'add.label' + }, + { + 'name' => 'addlink.label' + }, + { + 'name' => 'addquestion.label' + }, + { + 'name' => 'answer.label' + }, + { + 'name' => 'attachment.label' + }, + { + 'name' => 'by.label' + }, + { + 'name' => 'body.label' + }, + { + 'name' => 'back.label' + }, + { + 'name' => 'compensation.label' + }, + { + 'name' => 'open.label' + }, + { + 'name' => 'close.label' + }, + { + 'name' => 'closed.label' + }, + { + 'name' => 'critical.label' + }, + { + 'name' => 'minor.label' + }, + { + 'name' => 'cosmetic.label' + }, + { + 'name' => 'fatal.label' + }, + { + 'name' => 'severity.label' + }, + { + 'name' => 'date.label' + }, + { + 'name' => 'delete.label' + }, + { + 'name' => 'description.label' + }, + { + 'name' => 'edit.label' + }, + { + 'name' => 'image.label' + }, + { + 'name' => 'job.header.label' + }, + { + 'name' => 'job.title.label' + }, + { + 'name' => 'job.description.label' + }, + { + 'name' => 'job.requirements.label' + }, + { + 'name' => 'location.label' + }, + { + 'name' => 'layout.flat.label' + }, + { + 'name' => 'link.header.label' + }, + { + 'name' => 'lastReply.label' + }, + { + 'name' => 'lock.label' + }, + { + 'name' => 'layout.label' + }, + { + 'name' => 'message.header.label' + }, + { + 'name' => 'message.label' + }, + { + 'name' => 'next.label' + }, + { + 'name' => 'newWindow.label' + }, + { + 'name' => 'layout.nested.label' + }, + { + 'name' => 'previous.label' + }, + { + 'name' => 'post.label' + }, + { + 'name' => 'question.label' + }, + { + 'name' => 'question.header.label' + }, + { + 'name' => 'rating.label' + }, + { + 'name' => 'rate.label' + }, + { + 'name' => 'reply.label' + }, + { + 'name' => 'replies.label' + }, + { + 'name' => 'readmore.label' + }, + { + 'name' => 'responses.label' + }, + { + 'name' => 'search.label' + }, + { + 'name' => 'subject.label' + }, + { + 'name' => 'subscribe.label' + }, + { + 'name' => 'submission.header.label' + }, + { + 'name' => 'stick.label' + }, + { + 'name' => 'status.label' + }, + { + 'name' => 'synopsis.label' + }, + { + 'name' => 'thumbnail.label' + }, + { + 'name' => 'title.label' + }, + { + 'name' => 'unlock.label' + }, + { + 'name' => 'unstick.label' + }, + { + 'name' => 'unsubscribe.label' + }, + { + 'name' => 'url.label' + }, + { + 'name' => 'user.label' + }, + { + 'name' => 'views.label' + }, + { + 'name' => 'visitorName.label' + } + ], fields => [ ], related => [ diff --git a/lib/WebGUI/Operation/Help.pm b/lib/WebGUI/Operation/Help.pm index 5c0e03909..b4bfd2863 100644 --- a/lib/WebGUI/Operation/Help.pm +++ b/lib/WebGUI/Operation/Help.pm @@ -18,7 +18,8 @@ use WebGUI::Asset::Template; use WebGUI::Macro; use WebGUI::Utility; use WebGUI::TabForm; -use Storable qw/dclone/; +use Data::Dumper; +#use Storable qw/dclone/; =head1 NAME @@ -32,6 +33,70 @@ Handles displaying WebGUI's internal help to the user as an operation. #------------------------------------------------------------------- +=head2 _loadHelp ( $session, $helpPackage ) + +Safely load's the Help file for the requested helpPackage if it hasn't +been already and logs errors during the load. + +=cut + +sub _loadHelp { + my $session = shift; + my $helpPackage = shift; + return $helpPackage::HELP if defined $helpPackage::HELP; ##Already loaded + my $load = sprintf 'use %-s; $%-s::HELP', $helpPackage, $helpPackage; + my $help = eval($load); + if ($@) { + $session->errorHandler->error("Help failed to compile: $helpPackage. ".$@); + return {}; + } + return $help; +} + +#------------------------------------------------------------------- + +=head2 _process ( $session, $cmd, $key ) + +Do all post processing for an entry in a freshly loaded help file. +Resolve the related key, add a default isa key if it is missing, +and set the __PROCESSED flag to prevent processing entries twice. + +=cut + +sub _process { + my ($session, $helpEntry, $key) = @_; + return if exists($helpEntry->{__PROCESSED}) and $helpEntry->{__PROCESSED}; + $helpEntry->{related} = [ _related($session, $helpEntry->{related}) ]; + ##Add an ISA link unless it already exists. + ##This simplifies handling later. + unless (exists $helpEntry->{isa} and ref $helpEntry->{isa} eq 'ARRAY') { + $helpEntry->{isa} = []; + } + unless (exists $helpEntry->{__PROCESSED}) { + $helpEntry->{__PROCESSED} = 0; + } + foreach my $isa ( @{ $helpEntry->{isa} } ) { + my $oCmd = "WebGUI::Help::".$isa->{namespace}; + my $other = _loadHelp($session, $oCmd); + my $otherHelp = $other->{ $isa->{tag} }; + _process($session, $otherHelp, $isa->{tag}); + my $add = $otherHelp->{fields}; + @{$helpEntry->{fields}} = (@{$helpEntry->{fields}}, @{$add}); + $add = $otherHelp->{related}; + @{$helpEntry->{related}} = (@{ $helpEntry->{related} }, @{ $add }); + $add = $otherHelp->{variables}; + foreach my $row (@{$add}) { + push(@{$helpEntry->{variables}}, { + name=> $row->{name}, + description => $row->{description}, + namespace => $row->{namespace} || $isa->{namespace} + }); + } + } +} + +#------------------------------------------------------------------- + =head2 _load ( $session, $namespace ) Safely load's the Help file for the requested namespace and logs errors @@ -43,38 +108,9 @@ sub _load { my $session = shift; my $namespace = shift; my $cmd = "WebGUI::Help::".$namespace; - my $load = sprintf 'use %-s; $%-s::HELP;', $cmd, $cmd; - my $hash = eval($load); - if ($@) { - $session->errorHandler->error("Help failed to compile: $namespace. ".$@); - return {}; - } - local $Storable::Deparse = 1; - local $Storable::Eval = 1; - my $help = dclone($hash); + my $help = _loadHelp($session, $cmd); foreach my $tag (keys %{ $help }) { - $help->{$tag}{related} = [ _related($session, $help->{$tag}{related}) ]; - ##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}; - @{$help->{$tag}{fields}} = (@{$help->{$tag}{fields}}, @{$add}); - $add = $otherHelp->{related}; - @{$help->{$tag}{related}} = (@{ $help->{$tag}{related} }, @{ $add }); - $add = $otherHelp->{variables}; - foreach my $row (@{$add}) { - push(@{$help->{$tag}{variables}}, { - name=> $row->{name}, - description => $row->{description}, - namespace => $row->{namespace} || $isa->{namespace} - }); - } - } + _process($session, $help->{$tag}, $tag); } return $help; } diff --git a/lib/WebGUI/i18n/English/Asset_Collaboration.pm b/lib/WebGUI/i18n/English/Asset_Collaboration.pm index da3bb136f..da8039043 100644 --- a/lib/WebGUI/i18n/English/Asset_Collaboration.pm +++ b/lib/WebGUI/i18n/English/Asset_Collaboration.pm @@ -696,277 +696,326 @@ our $I18N = { lastUpdated => 1111520746, }, - 'word' => { - context => q|Helper phrase for autogenerated documentation for labels|, - message => q|The word|, - lastUpdated => 1111533791, - }, + 'add.label' => { + message => q|The word "Add".|, + lastUpdated => 1150169037, + }, - 'phrase' => { - context => q|Helper phrase for autogenerated documentation for labels|, - message => q|The phrase|, - lastUpdated => 1111533788, - }, + 'addlink.label' => { + message => q|The phrase "Add a link".|, + lastUpdated => 1150169037, + }, + + 'addquestion.label' => { + message => q|The phrase "Add a question".|, + lastUpdated => 1150169037, + }, + + 'answer.label' => { + message => q|The word "Answer".|, + lastUpdated => 1150169037, + }, + + 'attachment.label' => { + message => q|The word "Attachment".|, + lastUpdated => 1150169037, + }, + + 'by.label' => { + message => q|The word "By".|, + lastUpdated => 1150169037, + }, + + 'body.label' => { + message => q|The word "Body".|, + lastUpdated => 1150169037, + }, + + 'back.label' => { + message => q|The word "Back".|, + lastUpdated => 1150169037, + }, + + 'compensation.label' => { + message => q|The word "Compensation".|, + lastUpdated => 1150169037, + }, + + 'open.label' => { + message => q|The word "Open".|, + lastUpdated => 1150169037, + }, + + 'close.label' => { + message => q|The word "Close".|, + lastUpdated => 1150169037, + }, + + 'closed.label' => { + message => q|The word "Closed".|, + lastUpdated => 1150169037, + }, + + 'critical.label' => { + message => q|The word "Critical (mostly not working)".|, + lastUpdated => 1150169037, + }, + + 'minor.label' => { + message => q|The word "Minor (annoying, but not harmful)".|, + lastUpdated => 1150169037, + }, + + 'cosmetic.label' => { + message => q|The word "Cosmetic (misspelling, formatting problems)".|, + lastUpdated => 1150169037, + }, + + 'fatal.label' => { + message => q|The word "Fatal (can't continue until this is resolved)".|, + lastUpdated => 1150169037, + }, + + 'severity.label' => { + message => q|The word "Severity".|, + lastUpdated => 1150169037, + }, + + 'date.label' => { + message => q|The word "Date".|, + lastUpdated => 1150169037, + }, + + 'delete.label' => { + message => q|The word "Delete".|, + lastUpdated => 1150169037, + }, + + 'description.label' => { + message => q|The word "Description".|, + lastUpdated => 1150169037, + }, + + 'edit.label' => { + message => q|The word "Edit".|, + lastUpdated => 1150169037, + }, + + 'image.label' => { + message => q|The word "Image".|, + lastUpdated => 1150169037, + }, + + 'job.header.label' => { + message => q|The phrase "Edit Job Posting".|, + lastUpdated => 1150169037, + }, + + 'job.title.label' => { + message => q|The phrase "Job Title".|, + lastUpdated => 1150169037, + }, + + 'job.description.label' => { + message => q|The phrase "Job Description".|, + lastUpdated => 1150169037, + }, + + 'job.requirements.label' => { + message => q|The phrase "Job Requirements".|, + lastUpdated => 1150169037, + }, + + 'location.label' => { + message => q|The word "Location".|, + lastUpdated => 1150169037, + }, + + 'layout.flat.label' => { + message => q|The word "Flat".|, + lastUpdated => 1150169037, + }, + + 'link.header.label' => { + message => q|The phrase "Edit Link".|, + lastUpdated => 1150169037, + }, + + 'lastReply.label' => { + message => q|The phrase "Last Reply".|, + lastUpdated => 1150169037, + }, + + 'lock.label' => { + message => q|The word "Lock".|, + lastUpdated => 1150169037, + }, + + 'layout.label' => { + message => q|The word "Layout".|, + lastUpdated => 1150169037, + }, + + 'message.header.label' => { + message => q|The phrase "Edit Message".|, + lastUpdated => 1150169037, + }, + + 'message.label' => { + message => q|The word "Message".|, + lastUpdated => 1150169037, + }, + + 'next.label' => { + message => q|The word "Next".|, + lastUpdated => 1150169037, + }, + + 'newWindow.label' => { + message => q|The phrase "Open in new window?".|, + lastUpdated => 1150169037, + }, + + 'layout.nested.label' => { + message => q|The word "Nested".|, + lastUpdated => 1150169037, + }, + + 'previous.label' => { + message => q|The word "Previous".|, + lastUpdated => 1150169037, + }, + + 'post.label' => { + message => q|The word "Post".|, + lastUpdated => 1150169037, + }, + + 'question.label' => { + message => q|The word "Question".|, + lastUpdated => 1150169037, + }, + + 'question.header.label' => { + message => q|The phrase "Edit Question".|, + lastUpdated => 1150169037, + }, + + 'rating.label' => { + message => q|The word "Rating".|, + lastUpdated => 1150169037, + }, + + 'rate.label' => { + message => q|The word "Rate".|, + lastUpdated => 1150169037, + }, + + 'reply.label' => { + message => q|The word "Reply".|, + lastUpdated => 1150169037, + }, + + 'replies.label' => { + message => q|The word "Replies".|, + lastUpdated => 1150169037, + }, + + 'readmore.label' => { + message => q|The phrase "Read More".|, + lastUpdated => 1150169037, + }, + + 'responses.label' => { + message => q|The word "Responses".|, + lastUpdated => 1150169037, + }, + + 'search.label' => { + message => q|The word "Search".|, + lastUpdated => 1150169037, + }, + + 'subject.label' => { + message => q|The word "Subject".|, + lastUpdated => 1150169038, + }, + + 'subscribe.label' => { + message => q|The word "Subscribe".|, + lastUpdated => 1150169038, + }, + + 'submission.header.label' => { + message => q|The phrase "Edit Submission".|, + lastUpdated => 1150169038, + }, + + 'stick.label' => { + message => q|The phrase "Make Sticky".|, + lastUpdated => 1150169038, + }, + + 'status.label' => { + message => q|The word "Status".|, + lastUpdated => 1150169038, + }, + + 'synopsis.label' => { + message => q|The word "Summary".|, + lastUpdated => 1150169038, + }, + + 'thumbnail.label' => { + message => q|The word "Thumbnail".|, + lastUpdated => 1150169038, + }, + + 'title.label' => { + message => q|The word "Title".|, + lastUpdated => 1150169038, + }, + + 'unlock.label' => { + message => q|The word "Unlock".|, + lastUpdated => 1150169038, + }, + + 'unstick.label' => { + message => q|The word "Unstick".|, + lastUpdated => 1150169038, + }, + + 'unsubscribe.label' => { + message => q|The word "Unsubscribe".|, + lastUpdated => 1150169038, + }, + + 'url.label' => { + message => q|The word "URL".|, + lastUpdated => 1150169038, + }, + + 'user.label' => { + message => q|The word "User".|, + lastUpdated => 1150169038, + }, + + 'views.label' => { + message => q|The word "Views".|, + lastUpdated => 1150169038, + }, + + 'visitorName.label' => { + message => q|The phrase "Visitor Name".|, + lastUpdated => 1150169038, + }, 'collaboration template labels body' => { - context => q|Note to translators, this text is largely autogenerated. Please just translate the paragraph at the beginning of the message and leave the rest.|, message => q|

These labels are available in the templates of several Assets and Wobjects, but all of them may not be useful. Please consult the template documentation for the Asset or Wobject to see which are used.

- -

add.label
-^International("word","Asset_Collaboration"); "^International("add","Asset_Collaboration");". -

- -

addlink.label
-^International("phrase","Asset_Collaboration"); "^International("addlink","Asset_Collaboration");". -

- -

addquestion.label
-^International("phrase","Asset_Collaboration"); "^International("addquestion","Asset_Collaboration");". -

- -

answer.label
-^International("word","Asset_Collaboration"); "^International("answer","Asset_Collaboration");". -

- -

attachment.label
-^International("word","Asset_Collaboration"); "^International("attachment","Asset_Collaboration");". -

- -

by.label
-^International("word","Asset_Collaboration"); "^International("by","Asset_Collaboration");". -

- -

body.label
-^International("word","Asset_Collaboration"); "^International("body","Asset_Collaboration");". -

- -

back.label
-^International("word","Asset_Collaboration"); "^International("back","Asset_Collaboration");". -

- -

compensation.label
-^International("word","Asset_Collaboration"); "^International("compensation","Asset_Collaboration");". -

- -

open.label
-^International("word","Asset_Collaboration"); "^International("open","Asset_Collaboration");". -

- -

close.label
-^International("word","Asset_Collaboration"); "^International("close","Asset_Collaboration");". -

- -

closed.label
-^International("word","Asset_Collaboration"); "^International("closed","Asset_Collaboration");". -

- -

critical.label
-^International("word","Asset_Collaboration"); "^International("critical","Asset_Collaboration");". -

- -

minor.label
-^International("word","Asset_Collaboration"); "^International("minor","Asset_Collaboration");". -

- -

cosmetic.label
-^International("word","Asset_Collaboration"); "^International("cosmetic","Asset_Collaboration");". -

- -

fatal.label
-^International("word","Asset_Collaboration"); "^International("fatal","Asset_Collaboration");". -

- -

severity.label
-^International("word","Asset_Collaboration"); "^International("severity","Asset_Collaboration");". -

- -

date.label
-^International("word","Asset_Collaboration"); "^International("date","Asset_Collaboration");". -

- -

delete.label
-^International("word","Asset_Collaboration"); "^International("delete","Asset_Collaboration");". -

- -

description.label
-^International("word","Asset_Collaboration"); "^International("description","Asset_Collaboration");". -

- -

edit.label
-^International("word","Asset_Collaboration"); "^International("edit","Asset_Collaboration");". -

- -

image.label
-^International("word","Asset_Collaboration"); "^International("image","Asset_Collaboration");". -

- -

job.header.label
-^International("phrase","Asset_Collaboration"); "^International("edit job","Asset_Collaboration");". -

- -

job.title.label
-^International("phrase","Asset_Collaboration"); "^International("job title","Asset_Collaboration");". -

- -

job.description.label
-^International("phrase","Asset_Collaboration"); "^International("job description","Asset_Collaboration");". -

- -

job.requirements.label
-^International("phrase","Asset_Collaboration"); "^International("job requirements","Asset_Collaboration");". -

- -

location.label
-^International("word","Asset_Collaboration"); "^International("location","Asset_Collaboration");". -

- -

layout.flat.label
-^International("word","Asset_Collaboration"); "^International("flatLayout","Asset_Collaboration");". -

- -

link.header.label
-^International("phrase","Asset_Collaboration"); "^International("edit link","Asset_Collaboration");". -

- -

lastReply.label
-^International("phrase","Asset_Collaboration"); "^International("lastReply","Asset_Collaboration");". -

- -

lock.label
-^International("word","Asset_Collaboration"); "^International("lock","Asset_Collaboration");". -

- -

layout.label
-^International("word","Asset_Collaboration"); "^International("layout","Asset_Collaboration");". -

- -

message.header.label
-^International("phrase","Asset_Collaboration"); "^International("edit message","Asset_Collaboration");". -

- -

message.label
-^International("word","Asset_Collaboration"); "^International("message","Asset_Collaboration");". -

- -

next.label
-^International("word","Asset_Collaboration"); "^International("next","Asset_Collaboration");". -

- -

newWindow.label
-^International("phrase","Asset_Collaboration"); "^International("new window","Asset_Collaboration");". -

- -

layout.nested.label
-^International("word","Asset_Collaboration"); "^International("nested","Asset_Collaboration");". -

- -

previous.label
-^International("word","Asset_Collaboration"); "^International("previous","Asset_Collaboration");". -

- -

post.label
-^International("word","Asset_Collaboration"); "^International("post","Asset_Collaboration");". -

- -

question.label
-^International("word","Asset_Collaboration"); "^International("question","Asset_Collaboration");". -

- -

question.header.label
-^International("phrase","Asset_Collaboration"); "^International("edit question","Asset_Collaboration");". -

- -

rating.label
-^International("word","Asset_Collaboration"); "^International("rating","Asset_Collaboration");". -

- -

rate.label
-^International("word","Asset_Collaboration"); "^International("rate","Asset_Collaboration");". -

- -

reply.label
-^International("word","Asset_Collaboration"); "^International("reply","Asset_Collaboration");". -

- -

replies.label
-^International("word","Asset_Collaboration"); "^International("replies","Asset_Collaboration");". -

- -

readmore.label
-^International("phrase","Asset_Collaboration"); "^International("read more","Asset_Collaboration");". -

- -

responses.label
-^International("word","Asset_Collaboration"); "^International("responses","Asset_Collaboration");". -

- -

search.label
-^International("word","Asset_Collaboration"); "^International("search","Asset_Collaboration");". -

- -

subject.label
-^International("word","Asset_Collaboration"); "^International("subject","Asset_Collaboration");". -

- -

subscribe.label
-^International("word","Asset_Collaboration"); "^International("subscribe","Asset_Collaboration");". -

- -

submission.header.label
-^International("phrase","Asset_Collaboration"); "^International("edit submission","Asset_Collaboration");". -

- -

stick.label
-^International("phrase","Asset_Collaboration"); "^International("sticky","Asset_Collaboration");". -

- -

status.label
-^International("word","Asset_Collaboration"); "^International("status","Asset_Collaboration");". -

- -

synopsis.label
-^International("word","Asset_Collaboration"); "^International("synopsis","Asset_Collaboration");". -

- -

thumbnail.label
-^International("word","Asset_Collaboration"); "^International("thumbnail","Asset_Collaboration");". -

- -

title.label
-^International("word","Asset_Collaboration"); "^International("title","Asset_Collaboration");". -

- -

unlock.label
-^International("word","Asset_Collaboration"); "^International("unlock","Asset_Collaboration");". -

- -

unstick.label
-^International("word","Asset_Collaboration"); "^International("unstick","Asset_Collaboration");". -

- -

unsubscribe.label
-^International("word","Asset_Collaboration"); "^International("unsubscribe","Asset_Collaboration");". -

- -

url.label
-^International("word","Asset_Collaboration"); "^International("url","Asset_Collaboration");". -

- -

user.label
-^International("word","Asset_Collaboration"); "^International("user","Asset_Collaboration");". -

- -

views.label
-^International("word","Asset_Collaboration"); "^International("views","Asset_Collaboration");". -

- -

visitorName.label
-^International("phrase","Asset_Collaboration"); "^International("visitor","Asset_Collaboration");". -

- |, - lastUpdated => 1146153770 + lastUpdated => 1150169127 }, 'collaboration add/edit title' => {