Added more i18n labels to HttpProxy so that error messages can be internationalized.
Added skeletal documentation for the new RSS modules. Fixed a bug in Search/Index.pm that was giving a warning during syntax checks.
This commit is contained in:
parent
7532d07507
commit
91ee102c5f
7 changed files with 211 additions and 5 deletions
|
|
@ -230,6 +230,7 @@ sub view {
|
|||
my $header;
|
||||
my $proxiedUrl;
|
||||
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_HttpProxy');
|
||||
|
||||
### Set up a cookie jar
|
||||
my $cookiebox = $self->session->url->escape($self->session->var->get("sessionId"));
|
||||
|
|
@ -284,7 +285,7 @@ sub view {
|
|||
if ($self->get("followExternal")==0
|
||||
&& (URI->new($self->get('proxiedUrl'))->host) ne (URI->new($proxiedUrl)->host) ) {
|
||||
$var{header} = "text/html";
|
||||
$var{content} = "<h1>You are not allowed to leave ".$self->get("proxiedUrl")."</h1>";
|
||||
$var{content} = sprintf $i18n->get('may not leave error message'), $self->get("proxiedUrl");
|
||||
last;
|
||||
}
|
||||
|
||||
|
|
@ -383,8 +384,7 @@ sub view {
|
|||
|
||||
if ($var{content} =~ /<frame/gis) {
|
||||
$var{header} = "text/html";
|
||||
$var{content} = "<h1>HttpProxy: Can't display frames</h1>
|
||||
Try fetching it directly <a href='$proxiedUrl'>here.</a>";
|
||||
$var{content} = sprintf $i18n->get('no frame error message'), $proxiedUrl;
|
||||
} else {
|
||||
$var{content} =~ s/\<style.*?\/style\>//isg if ($self->get("removeStyle"));
|
||||
$var{content} = WebGUI::HTML::cleanSegment($var{content});
|
||||
|
|
|
|||
30
lib/WebGUI/Help/Asset_RSSCapable.pm
Normal file
30
lib/WebGUI/Help/Asset_RSSCapable.pm
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package WebGUI::Help::Asset_RSSCapable;
|
||||
|
||||
our $HELP = {
|
||||
'rss capable' => {
|
||||
title => 'rss capable title',
|
||||
body => 'rss capable body',
|
||||
# use the following to inherit stuff other help entries
|
||||
isa => [
|
||||
],
|
||||
fields => [ #This array is used to list hover help for form fields.
|
||||
{
|
||||
title => 'rssEnabled label',
|
||||
description => 'rssEnabled hoverHelp',
|
||||
namespace => 'Asset_RSSCapable',
|
||||
},
|
||||
{
|
||||
title => 'rssTemplateId label',
|
||||
description => 'rssTemplateId hoverHelp',
|
||||
namespace => 'Asset_RSSCapable',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
],
|
||||
related => [ ##This lists other help articles that are related to this one
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1; ##All perl modules must return true
|
||||
67
lib/WebGUI/Help/Asset_RSSFromParent.pm
Normal file
67
lib/WebGUI/Help/Asset_RSSFromParent.pm
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
package WebGUI::Help::Asset_RSSFromParent;
|
||||
|
||||
our $HELP = {
|
||||
'rss from parent' => {
|
||||
title => 'rss from parent title',
|
||||
body => 'rss from parent body',
|
||||
# use the following to inherit stuff other help entries
|
||||
isa => [
|
||||
],
|
||||
fields => [ #This array is used to list hover help for form fields.
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
'name' => 'title',
|
||||
'description' => 'title.parent'
|
||||
},
|
||||
{
|
||||
'name' => 'link',
|
||||
'description' => 'title.parent'
|
||||
},
|
||||
{
|
||||
'name' => 'description',
|
||||
'description' => 'description.parent'
|
||||
},
|
||||
{
|
||||
'name' => 'generator'
|
||||
},
|
||||
{
|
||||
'name' => 'lastBuildDate'
|
||||
},
|
||||
{
|
||||
'name' => 'webMaster'
|
||||
},
|
||||
{
|
||||
'name' => 'docs'
|
||||
},
|
||||
{
|
||||
'name' => 'item_loop',
|
||||
variables => [
|
||||
{
|
||||
'name' => 'title',
|
||||
'description' => 'title.item'
|
||||
},
|
||||
{
|
||||
'name' => 'link',
|
||||
'description' => 'title.item'
|
||||
},
|
||||
{
|
||||
'name' => 'description',
|
||||
'description' => 'description.item'
|
||||
},
|
||||
{
|
||||
'name' => 'guid'
|
||||
},
|
||||
{
|
||||
'name' => 'pubDate'
|
||||
},
|
||||
]
|
||||
},
|
||||
],
|
||||
related => [ ##This lists other help articles that are related to this one
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1; ##All perl modules must return true
|
||||
|
|
@ -209,8 +209,8 @@ A reference to an asset object.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $asset = shift;
|
||||
my $self = {_asset=>$asset, _session=>$asset->session, _id=>$asset->getId}, $class;
|
||||
bless $self;
|
||||
my $self = {_asset=>$asset, _session=>$asset->session, _id=>$asset->getId};
|
||||
bless $self, $class;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -179,6 +179,18 @@ our $I18N = {
|
|||
lastUpdated => 1047835817
|
||||
},
|
||||
|
||||
'no frame error message' => {
|
||||
message => q|<h1>HttpProxy: Can't display frames</h1>Try fetching it directly <a href='%s'>here.</a>|,
|
||||
lastUpdated => 1162959817,
|
||||
context => q|This entry is used to tell the user that the HttpProxy cannot display frames. Please leeave the %s part of the string as is, since this entry is used in sprintf|,
|
||||
},
|
||||
|
||||
'may not leave error message' => {
|
||||
message => q|<h1>You are not allowed to leave %s</h1>"|,
|
||||
lastUpdated => 1162959817,
|
||||
context => q|This entry is used to tell the user that the HttpProxy cannot leave this URL. Please leeave the %s part of the string as is, since this entry is used in sprintf|,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,17 @@ our $I18N =
|
|||
'rssEnabled hoverHelp' => { message => q|Whether or not to enable the RSS feed for this asset. If enabled, an RSS From Parent asset will be created and managed as an extra child for this purpose. If not enabled, no such child will be created and the existing one will be deleted.|, lastUpdate => 1162487361 },
|
||||
'rssTemplateId label' => { message => 'RSS Template', lastUpdate => 1162487361 },
|
||||
'rssTemplateId hoverHelp' => { message => q|The template to use for the RSS feed of this asset.|, lastUpdate => 1162487361 },
|
||||
|
||||
'rss capable title' => {
|
||||
message => q|RSS Capable|,
|
||||
lastUpdated => 1162956598
|
||||
},
|
||||
|
||||
'rss capable body' => {
|
||||
message => q|<p>This Asset is used to enable other Assets to make their own RSS feeds using the RSSFromParent Asset. As a content manager or admin, you will probably never directly use this Asset.</p>|,
|
||||
lastUpdated => 1162956563
|
||||
},
|
||||
|
||||
'assetName' => { message => 'RSS Capable', lastUpdate => 1162487361 },
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,92 @@ package WebGUI::i18n::English::Asset_RSSFromParent;
|
|||
our $I18N =
|
||||
{
|
||||
'assetName' => { message => 'RSS From Parent', lastUpdated => 1162257377 },
|
||||
|
||||
'rss from parent title' => {
|
||||
message => 'RSS From Parent',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'rss from parent body' => {
|
||||
message => q|<p>The sole purpose of this Asset is to provide a base template for generating RSS Feeds. Below are listed the basic template variables available to any valid RSS generating Asset. Assets may provide additional or different variables.</p>|,
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'title.parent' => {
|
||||
message => 'The title of the parent of this Asset',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'title.item' => {
|
||||
message => 'The title of this Asset',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'link' => {
|
||||
message => 'link',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'link.parent' => {
|
||||
message => 'The url of the parent of this Asset',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'link.item' => {
|
||||
message => 'The url of this Asset',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'description' => {
|
||||
message => 'description',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'description.parent' => {
|
||||
message => 'The description of the parent of this Asset',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'description.item' => {
|
||||
message => 'The description of this Asset',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'generator' => {
|
||||
message => 'A string that identifies that this RSS was generated by WebGUI and also by what version of WebGUI.',
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'lastBuildDate' => {
|
||||
message => q|The date the parent's content was last modified in the proper format for RSS (RFC 822).|,
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'webMaster' => {
|
||||
message => q|The company email address from the WebGUI Settings.|,
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'docs' => {
|
||||
message => q|The URL http://blogs.law.harvard.edu/tech/rss, which links to the RSS 2.0 specification.|,
|
||||
lastUpdated => 1162257377
|
||||
},
|
||||
|
||||
'item_loop' => {
|
||||
message => q|A loop containing information about all Assets below the parent.|,
|
||||
lastUpdated => 1162957711
|
||||
},
|
||||
|
||||
'guid' => {
|
||||
message => q|An alias for link. In RSS, guid is the unique identifier for this item.|,
|
||||
lastUpdated => 1162957711
|
||||
},
|
||||
|
||||
'pubDate' => {
|
||||
message => q|The date this item was last modified in the proper format for RSS (RFC 822).|,
|
||||
lastUpdated => 1162958127
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue