';
$output .= '';
@@ -602,16 +605,17 @@ sub uncacheOverrides {
sub view {
my $self = shift;
my $content;
+ my $i18n = WebGUI::International->new($self->session,"Asset_Shortcut");
my $shortcut = $self->getShortcut;
if ($self->get("shortcutToAssetId") eq $self->get("parentId")) {
- $content = WebGUI::International::get("Displaying this shortcut would cause a feedback loop","Asset_Shortcut");
+ $content = $i18n->get("Displaying this shortcut would cause a feedback loop");
} else {
$content = $shortcut->view;
}
my %var = (
isShortcut => 1,
'shortcut.content' => $content,
- 'shortcut.label' => WebGUI::International::get('assetName',"Asset_Shortcut"),
+ 'shortcut.label' => $i18n->get('assetName'),
originalURL => $shortcut->getUrl,
'shortcut.url'=>$self->getUrl
);
@@ -627,8 +631,9 @@ sub www_edit {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
$self->getAdminConsole->setHelp("shortcut add/edit","Asset_Shortcut");
- $self->getAdminConsole->addSubmenuItem($self->getUrl("func=manageOverrides"),WebGUI::International::get("Manage Shortcut Overrides","Asset_Shortcut"));
- return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get(2,"Asset_Shortcut"));
+ my $i18n = WebGUI::International->new($self->session,"Asset_Shortcut");
+ $self->getAdminConsole->addSubmenuItem($self->getUrl("func=manageOverrides"),$i18n->get("Manage Shortcut Overrides"));
+ return $self->getAdminConsole->render($self->getEditForm->print,$i18n->get(2));
}
#-------------------------------------------------------------------
@@ -676,7 +681,8 @@ sub www_getUserPrefsForm {
sub www_manageOverrides {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
- return $self->_submenu($self->getOverridesList,WebGUI::International::get("Manage Shortcut Overrides","Asset_Shortcut"));
+ my $i18n = WebGUI::International->new($self->session,"Asset_Shortcut");
+ return $self->_submenu($self->getOverridesList,$i18n->get("Manage Shortcut Overrides"));
}
#-------------------------------------------------------------------
@@ -703,16 +709,17 @@ sub www_saveUserPrefs {
my @fellowFields = $self->getPrefFieldsToShow;
my %data = ();
$self->uncacheOverrides;
+ my $i18n = WebGUI::International->new($self->session);
my $u = WebGUI::User->new($self->discernUserId);
foreach my $fieldId (keys %{$session{form}}) {
my $field = WebGUI::ProfileField->new($fieldId);
next unless $field;
$data{$field->getId} = $field->formProcess;
if ($field->getId eq 'email' && WebGUI::Operation::Profile::isDuplicateEmail($data{$field->getId})) {
- return ''.WebGUI::International::get(1072).' ';
+ return ''.$i18n->get(1072).' ';
}
if ($field->isRequired && !$data{$field->getId}) {
- return ''.$field->getLabel.' '.WebGUI::International::get(451).' ';
+ return ''.$field->getLabel.' '.$i18n->get(451).' ';
}
$u->profileField($field->getId,$data{$field->getId});
}
@@ -731,7 +738,7 @@ sub www_getNewTitle {
sub www_editOverride {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
- my $i18n = WebGUI::International->new("Asset_Shortcut");
+ my $i18n = WebGUI::International->new($self->session, "Asset_Shortcut");
my $fieldName = $self->session->form->process("fieldName");
my %overrides = $self->getOverrides;
my $output = '';
diff --git a/lib/WebGUI/Asset/Snippet.pm b/lib/WebGUI/Asset/Snippet.pm
index b6748841d..199f6670f 100644
--- a/lib/WebGUI/Asset/Snippet.pm
+++ b/lib/WebGUI/Asset/Snippet.pm
@@ -60,8 +60,9 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($self->session,"Asset_Snippet");
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_Snippet"),
+ assetName=>$i18n->get('assetName'),
uiLevel => 5,
icon=>'snippet.gif',
tableName=>'snippet',
@@ -104,20 +105,20 @@ sub getEditForm {
}
$tabform->getTab("properties")->codearea(
-name=>"snippet",
- -label=>WebGUI::International::get('assetName', 'Asset_Snippet'),
- -hoverHelp=>WebGUI::International::get('snippet description', 'Asset_Snippet'),
+ -label=>$i18n->get('assetName'),
+ -hoverHelp=>$i18n->get('snippet description'),
-value=>$self->getValue("snippet")
);
$tabform->getTab("properties")->yesNo(
-name=>"processAsTemplate",
- -label=>WebGUI::International::get('process as template', 'Asset_Snippet'),
- -hoverHelp=>WebGUI::International::get('process as template description', 'Asset_Snippet'),
+ -label=>$i18n->get('process as template'),
+ -hoverHelp=>$i18n->get('process as template description'),
-value=>$self->getValue("processAsTemplate")
);
$tabform->getTab("properties")->combo(
-name=>"mimeType",
- -label=>WebGUI::International::get('mimeType', 'Asset_Snippet'),
- -hoverHelp=>WebGUI::International::get('mimeType description', 'Asset_Snippet'),
+ -label=>$i18n->get('mimeType'),
+ -hoverHelp=>$i18n->get('mimeType description'),
-value=>[$self->getValue('mimeType')],
-options=>\%mimeTypes
);
@@ -160,7 +161,8 @@ sub www_edit {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
$self->getAdminConsole->setHelp("snippet add/edit","Asset_Snippet");
- return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get('snippet add/edit title',"Asset_Snippet"));
+ my $i18n = WebGUI::International->new($self->session, 'Asset_Snippet');
+ return $self->getAdminConsole->render($self->getEditForm->print,$i18n->get('snippet add/edit title'));
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm
index 6d231e729..9d5c3f031 100644
--- a/lib/WebGUI/Asset/Template.pm
+++ b/lib/WebGUI/Asset/Template.pm
@@ -78,7 +78,8 @@ sub _execute {
return $t->output;
} else {
$self->session->errorHandler->error("Error in template. ".$@);
- return WebGUI::International::get('template error', 'Asset_Template').$@;
+ my $i18n = WebGUI::International->new($self->session, 'Asset_Template');
+ return $i18n->get('template error').$@;
}
}
@@ -98,8 +99,9 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($self->session, 'Asset_Template');
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_Template"),
+ assetName=>$i18n->get('assetName'),
icon=>'template.gif',
tableName=>'template',
className=>'WebGUI::Asset::Template',
@@ -148,14 +150,14 @@ sub getEditForm {
$tabform->getTab("properties")->combo(
-name=>"namespace",
-options=>$namespaces,
- -label=>WebGUI::International::get('namespace','Asset_Template'),
- -hoverHelp=>WebGUI::International::get('namespace description','Asset_Template'),
+ -label=>$i18n->get('namespace'),
+ -hoverHelp=>$i18n->get('namespace description'),
-value=>[$self->session->form->process("namespace")]
);
} else {
$tabform->getTab("meta")->readOnly(
- -label=>WebGUI::International::get('namespace','Asset_Template'),
- -hoverHelp=>WebGUI::International::get('namespace description','Asset_Template'),
+ -label=>$i18n->get('namespace'),
+ -hoverHelp=>$i18n->get('namespace description'),
-value=>$self->getValue("namespace")
);
$tabform->getTab("meta")->hidden(
@@ -166,13 +168,13 @@ sub getEditForm {
$tabform->getTab("display")->yesNo(
-name=>"showInForms",
-value=>$self->getValue("showInForms"),
- -label=>WebGUI::International::get('show in forms', 'Asset_Template'),
- -hoverHelp=>WebGUI::International::get('show in forms description', 'Asset_Template'),
+ -label=>$i18n->get('show in forms'),
+ -hoverHelp=>$i18n->get('show in forms description'),
);
$tabform->getTab("properties")->codearea(
-name=>"template",
- -label=>WebGUI::International::get('assetName', 'Asset_Template'),
- -hoverHelp=>WebGUI::International::get('template description', 'Asset_Template'),
+ -label=>$i18n->get('assetName'),
+ -hoverHelp=>$i18n->get('template description'),
-value=>$self->getValue("template")
);
return $tabform;
@@ -328,8 +330,9 @@ sub www_edit {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
$self->getAdminConsole->setHelp("template add/edit","Asset_Template");
- $self->getAdminConsole->addSubmenuItem($self->getUrl('func=styleWizard'),WebGUI::International::get("style wizard","Asset_Template")) if ($self->get("namespace") eq "style");
- return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get('edit template', 'Asset_Template'));
+ my $i18n = WebGUI::International->new($self->session, 'Asset_Template');
+ $self->getAdminConsole->addSubmenuItem($self->getUrl('func=styleWizard'),$i18n->get("style wizard")) if ($self->get("namespace") eq "style");
+ return $self->getAdminConsole->render($self->getEditForm->print,$i18n->get('edit template'));
}
#-------------------------------------------------------------------
@@ -532,8 +535,9 @@ $style .= '
$output .= WebGUI::Form::submit($self->session,);
$output .= WebGUI::Form::formFooter($self->session,);
}
- $self->getAdminConsole->addSubmenuItem($self->getUrl('func=edit'),WebGUI::International::get("edit template","Asset_Template")) if ($self->get("url"));
- return $self->getAdminConsole->render($output,WebGUI::International::get('style wizard', 'Asset_Template'));
+ my $i18n = WebGUI::International->new($self->session, 'Asset_Template');
+ $self->getAdminConsole->addSubmenuItem($self->getUrl('func=edit'),$i18n->get("edit template")) if ($self->get("url"));
+ return $self->getAdminConsole->render($output,$i18n->get('style wizard'));
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Wobject.pm b/lib/WebGUI/Asset/Wobject.pm
index 1cf07ea7d..8102c4b16 100644
--- a/lib/WebGUI/Asset/Wobject.pm
+++ b/lib/WebGUI/Asset/Wobject.pm
@@ -66,6 +66,7 @@ An array of hashes to prepend to the list
sub definition {
my $class = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($self->session,'Wobject');
my %properties;
tie %properties, 'Tie::IxHash';
%properties = (
@@ -73,47 +74,47 @@ sub definition {
fieldType=>'HTMLArea',
defaultValue=>undef,
tab=>"properties",
- label=>WebGUI::International::get(85,'Wobject'),
- hoverHelp=>WebGUI::International::get('85 description','Wobject')
+ label=>$i18n->get(85),
+ hoverHelp=>$i18n->get('85 description')
},
displayTitle=>{
fieldType=>'yesNo',
defaultValue=>1,
tab=>"display",
- label=>WebGUI::International::get(174,'Wobject'),
- hoverHelp=>WebGUI::International::get('174 description','Wobject'),
+ label=>$i18n->get(174),
+ hoverHelp=>$i18n->get('174 description'),
uiLevel=>5
},
cacheTimeout=>{
fieldType=>'interval',
defaultValue=>60,
tab=>"display",
- label=>WebGUI::International::get(895,'Wobject'),
- hoverHelp=>WebGUI::International::get('895 description','Wobject'),
+ label=>$i18n->get(895),
+ hoverHelp=>$i18n->get('895 description'),
uiLevel=>8
},
cacheTimeoutVisitor=>{
fieldType=>'interval',
defaultValue=>600,
tab=>"display",
- label=>WebGUI::International::get(896,'Wobject'),
- hoverHelp=>WebGUI::International::get('896 description','Wobject'),
+ label=>$i18n->get(896),
+ hoverHelp=>$i18n->get('896 description'),
uiLevel=>8
},
styleTemplateId=>{
fieldType=>'template',
defaultValue=>undef,
tab=>"display",
- label=>WebGUI::International::get(1073,'Wobject'),
- hoverHelp=>WebGUI::International::get('1073 description','Wobject'),
+ label=>$i18n->get(1073),
+ hoverHelp=>$i18n->get('1073 description'),
namespace=>'style'
},
printableStyleTemplateId=>{
fieldType=>'template',
defaultValue=>undef,
tab=>"display",
- label=>WebGUI::International::get(1079,'Wobject'),
- hoverHelp=>WebGUI::International::get('1079 description','Wobject'),
+ label=>$i18n->get(1079),
+ hoverHelp=>$i18n->get('1079 description'),
namespace=>'style'
}
);
@@ -197,10 +198,11 @@ A comparison expression to be used when checking whether the action should be al
sub confirm {
return $self->session->privilege->vitalComponent() if ($_[4]);
my $noURL = $_[3] || $_[0]->getUrl;
- my $output = ''.WebGUI::International::get(42,'Wobject').' ';
+ my $i18n = WebGUI::International->new($self->session,'Wobject');
+ my $output = ''.$i18n->get(42).' ';
$output .= $_[1].'';
- $output .= '
';
+ $output .= '';
return $output;
}
@@ -559,7 +561,8 @@ sub www_edit {
$tag =~ s/([a-z])([A-Z])/$1 $2/g; #Separate studly caps
$tag =~ s/([A-Z]+(?![a-z]))/$1 /g; #Separate acronyms
$self->getAdminConsole->setHelp(lc($tag)." add/edit", "Asset_".$tag2);
- my $addEdit = ($self->session->form->process("func") eq 'add') ? WebGUI::International::get('add','Wobject') : WebGUI::International::get('edit','Wobject');
+ my $i18n = WebGUI::International->new($self->session,'Wobject');
+ my $addEdit = ($self->session->form->process("func") eq 'add') ? $i18n->get('add') : $i18n->get('edit');
return $self->getAdminConsole->render($self->getEditForm->print,$addEdit.' '.$self->getName);
}
diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm
index c99566a61..5bec0a343 100644
--- a/lib/WebGUI/Asset/Wobject/Article.pm
+++ b/lib/WebGUI/Asset/Wobject/Article.pm
@@ -70,7 +70,9 @@ text will come out formatted as paragraphs.
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,'Asset_Article');
my %properties;
tie %properties, 'Tie::IxHash';
%properties = (
@@ -79,44 +81,44 @@ sub definition {
defaultValue=>'PBtmpl0000000000000002',
tab=>"display",
namespace=>"Article",
- hoverHelp=>WebGUI::International::get('article template description','Asset_Article'),
- label=>WebGUI::International::get(72,"Asset_Article")
+ hoverHelp=>$i18n->get('article template description'),
+ label=>$i18n->get(72)
},
linkURL=>{
tab=>"properties",
fieldType=>'url',
defaultValue=>undef,
- label=>WebGUI::International::get(8,"Asset_Article"),
- hoverHelp=>WebGUI::International::get('link url description','Asset_Article'),
+ label=>$i18n->get(8),
+ hoverHelp=>$i18n->get('link url description'),
uiLevel=>3
},
linkTitle=>{
tab=>"properties",
fieldType=>'text',
defaultValue=>undef,
- label=>WebGUI::International::get(7,"Asset_Article"),
- hoverHelp=>WebGUI::International::get('link title description','Asset_Article'),
+ label=>$i18n->get(7),
+ hoverHelp=>$i18n->get('link title description'),
uiLevel=>3
},
convertCarriageReturns=>{
tab=>"display",
fieldType=>'yesNo',
defaultValue=>0,
- label=>WebGUI::International::get(10,"Asset_Article"),
- subtext=>' '.WebGUI::International::get(11,"Asset_Article").' ',
- hoverHelp=>WebGUI::International::get('carriage return description','Asset_Article'),
+ label=>$i18n->get(10),
+ subtext=>' '.$i18n->get(11).' ',
+ hoverHelp=>$i18n->get('carriage return description'),
uiLevel=>5
}
);
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_Article"),
+ assetName=>$i18n->get('assetName'),
icon=>'article.gif',
autoGenerateForms=>1,
tableName=>'Article',
className=>'WebGUI::Asset::Wobject::Article',
properties=>\%properties
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm
index b1cd18cfa..249ce1562 100644
--- a/lib/WebGUI/Asset/Wobject/Collaboration.pm
+++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm
@@ -117,7 +117,7 @@ sub appendPostListTemplateVars {
sub appendTemplateLabels {
my $self = shift;
my $var = shift;
- my $i18n = WebGUI::International->new("Asset_Collaboration");
+ my $i18n = WebGUI::International->new($self->session, "Asset_Collaboration");
$var->{"add.label"} = $i18n->get("add");
$var->{"addlink.label"} = $i18n->get("addlink");
$var->{"addquestion.label"} = $i18n->get("addquestion");
@@ -262,9 +262,11 @@ sub decrementThreads {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_Collaboration");
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_Collaboration"),
+ assetName=>$i18n->get('assetName'),
icon=>'collaboration.gif',
tableName=>'Collaboration',
className=>'WebGUI::Asset::Wobject::Collaboration',
@@ -415,7 +417,7 @@ sub definition {
}
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
@@ -430,95 +432,96 @@ sub duplicate {
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm;
+ my $i18n = WebGUI::International->new($self->session,"Asset_Collaboration");
$tabform->getTab("display")->yesNo(
-value=>$self->getValue('displayLastReply'),
- -label=>WebGUI::International::get('display last reply', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('display last reply description', 'Asset_Collaboration'),
+ -label=>$i18n->get('display last reply'),
+ -hoverHelp=>$i18n->get('display last reply description'),
-name=>"displayLastReply"
);
$tabform->getTab("display")->template(
-value=>$self->getValue('collaborationTemplateId'),
-namespace=>"Collaboration",
- -label=>WebGUI::International::get('system template', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('system template description', 'Asset_Collaboration'),
+ -label=>$i18n->get('system template'),
+ -hoverHelp=>$i18n->get('system template description'),
-name=>"collaborationTemplateId"
);
$tabform->getTab("display")->template(
-name=>"threadTemplateId",
-value=>$self->getValue("threadTemplateId"),
-namespace=>"Collaboration/Thread",
- -label=>WebGUI::International::get('thread template', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('thread template description', 'Asset_Collaboration'),
+ -label=>$i18n->get('thread template'),
+ -hoverHelp=>$i18n->get('thread template description'),
);
$tabform->getTab("display")->template(
-name=>"postFormTemplateId",
-value=>$self->getValue("postFormTemplateId"),
-namespace=>"Collaboration/PostForm",
- -label=>WebGUI::International::get('post template', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('post template description', 'Asset_Collaboration'),
+ -label=>$i18n->get('post template'),
+ -hoverHelp=>$i18n->get('post template description'),
);
$tabform->getTab("display")->template(
-name=>"searchTemplateId",
-value=>$self->getValue("SearchTemplateId"),
-namespace=>"Collaboration/Search",
- -label=>WebGUI::International::get('search template', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('search template description', 'Asset_Collaboration'),
+ -label=>$i18n->get('search template'),
+ -hoverHelp=>$i18n->get('search template description'),
);
$tabform->getTab("display")->template(
-name=>"notificationTemplateId",
-value=>$self->getValue("notificationTemplateId"),
-namespace=>"Collaboration/Notification",
- -label=>WebGUI::International::get('notification template', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('notification template description', 'Asset_Collaboration'),
+ -label=>$i18n->get('notification template'),
+ -hoverHelp=>$i18n->get('notification template description'),
);
$tabform->getTab("display")->template(
-name=>"rssTemplateId",
-value=>$self->getValue("rssTemplateId"),
-namespace=>"Collaboration/RSS",
- -label=>WebGUI::International::get('rss template', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('rss template description', 'Asset_Collaboration'),
+ -label=>$i18n->get('rss template'),
+ -hoverHelp=>$i18n->get('rss template description'),
);
$tabform->getTab("security")->group(
-name=>"moderateGroupId",
- -label=>WebGUI::International::get('who moderates', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('who moderates description', 'Asset_Collaboration'),
+ -label=>$i18n->get('who moderates'),
+ -hoverHelp=>$i18n->get('who moderates description'),
-value=>[$self->getValue("moderateGroupId")]
);
$tabform->getTab("security")->group(
-name=>"postGroupId",
- -label=>WebGUI::International::get('who posts', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('who posts description', 'Asset_Collaboration'),
+ -label=>$i18n->get('who posts'),
+ -hoverHelp=>$i18n->get('who posts description'),
-value=>[$self->getValue("postGroupId")]
);
$tabform->getTab("display")->integer(
-name=>"threadsPerPage",
- -label=>WebGUI::International::get('threads/page', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('threads/page description', 'Asset_Collaboration'),
+ -label=>$i18n->get('threads/page'),
+ -hoverHelp=>$i18n->get('threads/page description'),
-value=>$self->getValue("threadsPerPage")
);
$tabform->getTab("display")->integer(
-name=>"postsPerPage",
- -label=>WebGUI::International::get('posts/page', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('posts/page description', 'Asset_Collaboration'),
+ -label=>$i18n->get('posts/page'),
+ -hoverHelp=>$i18n->get('posts/page description'),
-value=>$self->getValue("postsPerPage")
);
if ($self->session->setting->get("useKarma")) {
$tabform->getTab("properties")->integer(
-name=>"karmaPerPost",
- -label=>WebGUI::International::get('karma/post', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('karma/post description', 'Asset_Collaboration'),
+ -label=>$i18n->get('karma/post'),
+ -hoverHelp=>$i18n->get('karma/post description'),
-value=>$self->getValue("karmaPerPost")
);
$tabform->getTab("properties")->integer(
-name=>"karmaSpentToRate",
- -label=>WebGUI::International::get('karma spent to rate', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('karma spent to rate description', 'Asset_Collaboration'),
+ -label=>$i18n->get('karma spent to rate'),
+ -hoverHelp=>$i18n->get('karma spent to rate description'),
-value=>$self->getValue("karmaSpentToRate")
);
$tabform->getTab("properties")->integer(
-name=>"karmaRatingMultiplier",
- -label=>WebGUI::International::get('karma rating multiplier', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('karma rating multiplier description', 'Asset_Collaboration'),
+ $i18n->get('karma rating multiplier'),
+ -hoverHelp=>$i18n->get('karma rating multiplier description'),
-value=>$self->getValue("karmaRatingMultiplier")
);
} else {
@@ -538,98 +541,98 @@ sub getEditForm {
$tabform->getTab("security")->filterContent(
-value=>$self->getValue("filterCode"),
-name=>"filterCode",
- -label=>WebGUI::International::get('filter code', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('filter code description', 'Asset_Collaboration'),
+ -label=>$i18n->get('filter code'),
+ -hoverHelp=>$i18n->get('filter code description'),
);
my %options;
tie %options, 'Tie::IxHash';
%options = (
- lineage=>WebGUI::International::get('sequence', 'Asset_Collaboration'),
- dateUpdated=>WebGUI::International::get('date updated', 'Asset_Collaboration'),
- dateSubmitted=>WebGUI::International::get('date submitted', 'Asset_Collaboration'),
- title=>WebGUI::International::get('title', 'Asset_Collaboration'),
- userDefined1=>WebGUI::International::get('user defined 1', 'Asset_Collaboration'),
- userDefined2=>WebGUI::International::get('user defined 2', 'Asset_Collaboration'),
- userDefined3=>WebGUI::International::get('user defined 3', 'Asset_Collaboration'),
- userDefined4=>WebGUI::International::get('user defined 4', 'Asset_Collaboration'),
- userDefined5=>WebGUI::International::get('user defined 5', 'Asset_Collaboration'),
+ lineage=>$i18n->get('sequence'),
+ dateUpdated=>$i18n->get('date updated'),
+ dateSubmitted=>$i18n->get('date submitted'),
+ title=>$i18n->get('title'),
+ userDefined1=>$i18n->get('user defined 1'),
+ userDefined2=>$i18n->get('user defined 2'),
+ userDefined3=>$i18n->get('user defined 3'),
+ userDefined4=>$i18n->get('user defined 4'),
+ userDefined5=>$i18n->get('user defined 5'),
);
$tabform->getTab("display")->selectBox(
-name=>"sortBy",
-value=>[$self->getValue("sortBy")],
-options=>\%options,
- -label=>WebGUI::International::get('sort by', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('sort by description', 'Asset_Collaboration'),
+ -label=>$i18n->get('sort by'),
+ -hoverHelp=>$i18n->get('sort by description'),
);
$tabform->getTab("display")->selectBox(
-name=>"sortOrder",
-value=>[$self->getValue("sortOrder")],
-options=>{
- asc=>WebGUI::International::get('ascending', 'Asset_Collaboration'),
- desc=>WebGUI::International::get('descending', 'Asset_Collaboration'),
+ asc=>$i18n->get('ascending'),
+ desc=>$i18n->get('descending'),
},
- -label=>WebGUI::International::get('sort order', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('sort order description', 'Asset_Collaboration'),
+ -label=>$i18n->get('sort order'),
+ -hoverHelp=>$i18n->get('sort order description'),
);
$tabform->getTab("properties")->interval(
-name=>"archiveAfter",
- -label=>WebGUI::International::get('archive after', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('archive after description', 'Asset_Collaboration'),
+ -label=>$i18n->get('archive after'),
+ -hoverHelp=>$i18n->get('archive after description'),
-value=>$self->getValue("archiveAfter")
);
$tabform->getTab("properties")->integer(
-name=>"attachmentsPerPost",
- -label=>WebGUI::International::get('attachments/post', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('attachments/post description', 'Asset_Collaboration'),
+ -label=>$i18n->get('attachments/post'),
+ -hoverHelp=>$i18n->get('attachments/post description'),
-value=>$self->getValue("attachmentsPerPost")
);
$tabform->getTab("security")->interval(
-name=>"editTimeout",
- -label=>WebGUI::International::get('edit timeout', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('edit timeout description', 'Asset_Collaboration'),
+ -label=>$i18n->get('edit timeout'),
+ -hoverHelp=>$i18n->get('edit timeout description'),
-value=>$self->getValue("editTimeout")
);
$tabform->getTab("security")->yesNo(
-name=>"allowReplies",
- -label=>WebGUI::International::get('allow replies', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('allow replies description', 'Asset_Collaboration'),
+ -label=>$i18n->get('allow replies'),
+ -hoverHelp=>$i18n->get('allow replies description'),
-value=>$self->getValue("allowReplies")
);
$tabform->getTab("security")->yesNo(
-name=>"addEditStampToPosts",
- -label=>WebGUI::International::get('edit stamp', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('edit stamp description', 'Asset_Collaboration'),
+ -label=>$i18n->get('edit stamp'),
+ -hoverHelp=>$i18n->get('edit stamp description'),
-value=>$self->getValue("addEditStampToPosts")
);
$tabform->getTab("display")->selectBox(
-name=>"richEditor",
- -label=>WebGUI::International::get('rich editor', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('rich editor description', 'Asset_Collaboration'),
+ -label=>$i18n->get('rich editor'),
+ -hoverHelp=>$i18n->get('rich editor description'),
-options=>$self->session->db->buildHashRef("select distinct(assetData.assetId), assetData.title from asset, assetData where asset.className='WebGUI::Asset::RichEdit' and asset.assetId=assetData.assetId order by assetData.title"),
-value=>[$self->getValue("richEditor")]
);
$tabform->getTab("display")->yesNo(
-name=>"useContentFilter",
- -label=>WebGUI::International::get('content filter', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('content filter description', 'Asset_Collaboration'),
+ -label=>$i18n->get('content filter'),
+ -hoverHelp=>$i18n->get('content filter description'),
-value=>$self->getValue("useContentFilter")
);
$tabform->getTab("properties")->yesNo(
-name=>"usePreview",
- -label=>WebGUI::International::get('use preview', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('use preview description', 'Asset_Collaboration'),
+ -label=>$i18n->get('use preview'),
+ -hoverHelp=>$i18n->get('use preview description'),
-value=>$self->getValue("usePreview")
);
$tabform->getTab("properties")->yesNo(
-name=>"avatarsEnabled",
- -label=>WebGUI::International::get('enable avatars', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('enable avatars description', 'Asset_Collaboration'),
+ -label=>$i18n->get('enable avatars'),
+ -hoverHelp=>$i18n->get('enable avatars description'),
-value=>$self->getValue("avatarsEnabled")
);
$tabform->getTab("security")->yesNo(
-name=>"moderatePosts",
- -label=>WebGUI::International::get('moderate', 'Asset_Collaboration'),
- -hoverHelp=>WebGUI::International::get('moderate description', 'Asset_Collaboration'),
+ -label=>$i18n->get('moderate'),
+ -hoverHelp=>$i18n->get('moderate description'),
-value=>$self->getValue("moderatePosts")
);
return $tabform;
@@ -959,6 +962,7 @@ sub www_search {
$self->session->scratch->set($self->getId."_exactPhrase",$self->session->form->process("exactPhrase"));
$self->session->scratch->set($self->getId."_without",$self->session->form->process("without"));
$self->session->scratch->set($self->getId."_numResults",$self->session->form->process("numResults"));
+ my $i18n = WebGUI::International->new($self->session, 'Asset_Collaboration');
my %var;
$var{'form.header'} = WebGUI::Form::formHeader($self->session,{action=>$self->getUrl})
.WebGUI::Form::hidden($self->session,{ name=>"func", value=>"search" })
@@ -992,7 +996,7 @@ sub www_search {
options=>\%results,
value=>[$numResults]
});
- $var{'form.search'} = WebGUI::Form::submit($self->session,{value=>WebGUI::International::get(170)});
+ $var{'form.search'} = WebGUI::Form::submit($self->session,{value=>$i18n->get(170)});
$var{'form.footer'} = WebGUI::Form::formFooter($self->session,);
$var{'back.url'} = $self->getUrl;
$self->appendTemplateLabels(\%var);
diff --git a/lib/WebGUI/Asset/Wobject/Dashboard.pm b/lib/WebGUI/Asset/Wobject/Dashboard.pm
index e9de42099..bfec0dff7 100644
--- a/lib/WebGUI/Asset/Wobject/Dashboard.pm
+++ b/lib/WebGUI/Asset/Wobject/Dashboard.pm
@@ -43,6 +43,7 @@ sub canPersonalize {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ return $class->SUPER::definition($definition);
my $definition = shift;
my %properties;
tie %properties, 'Tie::IxHash';
@@ -71,14 +72,15 @@ sub definition {
},
);
+ my $i18n = WebGUI::International->new($session,"Asset_Dashboard");
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_Dashboard"),
+ assetName=>$i18n->get('assetName'),
icon=>'dashboard.gif',
tableName=>'Dashboard',
className=>'WebGUI::Asset::Wobject::Dashboard',
properties=>\%properties
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
@@ -99,7 +101,7 @@ sub discernUserId {
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm;
- my $i18n = WebGUI::International->new("Asset_Dashboard");
+ my $i18n = WebGUI::International->new($self->session, "Asset_Dashboard");
$tabform->getTab("display")->template(
-name=>"templateId",
-value=>$self->getValue('templateId'),
@@ -130,8 +132,8 @@ sub getEditForm {
-name=>"assetsToHide",
-value=>\@assetsToHide,
-options=>\%childIds,
- -label=>WebGUI::International::get('assets to hide', 'Asset_Layout'),
- -hoverHelp=>WebGUI::International::get('assets to hide description', 'Asset_Layout'),
+ -label=>$i18n->get('assets to hide', 'Asset_Layout'),
+ -hoverHelp=>$i18n->get('assets to hide description', 'Asset_Layout'),
-vertical=>1,
-uiLevel=>9
);
@@ -302,4 +304,4 @@ sub www_view {
-1;
\ No newline at end of file
+1;
diff --git a/lib/WebGUI/Asset/Wobject/DataForm.pm b/lib/WebGUI/Asset/Wobject/DataForm.pm
index f2fdc7592..41daedce7 100644
--- a/lib/WebGUI/Asset/Wobject/DataForm.pm
+++ b/lib/WebGUI/Asset/Wobject/DataForm.pm
@@ -90,8 +90,9 @@ sub _fieldAdminIcons {
my $fid = shift;
my $tid = shift;
my $cantDelete = shift;
+ my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
my $output;
- $output = $self->session->icon->delete('func=deleteFieldConfirm;fid='.$fid.';tid='.$tid,$self->get("url"),WebGUI::International::get(19,"Asset_DataForm")) unless ($cantDelete);
+ $output = $self->session->icon->delete('func=deleteFieldConfirm;fid='.$fid.';tid='.$tid,$self->get("url"),$i18n->get(19)) unless ($cantDelete);
$output .= $self->session->icon->edit('func=editField;fid='.$fid.';tid='.$tid,$self->get("url"))
.$self->session->icon->moveUp('func=moveFieldUp;fid='.$fid.';tid='.$tid,$self->get("url"))
.$self->session->icon->moveDown('func=moveFieldDown;fid='.$fid.';tid='.$tid,$self->get("url"));
@@ -102,8 +103,9 @@ sub _tabAdminIcons {
my $self = shift;
my $tid = shift;
my $cantDelete = shift;
+ my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
my $output;
- $output = $self->session->icon->delete('func=deleteTabConfirm;tid='.$tid,$self->get("url"),WebGUI::International::get(100,"Asset_DataForm")) unless ($cantDelete);
+ $output = $self->session->icon->delete('func=deleteTabConfirm;tid='.$tid,$self->get("url"),$i18n->get(100)) unless ($cantDelete);
$output .= $self->session->icon->edit('func=editTab;tid='.$tid,$self->get("url"))
.$self->session->icon->moveLeft('func=moveTabLeft;tid='.$tid,$self->get("url"))
.$self->session->icon->moveRight('func=moveTabRight;tid='.$tid,$self->get("url"));
@@ -135,9 +137,11 @@ sub defaultViewForm {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_DataForm");
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_DataForm"),
+ assetName=>$i18n->get('assetName'),
uiLevel => 5,
tableName=>'DataForm',
icon=>'dataForm.gif',
@@ -177,7 +181,7 @@ sub definition {
},
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
@@ -212,13 +216,14 @@ sub duplicate {
#-------------------------------------------------------------------
sub getEditForm {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
my $tabform = $self->SUPER::getEditForm;
$tabform->getTab("display")->template(
-name=>"templateId",
-value=>$self->getValue("templateId"),
-namespace=>"DataForm",
- -label=>WebGUI::International::get(82,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('82 description',"Asset_DataForm"),
+ -label=>$i18n->get(82),
+ -hoverHelp=>$i18n->get('82 description'),
-afterEdit=>'func=edit',
-defaultValue=>"PBtmpl0000000000000141"
);
@@ -226,59 +231,59 @@ sub getEditForm {
-name=>"emailTemplateId",
-value=>$self->getValue("emailTemplateId"),
-namespace=>"DataForm",
- -label=>WebGUI::International::get(80,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('80 description',"Asset_DataForm"),
+ -label=>$i18n->get(80),
+ -hoverHelp=>$i18n->get('80 description'),
-afterEdit=>'func=edit'
);
$tabform->getTab("display")->template(
-name=>"acknowlegementTemplateId",
-value=>$self->getValue("acknowlegementTemplateId"),
-namespace=>"DataForm",
- -label=>WebGUI::International::get(81,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('81 description',"Asset_DataForm"),
+ -label=>$i18n->get(81),
+ -hoverHelp=>$i18n->get('81 description'),
-afterEdit=>'func=edit'
);
$tabform->getTab("display")->template(
-name=>"listTemplateId",
-value=>$self->getValue("listTemplateId"),
-namespace=>"DataForm/List",
- -label=>WebGUI::International::get(87,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('87 description',"Asset_DataForm"),
+ -label=>$i18n->get(87),
+ -hoverHelp=>$i18n->get('87 description'),
-afterEdit=>'func=edit'
);
$tabform->getTab("display")->radioList(
-name=>"defaultView",
- -options=>{ 0 => WebGUI::International::get('data form','Asset_DataForm'),
- 1 => WebGUI::International::get('data list','Asset_DataForm'),},
- -label=>WebGUI::International::get('defaultView',"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('defaultView description',"Asset_DataForm"),
+ -options=>{ 0 => $i18n->get('data form'),
+ 1 => $i18n->get('data list'),},
+ -label=>$i18n->get('defaultView'),
+ -hoverHelp=>$i18n->get('defaultView description'),
-value=>$self->getValue("defaultView"),
);
$tabform->getTab("properties")->HTMLArea(
-name=>"acknowledgement",
- -label=>WebGUI::International::get(16, "Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('16 description', "Asset_DataForm"),
- -value=>($self->get("acknowledgement") || WebGUI::International::get(3, "Asset_DataForm"))
+ -label=>$i18n->get(16),
+ -hoverHelp=>$i18n->get('16 description'),
+ -value=>($self->get("acknowledgement") || $i18n->get(3))
);
$tabform->getTab("properties")->yesNo(
-name=>"mailData",
- -label=>WebGUI::International::get(74,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('74 description',"Asset_DataForm"),
+ -label=>$i18n->get(74),
+ -hoverHelp=>$i18n->get('74 description'),
-value=>$self->getValue("mailData")
);
$tabform->getTab("security")->group(
-name=>"groupToViewEntries",
- -label=>WebGUI::International::get('group to view entries', "Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('group to view entries description',"Asset_DataForm"),
+ -label=>$i18n->get('group to view entries'),
+ -hoverHelp=>$i18n->get('group to view entries description'),
-value=>$self->getValue("groupToViewEntries")
);
if ($self->getId eq "new" && $self->session->form->process("proceed") ne "manageAssets") {
$tabform->getTab("properties")->whatNext(
-options=>{
- editField=>WebGUI::International::get(76,"Asset_DataForm"),
- ""=>WebGUI::International::get(745,"Asset_DataForm")
+ editField=>$i18n->get(76),
+ ""=>$i18n->get(745)
},
-value=>"editField"
);
@@ -292,12 +297,13 @@ sub getEditForm {
sub getListTemplateVars {
my $self = shift;
my $var = shift;
+ my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
my @fieldLoop;
$var->{"back.url"} = $self->getFormUrl;
- $var->{"back.label"} = WebGUI::International::get('go to form',"Asset_DataForm");
+ $var->{"back.label"} = $i18n->get('go to form');
#$var->{"entryId"} = $self->getId;
#$var->{"delete.url"} = $self->getUrl.";func=deleteAllEntries";
- #$var->{"delete.label"} = WebGUI::International::get(91,"Asset_DataForm");
+ #$var->{"delete.label"} = $i18n->get(91);
my $fields = $self->session->db->read("select DataForm_fieldId,name,label,isMailField,type from DataForm_field
where assetId=".$self->session->db->quote($self->getId)." order by sequenceNumber");
while (my $field = $fields->hashRef) {
@@ -333,7 +339,7 @@ sub getListTemplateVars {
"record.edit.url"=>$self->getUrl("func=view;entryId=".$record->{DataForm_entryId}),
"record.edit.icon"=>$self->session->icon->edit("func=view;entryId=".$record->{DataForm_entryId}, $self->getUrl),
"record.delete.url"=>$self->getUrl("func=deleteEntry;entryId=".$record->{DataForm_entryId}),
- "record.delete.icon"=>$self->session->icon->delete("func=deleteEntry;entryId=".$record->{Asset_DataForm_entryId}, $self->getUrl, WebGUI::International::get('Delete entry confirmation',"Asset_DataForm")),
+ "record.delete.icon"=>$self->session->icon->delete("func=deleteEntry;entryId=".$record->{Asset_DataForm_entryId}, $self->getUrl, $i18n->get('Delete entry confirmation')),
"record.username"=>$record->{username},
"record.userId"=>$record->{userId},
"record.submissionDate.epoch"=>$record->{submissionDate},
@@ -381,21 +387,22 @@ sub getListUrl {
sub getRecordTemplateVars {
my $self = shift;
my $var = shift;
+ my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
$var->{error_loop} = [] unless (exists $var->{error_loop});
$var->{canEdit} = ($self->canEdit);
#$var->{"entryList.url"} = $self->getUrl('func=view;entryId=list');
$var->{"entryList.url"} = $self->getListUrl;
- $var->{"entryList.label"} = WebGUI::International::get(86,"Asset_DataForm");
+ $var->{"entryList.label"} = $i18n->get(86);
$var->{"export.tab.url"} = $self->getUrl('func=exportTab');
- $var->{"export.tab.label"} = WebGUI::International::get(84,"Asset_DataForm");
+ $var->{"export.tab.label"} = $i18n->get(84);
$var->{"delete.url"} = $self->getUrl('func=deleteEntry;entryId='.$var->{entryId});
- $var->{"delete.label"} = WebGUI::International::get(90,"Asset_DataForm");
+ $var->{"delete.label"} = $i18n->get(90);
$var->{"back.url"} = $self->getUrl;
- $var->{"back.label"} = WebGUI::International::get(18,"Asset_DataForm");
+ $var->{"back.label"} = $i18n->get(18);
$var->{"addField.url"} = $self->getUrl('func=editField');
- $var->{"addField.label"} = WebGUI::International::get(76,"Asset_DataForm");
+ $var->{"addField.label"} = $i18n->get(76);
# add Tab label, url, header and init
- $var->{"addTab.label"}= WebGUI::International::get(105,"Asset_DataForm");;
+ $var->{"addTab.label"}= $i18n->get(105);;
$var->{"addTab.url"}= $self->getUrl('func=editTab');
$var->{"tab.init"}= _createTabInit($self->getId);
$var->{"form.start"} = WebGUI::Form::formHeader($self->session,{action=>$self->getUrl})
@@ -507,7 +514,7 @@ sub getRecordTemplateVars {
$var->{field_loop} = \@fields;
$tabsth->finish;
$var->{tab_loop} = \@tabs;
- $var->{"form.send"} = WebGUI::Form::submit($self->session,{value=>WebGUI::International::get(73, "Asset_DataForm")});
+ $var->{"form.send"} = WebGUI::Form::submit($self->session,{value=>$i18n->get(73)});
$var->{"form.save"} = WebGUI::Form::submit($self->session,);
$var->{"form.end"} = WebGUI::Form::formFooter($self->session,);
return $var;
@@ -519,12 +526,13 @@ sub getRecordTemplateVars {
sub processPropertiesFromFormPost {
my $self = shift;
$self->SUPER::processPropertiesFromFormPost;
+ my $i18n = WebGUI::International->new($self->session, "Asset_DataForm");
if ($self->session->form->process("assetId") eq "new") {
$self->setCollateral("DataForm_field","DataForm_fieldId",{
DataForm_fieldId=>"new",
DataForm_tabId=>0,
name=>"from",
- label=>WebGUI::International::get(10,"Asset_DataForm"),
+ label=>$i18n->get(10),
status=>"editable",
isMailField=>1,
width=>0,
@@ -534,7 +542,7 @@ sub processPropertiesFromFormPost {
DataForm_fieldId=>"new",
DataForm_tabId=>0,
name=>"to",
- label=>WebGUI::International::get(11,"Asset_DataForm"),
+ label=>$i18n->get(11),
status=>"hidden",
isMailField=>1,
width=>0,
@@ -545,7 +553,7 @@ sub processPropertiesFromFormPost {
DataForm_fieldId=>"new",
DataForm_tabId=>0,
name=>"cc",
- label=>WebGUI::International::get(12,"Asset_DataForm"),
+ label=>$i18n->get(12),
status=>"hidden",
isMailField=>1,
width=>0,
@@ -555,7 +563,7 @@ sub processPropertiesFromFormPost {
DataForm_fieldId=>"new",
DataForm_tabId=>0,
name=>"bcc",
- label=>WebGUI::International::get(13,"Asset_DataForm"),
+ label=>$i18n->get(13),
status=>"hidden",
isMailField=>1,
width=>0,
@@ -565,12 +573,12 @@ sub processPropertiesFromFormPost {
DataForm_fieldId=>"new",
DataForm_tabId=>0,
name=>"subject",
- label=>WebGUI::International::get(14,"Asset_DataForm"),
+ label=>$i18n->get(14),
status=>"editable",
isMailField=>1,
width=>0,
type=>"text",
- defaultValue=>WebGUI::International::get(2,"Asset_DataForm")
+ defaultValue=>$i18n->get(2)
});
}
if ($self->session->form->process("fid") eq "new") { # hack to get proceed to work.
@@ -742,21 +750,22 @@ sub www_deleteTabConfirm {
sub www_editField {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
+ my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
my (%field, $f, %fieldStatus,$tab);
tie %field, 'Tie::CPHash';
tie %fieldStatus, 'Tie::IxHash';
%fieldStatus = (
- "hidden" => WebGUI::International::get(4, "Asset_DataForm"),
- "visible" => WebGUI::International::get(5, "Asset_DataForm"),
- "editable" => WebGUI::International::get(6, "Asset_DataForm"),
- "required" => WebGUI::International::get(75, "Asset_DataForm")
+ "hidden" => $i18n->get(4),
+ "visible" => $i18n->get(5),
+ "editable" => $i18n->get(6),
+ "required" => $i18n->get(75)
);
$self->session->form->process("fid") = "new" if ($self->session->form->process("fid") eq "");
unless ($self->session->form->process("fid") eq "new") {
%field = $self->session->db->quickHash("select * from DataForm_field where DataForm_fieldId=".$self->session->db->quote($self->session->form->process("fid")));
}
$tab = $self->session->db->buildHashRef("select DataForm_tabId,label from DataForm_tab where assetId=".$self->session->db->quote($self->getId));
- $tab->{0} = WebGUI::International::get("no tab","Asset_DataForm");
+ $tab->{0} = $i18n->get("no tab");
$f = WebGUI::HTMLForm->new($self->session,-action=>$self->getUrl);
$f->hidden(
-name => "fid",
@@ -768,96 +777,96 @@ sub www_editField {
);
$f->text(
-name=>"label",
- -label=>WebGUI::International::get(77,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('77 description',"Asset_DataForm"),
+ -label=>$i18n->get(77),
+ -hoverHelp=>$i18n->get('77 description'),
-value=>$field{label}
);
$f->text(
-name=>"name",
- -label=>WebGUI::International::get(21,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('21 description',"Asset_DataForm"),
+ -label=>$i18n->get(21),
+ -hoverHelp=>$i18n->get('21 description'),
-value=>$field{name}
);
if($field{sequenceNumber} && ! $field{isMailField}) {
$f->integer(
-name=>"position",
- -label=>WebGUI::International::get('Field Position',"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('Field Position description',"Asset_DataForm"),
+ -label=>$i18n->get('Field Position'),
+ -hoverHelp=>$i18n->get('Field Position description'),
-value=>$field{sequenceNumber}
);
}
$f->selectBox(
-name=>"tid",
-options=>$tab,
- -label=>WebGUI::International::get(104,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('104 description',"Asset_DataForm"),
+ -label=>$i18n->get(104),
+ -hoverHelp=>$i18n->get('104 description'),
-value=>[ $field{DataForm_tabId} || 0 ]
);
$f->text(
-name=>"subtext",
-value=>$field{subtext},
- -label=>WebGUI::International::get(79,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('79 description',"Asset_DataForm"),
+ -label=>$i18n->get(79),
+ -hoverHelp=>$i18n->get('79 description'),
);
$f->selectBox(
-name=>"status",
-options=>\%fieldStatus,
- -label=>WebGUI::International::get(22,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('22 description',"Asset_DataForm"),
+ -label=>$i18n->get(22),
+ -hoverHelp=>$i18n->get('22 description'),
-value=> [ $field{status} || "editable" ] ,
);
$f->fieldType(
-name=>"type",
- -label=>WebGUI::International::get(23,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('23 description',"Asset_DataForm"),
+ -label=>$i18n->get(23),
+ -hoverHelp=>$i18n->get('23 description'),
-value=>$field{type} || "text",
-types=>[qw(dateTime TimeField float zipcode text textarea HTMLArea url date email phone integer yesNo selectList radioList checkList)]
);
$f->integer(
-name=>"width",
- -label=>WebGUI::International::get(8,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('8 description',"Asset_DataForm"),
+ -label=>$i18n->get(8),
+ -hoverHelp=>$i18n->get('8 description'),
-value=>($field{width} || 0)
);
$f->integer(
-name=>"rows",
-value=>$field{rows} || 0,
- -label=>WebGUI::International::get(27,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('27 description',"Asset_DataForm"),
- -subtext=>WebGUI::International::get(28,"Asset_DataForm"),
+ -label=>$i18n->get(27),
+ -hoverHelp=>$i18n->get('27 description'),
+ -subtext=>$i18n->get(28),
);
$f->yesNo(
-name=>"vertical",
-value=>$field{vertical},
- -label=>WebGUI::International::get('editField vertical label', "Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('editField vertical label description', "Asset_DataForm"),
- -subtext=>WebGUI::International::get('editField vertical subtext', "Asset_DataForm")
+ -label=>$i18n->get('editField vertical label'),
+ -hoverHelp=>$i18n->get('editField vertical label description'),
+ -subtext=>$i18n->get('editField vertical subtext')
);
$f->text(
-name=>"extras",
-value=>$field{extras},
- -label=>WebGUI::International::get('editField extras label', "Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('editField extras label description', "Asset_DataForm"),
+ -label=>$i18n->get('editField extras label'),
+ -hoverHelp=>$i18n->get('editField extras label description'),
);
$f->textarea(
-name=>"possibleValues",
- -label=>WebGUI::International::get(24,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('24 description',"Asset_DataForm"),
+ -label=>$i18n->get(24),
+ -hoverHelp=>$i18n->get('24 description'),
-value=>$field{possibleValues},
- -subtext=>' '.WebGUI::International::get(85,"Asset_DataForm")
+ -subtext=>' '.$i18n->get(85)
);
$f->textarea(
-name=>"defaultValue",
- -label=>WebGUI::International::get(25,"Asset_DataForm"),
- -hoverHelp=>WebGUI::International::get('25 description',"Asset_DataForm"),
+ -label=>$i18n->get(25),
+ -hoverHelp=>$i18n->get('25 description'),
-value=>$field{defaultValue},
- -subtext=>' '.WebGUI::International::get(85,"Asset_DataForm")
+ -subtext=>' '.$i18n->get(85)
);
if ($self->session->form->process("fid") eq "new" && $self->session->form->process("proceed") ne "manageAssets") {
$f->whatNext(
-options=>{
- "editField"=>WebGUI::International::get(76,"Asset_DataForm"),
- "viewDataForm"=>WebGUI::International::get(745,"Asset_DataForm")
+ "editField"=>$i18n->get(76),
+ "viewDataForm"=>$i18n->get(745)
},
-value=>"editField"
);
@@ -865,7 +874,7 @@ sub www_editField {
$f->submit;
my $ac = $self->getAdminConsole;
$ac->setHelp("data form fields add/edit","Asset_DataForm");
- return $ac->render($f->print,WebGUI::International::get('20',"Asset_DataForm"));
+ return $ac->render($f->print,$i18n->get('20'));
}
#-------------------------------------------------------------------
@@ -908,6 +917,7 @@ sub www_editFieldSave {
sub www_editTab {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
+ my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
my (%tab, $f);
tie %tab, 'Tie::CPHash';
$self->session->form->process("tid") = "new" if ($self->session->form->process("tid") eq "");
@@ -925,20 +935,20 @@ sub www_editTab {
);
$f->text(
-name=>"label",
- -label=>WebGUI::International::get(101,"Asset_DataForm"),
+ -label=>$i18n->get(101),
-value=>$tab{label}
);
$f->textarea(
-name=>"subtext",
- -label=>WebGUI::International::get(79,"Asset_DataForm"),
+ -label=>$i18n->get(79),
-value=>$tab{subtext},
-subtext=>""
);
if ($self->session->form->process("tid") eq "new") {
$f->whatNext(
-options=>{
- editTab=>WebGUI::International::get(103,"Asset_DataForm"),
- ""=>WebGUI::International::get(745,"Asset_DataForm")
+ editTab=>$i18n->get(103),
+ ""=>$i18n->get(745)
},
-value=>"editTab"
);
@@ -946,7 +956,7 @@ sub www_editTab {
$f->submit;
my $ac = $self->getAdminConsole;
$ac->setHelp("data form fields add/edit","Asset_DataForm");
- return $ac->render($f->print,WebGUI::International::get('20',"Asset_DataForm"));
+ return $ac->render($f->print,$i18n->get('20'));
}
#-------------------------------------------------------------------
@@ -1064,6 +1074,7 @@ sub www_process {
},0);
my ($var, %row, @errors, $updating, $hadErrors);
$var->{entryId} = $entryId;
+ my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
tie %row, "Tie::CPHash";
my $sth = $self->session->db->read("select DataForm_fieldId,label,name,status,type,defaultValue,isMailField from DataForm_field
where assetId=".$self->session->db->quote($self->getId)." order by sequenceNumber");
@@ -1076,7 +1087,7 @@ sub www_process {
}
if ($row{status} eq "required" && ($value =~ /^\s$/ || $value eq "" || not defined $value)) {
push (@errors,{
- "error.message"=>$row{label}." ".WebGUI::International::get(29,"Asset_DataForm").".",
+ "error.message"=>$row{label}." ".$i18n->get(29).".",
});
$hadErrors = 1;
delete $var->{entryId};
diff --git a/lib/WebGUI/Asset/Wobject/EventsCalendar.pm b/lib/WebGUI/Asset/Wobject/EventsCalendar.pm
index de3b56f88..b378a8bc4 100644
--- a/lib/WebGUI/Asset/Wobject/EventsCalendar.pm
+++ b/lib/WebGUI/Asset/Wobject/EventsCalendar.pm
@@ -41,9 +41,11 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_EventsCalendar");
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_EventsCalendar"),
+ assetName=>$i18n->get('assetName'),
uiLevel => 9,
icon=>'calendar.gif',
tableName=>'EventsCalendar',
@@ -79,7 +81,7 @@ sub definition {
}
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
@@ -107,75 +109,76 @@ sub epochToArray {
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
+ my $i18n = WebGUI::International->new($self->session,"Asset_EventsCalendar");
$tabform->getTab("properties")->selectBox(
-name=>"scope",
- -label=>WebGUI::International::get(507,"Asset_EventsCalendar"),
- -hoverHelp=>WebGUI::International::get('507 description',"Asset_EventsCalendar"),
+ -label=>$i18n->get(507),
+ -hoverHelp=>$i18n->get('507 description'),
-value=>[$self->getValue("scope")],
-options=>{
- 0=>WebGUI::International::get(508,"Asset_EventsCalendar"),
- 1=>WebGUI::International::get(510,"Asset_EventsCalendar"),
- 2=>WebGUI::International::get(509,"Asset_EventsCalendar"),
+ 0=>$i18n->get(508),
+ 1=>$i18n->get(510),
+ 2=>$i18n->get(509),
}
);
$tabform->getTab("display")->template(
-name=>"templateId",
- -label=>WebGUI::International::get(94,"Asset_EventsCalendar"),
- -hoverHelp=>WebGUI::International::get('94 description',"Asset_EventsCalendar"),
+ -label=>$i18n->get(94),
+ -hoverHelp=>$i18n->get('94 description'),
-value=>$self->getValue('templateId'),
-namespace=>"EventsCalendar"
);
$tabform->getTab("display")->template(
-name=>"eventTemplateId",
- -label=>WebGUI::International::get(80,"Asset_EventsCalendar"),
- -hoverHelp=>WebGUI::International::get('80 description',"Asset_EventsCalendar"),
+ -label=>$i18n->get(80),
+ -hoverHelp=>$i18n->get('80 description'),
-value=>$self->getValue('eventTemplateId'),
-namespace=>"EventsCalendar/Event",
);
$tabform->getTab("display")->selectBox(
-name=>"startMonth",
-options=>{
- "january"=>WebGUI::International::get('january','DateTime'),
- "now"=>WebGUI::International::get(98,"Asset_EventsCalendar"),
- "current"=>WebGUI::International::get(82,"Asset_EventsCalendar"),
- "first"=>WebGUI::International::get(83,"Asset_EventsCalendar")
+ "january"=>$i18n->get('january'),
+ "now"=>$i18n->get(98),
+ "current"=>$i18n->get(82),
+ "first"=>$i18n->get(83)
},
- -label=>WebGUI::International::get(81,"Asset_EventsCalendar"),
- -hoverHelp=>WebGUI::International::get('81 description',"Asset_EventsCalendar"),
+ -label=>$i18n->get(81),
+ -hoverHelp=>$i18n->get('81 description'),
-value=>[$self->getValue("startMonth")]
);
my %options;
tie %options, 'Tie::IxHash';
%options = (
- "last"=>WebGUI::International::get(85,"Asset_EventsCalendar"),
- "after12"=>WebGUI::International::get(86,"Asset_EventsCalendar"),
- "after9"=>WebGUI::International::get(87,"Asset_EventsCalendar"),
- "after6"=>WebGUI::International::get(88,"Asset_EventsCalendar"),
- "after3"=>WebGUI::International::get(89,"Asset_EventsCalendar"),
- "current"=>WebGUI::International::get(82,"Asset_EventsCalendar")
+ "last"=>$i18n->get(85),
+ "after12"=>$i18n->get(86),
+ "after9"=$i18n->get(87),
+ "after6"=>$i18n->get(88),
+ "after3"=>$i18n->get(89),
+ "current"=>$i18n->get(82)
);
$tabform->getTab("display")->selectBox(
-name=>"endMonth",
-options=>\%options,
- -label=>WebGUI::International::get(84,"Asset_EventsCalendar"),
- -hoverHelp=>WebGUI::International::get('84 description',"Asset_EventsCalendar"),
+ -label=>$i18n->get(84),
+ -hoverHelp=>$i18n->get('84 description'),
-value=>[$self->getValue("endMonth")]
);
$tabform->getTab("display")->selectBox(
-name=>"defaultMonth",
-options=>{
- "current"=>WebGUI::International::get(82,"Asset_EventsCalendar"),
- "last"=>WebGUI::International::get(85,"Asset_EventsCalendar"),
- "first"=>WebGUI::International::get(83,"Asset_EventsCalendar")
+ "current"=>$i18n->get(82),
+ "last"=>$i18n->get(85),
+ "first"=>$i18n->get(83)
},
- -label=>WebGUI::International::get(90,"Asset_EventsCalendar"),
- -hoverHelp=>WebGUI::International::get('90 description',"Asset_EventsCalendar"),
+ -label=>$i18n->get(90),
+ -hoverHelp=>$i18n->get('90 description'),
-value=>[$self->getValue("defaultMonth")]
);
$tabform->getTab("display")->integer(
-name=>"paginateAfter",
- -label=>WebGUI::International::get(19,"Asset_EventsCalendar"),
- -hoverHelp=>WebGUI::International::get('19 description',"Asset_EventsCalendar"),
+ -label=>$i18n->get(19),
+ -hoverHelp=>$i18n->get('19 description'),
-value=>$self->getValue("paginateAfter")
);
return $tabform;
@@ -186,6 +189,7 @@ sub getEditForm {
#-------------------------------------------------------------------
sub view {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session,"Asset_EventsCalendar");
#define default view month range. Note that this could be different from
#the range a user is allowed to view - set by the events calendar limitations.
my $monthRangeLength = int($self->get("paginateAfter"));
@@ -400,7 +404,7 @@ sub view {
my %var;
$var{month_loop} = \@$monthloop;
$var{"addevent.url"} = $self->getUrl().'?func=add;class=WebGUI::Asset::Event';
- $var{"addevent.label"} = WebGUI::International::get(20,"Asset_EventsCalendar");
+ $var{"addevent.label"} = $i18n->get(20);
$var{'sunday.label'} = $self->session->datetime->getDayName(7);
$var{'monday.label'} = $self->session->datetime->getDayName(1);
$var{'tuesday.label'} = $self->session->datetime->getDayName(2);
@@ -423,9 +427,9 @@ sub view {
my $nextCalMonthEnd = $calMonthEnd + $monthRangeLength;
my $monthLabel;
if ($monthRangeLength == 1) {
- $monthLabel = WebGUI::International::get(560,"Asset_EventsCalendar");
+ $monthLabel = $i18n->get(560);
} else {
- $monthLabel = WebGUI::International::get(561,"Asset_EventsCalendar");
+ $monthLabel = $i18n->get(561);
}
$var{'pagination.previousPageUrl'} =
$self->getUrl.'?calMonthStart='.$prevCalMonthStart.';calMonthEnd='.$prevCalMonthEnd;
@@ -433,22 +437,22 @@ sub view {
$self->getUrl.'?calMonthStart='.$calMonthStart.
';reload='.$self->session->id->generate().'">'.
- WebGUI::International::get(558,"Asset_EventsCalendar")." ".$monthRangeLength." ".
+ $i18n->get(558)." ".$monthRangeLength." ".
$monthLabel.' ';
$var{'pagination.nextPageUrl'} = $self->getUrl.
'?calMonthStart='.$nextCalMonthStart.';calMonthEnd='.$nextCalMonthEnd;
$var{'pagination.nextPage'} = ''.
- WebGUI::International::get(559,"Asset_EventsCalendar")." ".$monthRangeLength." ".
+ $i18n->get(559)." ".$monthRangeLength." ".
$monthLabel.' ';
$var{'pagination.pageList.upTo20'} = '
- 1 '.WebGUI::International::get(560,"Asset_EventsCalendar").'
- 2 '.WebGUI::International::get(561,"Asset_EventsCalendar").'
- 3 '.WebGUI::International::get(561,"Asset_EventsCalendar").'
- 4 '.WebGUI::International::get(561,"Asset_EventsCalendar").'
- 6 '.WebGUI::International::get(561,"Asset_EventsCalendar").'
- 9 '.WebGUI::International::get(561,"Asset_EventsCalendar").'
- 12 '.WebGUI::International::get(561,"Asset_EventsCalendar").'
+ 1 '.$i18n->get(560).'
+ 2 '.$i18n->get(561).'
+ 3 '.$i18n->get(561).'
+ 4 '.$i18n->get(561).'
+ 6 '.$i18n->get(561).'
+ 9 '.$i18n->get(561).'
+ 12 '.$i18n->get(561).'
';
#use Data::Dumper; return ''.Dumper(\%var).' ';
my $vars = \%var;
diff --git a/lib/WebGUI/Asset/Wobject/Folder.pm b/lib/WebGUI/Asset/Wobject/Folder.pm
index 5372fc9ff..575ae9e88 100644
--- a/lib/WebGUI/Asset/Wobject/Folder.pm
+++ b/lib/WebGUI/Asset/Wobject/Folder.pm
@@ -57,9 +57,11 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_Folder");
push(@{$definition}, {
- assetName=>WebGUI::International::get("assetName","Asset_Folder"),
+ assetName=>$i18n->get("assetName"),
uiLevel => 5,
icon=>'folder.gif',
tableName=>'Folder',
@@ -71,7 +73,7 @@ sub definition {
}
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
@@ -87,17 +89,18 @@ Returns the TabForm object that will be used in generating the edit page for thi
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
+ my $i18n = WebGUI::International->new($self->session,"Asset_Folder");
$tabform->getTab("display")->template(
-value=>$self->getValue('templateId'),
- -label=>WebGUI::International::get('folder template title', "Asset_Folder"),
- -hoverHelp=>WebGUI::International::get('folder template description', "Asset_Folder"),
+ -label=>$i18n->get('folder template title'),
+ -hoverHelp=>$i18n->get('folder template description'),
-namespace=>"Folder"
);
if ($self->get("assetId") eq "new") {
$tabform->getTab("properties")->whatNext(
-options=>{
- view=>WebGUI::International::get(823, "Asset_Folder"),
- "viewParent"=>WebGUI::International::get(847, "Asset_Folder")
+ view=>$i18n->get(823),
+ "viewParent"=>$i18n->get(847)
},
-value=>"view"
);
diff --git a/lib/WebGUI/Asset/Wobject/HttpProxy.pm b/lib/WebGUI/Asset/Wobject/HttpProxy.pm
index e72e168ad..da4228d87 100644
--- a/lib/WebGUI/Asset/Wobject/HttpProxy.pm
+++ b/lib/WebGUI/Asset/Wobject/HttpProxy.pm
@@ -31,9 +31,11 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_HttpProxy");
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_HttpProxy"),
+ assetName=>$i18n->get('assetName'),
uiLevel => 5,
icon=>'httpProxy.gif',
tableName=>'HttpProxy',
@@ -86,7 +88,7 @@ sub definition {
}
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
@@ -105,11 +107,12 @@ sub getCookieJar {
#-------------------------------------------------------------------
sub getEditForm {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session,"Asset_IndexedSearch");
my $tabform = $self->SUPER::getEditForm();
$tabform->getTab("display")->template(
-value=>$self->getValue('templateId'),
- -label=>WebGUI::International::get('http proxy template title',"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('http proxy template title description',"Asset_HttpProxy"),
+ -label=>$i18n->get('http proxy template title'),
+ -hoverHelp=>$i18n->get('http proxy template title description'),
-namespace=>"HttpProxy"
);
my %hash;
@@ -117,32 +120,32 @@ sub getEditForm {
%hash=(5=>5,10=>10,20=>20,30=>30,60=>60);
$tabform->getTab("properties")->url(
-name=>"proxiedUrl",
- -label=>WebGUI::International::get(1,"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('1 description',"Asset_HttpProxy"),
+ -label=>$i18n->get(1),
+ -hoverHelp=>$i18n->get('1 description'),
-value=>$self->getValue("proxiedUrl")
);
$tabform->getTab("security")->yesNo(
-name=>"followExternal",
- -label=>WebGUI::International::get(5,"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('5 description',"Asset_HttpProxy"),
+ -label=>$i18n->get(5),
+ -hoverHelp=>$i18n->get('5 description'),
-value=>$self->getValue("followExternal")
);
$tabform->getTab("security")->yesNo(
-name=>"followRedirect",
- -label=>WebGUI::International::get(8,"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('8 description',"Asset_HttpProxy"),
+ -label=>$i18n->get(8),
+ -hoverHelp=>$i18n->get('8 description'),
-value=>$self->getValue("followRedirect")
);
$tabform->getTab("properties")->yesNo(
-name=>"rewriteUrls",
- -label=>WebGUI::International::get(12,"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('12 description',"Asset_HttpProxy"),
+ -label=>$i18n->get(12),
+ -hoverHelp=>$i18n->get('12 description'),
-value=>$self->getValue("rewriteUrls")
);
$tabform->getTab("display")->yesNo(
-name=>"removeStyle",
- -label=>WebGUI::International::get(6,"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('6 description',"Asset_HttpProxy"),
+ -label=>$i18n->get(6),
+ -hoverHelp=>$i18n->get('6 description'),
-value=>$self->getValue("removeStyle")
);
$tabform->getTab("display")->filterContent(
@@ -152,20 +155,20 @@ sub getEditForm {
$tabform->getTab("properties")->selectBox(
-name=>"timeout",
-options=>\%hash,
- -label=>WebGUI::International::get(4,"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('4 description',"Asset_HttpProxy"),
+ -label=>$i18n->get(4),
+ -hoverHelp=>$i18n->get('4 description'),
-value=>[$self->getValue("timeout")]
);
$tabform->getTab("display")->text(
-name=>"searchFor",
- -label=>WebGUI::International::get(13,"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('13 description',"Asset_HttpProxy"),
+ -label=>$i18n->get(13),
+ -hoverHelp=>$i18n->get('13 description'),
-value=>$self->getValue("searchFor")
);
$tabform->getTab("display")->text(
-name=>"stopAt",
- -label=>WebGUI::International::get(14,"Asset_HttpProxy"),
- -hoverHelp=>WebGUI::International::get('14 description',"Asset_HttpProxy"),
+ -label=>$i18n->get(14),
+ -hoverHelp=>$i18n->get('14 description'),
-value=>$self->getValue("stopAt")
);
return $tabform;
diff --git a/lib/WebGUI/Asset/Wobject/InOutBoard.pm b/lib/WebGUI/Asset/Wobject/InOutBoard.pm
index 3130ba4b5..adfcb3c8b 100644
--- a/lib/WebGUI/Asset/Wobject/InOutBoard.pm
+++ b/lib/WebGUI/Asset/Wobject/InOutBoard.pm
@@ -64,16 +64,18 @@ sub _fetchDepartments {
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_InOutBoard");
push(@{$definition}, {
tableName=>'InOutBoard',
className=>'WebGUI::Asset::Wobject::InOutBoard',
- assetName=>WebGUI::International::get('assetName',"Asset_InOutBoard"),
+ assetName=>$i18n->get('assetName'),
icon=>'iob.gif',
properties=>{
statusList => {
- defaultValue => WebGUI::International::get(10, "Asset_InOutBoard")."\n"
- .WebGUI::International::get(11, "Asset_InOutBoard")."\n",
+ defaultValue => $i18n->get(10)."\n"
+ .$i18n->get(11)."\n",
fieldType=>"textarea"
},
reportViewerGroup => {
@@ -98,7 +100,7 @@ sub definition {
},
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
@@ -106,38 +108,39 @@ sub definition {
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
+ my $i18n = WebGUI::International->new($self->session, "Asset_InOutBoard");
$tabform->getTab("properties")->textarea(
-name=>"statusList",
- -label=>WebGUI::International::get(1, "Asset_InOutBoard"),
+ -label=>$i18n->get(1),
-value=>$self->getValue("statusList"),
- -subtext=>WebGUI::International::get(2, "Asset_InOutBoard"),
+ -subtext=>$i18n->get(2),
);
$tabform->getTab("display")->integer(
-name=>"paginateAfter",
- -label=>WebGUI::International::get(12, "Asset_InOutBoard"),
+ -label=>$i18n->get(12),
-value=>$self->getValue("paginateAfter")
);
$tabform->getTab("display")->template (
-name => "inOutTemplateId",
-value => $self->getValue("inOutTemplateId"),
- -label => WebGUI::International::get("In Out Template", "Asset_InOutBoard"),
+ -label => $i18n->get("In Out Template"),
-namespace => "InOutBoard"
);
$tabform->getTab("display")->template (
-name => "reportTemplateId",
-value => $self->getValue("reportTemplateId"),
- -label => WebGUI::International::get(13, "Asset_InOutBoard"),
+ -label => $i18n->get(13),
-namespace => "InOutBoard/Report"
);
$tabform->getTab("security")->group(
-name=>"reportViewerGroup",
-value=>[$self->getValue("reportViewerGroup")],
- -label=>WebGUI::International::get(3, "Asset_InOutBoard")
+ -label=>$i18n->get(3)
);
$tabform->getTab("security")->group(
-name=>"inOutGroup",
-value=>[$self->getValue("inOutGroup")],
- -label=>WebGUI::International::get('inOutGroup', "Asset_InOutBoard")
+ -label=>$i18n->get('inOutGroup')
);
return $tabform;
}
@@ -149,6 +152,7 @@ sub view {
my %var;
my $url = $self->getUrl('func=view');
+ my $i18n = WebGUI::International->new($self->session, "Asset_InOutBoard");
if ($self->session->user->isInGroup($self->getValue("reportViewerGroup"))) {
$var{'viewReportURL'} = $self->getUrl("func=viewReport");
$var{canViewReport} = 1;
@@ -177,14 +181,14 @@ sub view {
my %nameHash;
tie %nameHash, "Tie::IxHash";
%nameHash = _fetchNames(@users);
- $nameHash{""} = WebGUI::International::get('myself',"Asset_InOutBoard");
+ $nameHash{""} = $i18n->get('myself');
%nameHash = WebGUI::Utility::sortHash(%nameHash);
$f->selectBox(
-name=>"delegate",
-options=>\%nameHash,
-value=>[ $self->session->scratch->get("userId") ],
- -label=>WebGUI::International::get('delegate', "Asset_InOutBoard"),
+ -label=>$i18n->get('delegate'),
-extras=>q|onchange="this.form.submit();"|,
);
}
@@ -192,11 +196,11 @@ sub view {
-name=>"status",
-value=>$status,
-options=>$statusListHashRef,
- -label=>WebGUI::International::get(5, "Asset_InOutBoard")
+ -label=>$i18n->get(5)
);
$f->text(
-name=>"message",
- -label=>WebGUI::International::get(6, "Asset_InOutBoard")
+ -label=>$i18n->get(6)
);
$f->hidden(
-name=>"func",
@@ -243,7 +247,7 @@ order by department, lastName, firstName";
my %row;
if ($lastDepartment ne $data->{department}) {
$row{deptHasChanged} = 1;
- $row{'department'} = ($data->{department}||WebGUI::International::get(7, "Asset_InOutBoard"));
+ $row{'department'} = ($data->{department}||$i18n->get(7));
$lastDepartment = $data->{department};
}
else { $row{deptHasChanged} = 0; }
@@ -255,7 +259,7 @@ order by department, lastName, firstName";
$row{'username'} = $data->{username};
}
- $row{'status'} = ($data->{status}||WebGUI::International::get(15, "Asset_InOutBoard"));
+ $row{'status'} = ($data->{status}||$i18n->get(15));
$row{'dateStamp'} = $self->session->datetime->epochToHuman($data->{dateStamp});
$row{'message'} = ($data->{message}||" ");
@@ -272,7 +276,8 @@ order by department, lastName, firstName";
sub www_edit {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
- return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get("18","Asset_InOutBoard"));
+ my $i18n = WebGUI::International->new($self->session, "Asset_InOutBoard");
+ return $self->getAdminConsole->render($self->getEditForm->print,$i18n->get("18"));
}
#-------------------------------------------------------------------
@@ -311,6 +316,7 @@ group by userId", $self->session->db->quote($self->getId), $self->session->db->q
$sql = sprintf "select delegateUserId from InOutBoard_delegates where userId=%s and assetId=%s",
$self->session->db->quote($self->session->user->profileField("userId")), $self->session->db->quote($self->getId);
my $delegates = $self->session->db->buildArrayRef($sql);
+ my $i18n = WebGUI::International->new($self->session,"Asset_InOutBoard");
my $f = WebGUI::HTMLForm->new($self->session,-action=>$self->getUrl);
$f->hidden(
-name => "func",
@@ -318,18 +324,18 @@ group by userId", $self->session->db->quote($self->getId), $self->session->db->q
);
$f->selectList(
-name => "delegates",
- -label => WebGUI::International::get('in/out status delegates','Asset_InOutBoard'),
+ -label => $i18n->get('in/out status delegates'),
-options => \%userNames,
-multiple => 1, ##Multiple select
-size => 10, ##Multiple select
-sortByValue => 1,
-value => $delegates, ##My current delegates, if any
- -subtext => WebGUI::International::get('in/out status delegates subtext','Asset_InOutBoard'),
+ -subtext => $i18n->get('in/out status delegates subtext'),
);
$f->submit;
my $ac = $self->getAdminConsole;
return $ac->render($f->print,
- WebGUI::International::get('select delegate','Asset_InOutBoard'));
+ $i18n->get('select delegate'));
}
#-------------------------------------------------------------------
@@ -379,6 +385,7 @@ sub www_viewReport {
my $self = shift;
return "" unless ($self->session->user->isInGroup($self->getValue("reportViewerGroup")));
my %var;
+ my $i18n = WebGUI::International->new($self->session,'Asset_InOutBoard');
my $f = WebGUI::HTMLForm->new($self->session,-action=>$self->getUrl, -method=>"GET");
my %changedBy = ();
$f->hidden(
@@ -393,28 +400,28 @@ sub www_viewReport {
$startDate = $self->session->form->date("startDate") if ($self->session->form->process("doit"));
$f->date(
-name=>"startDate",
- -label=>WebGUI::International::get(16, "Asset_InOutBoard"),
+ -label=>$i18n->get(16),
-value=>$startDate
);
my $endDate = $self->session->form->date("endDate");
$f->date(
-name=>"endDate",
- -label=>WebGUI::International::get(17, "Asset_InOutBoard"),
+ -label=>$i18n->get(17),
-value=>$endDate
);
my %depHash;
%depHash = map { $_ => $_ } (_fetchDepartments(),
- WebGUI::International::get('all departments', 'Asset_InOutBoard'));
+ $i18n->get('all departments'));
my $defaultDepartment = $self->session->form->process("selectDepartment")
- || WebGUI::International::get('all departments', 'Asset_InOutBoard');
- my $departmentSQLclause = ($defaultDepartment eq WebGUI::International::get('all departments', 'Asset_InOutBoard'))
+ || $i18n->get('all departments');
+ my $departmentSQLclause = ($defaultDepartment eq $i18n->get('all departments'))
? ''
: 'and c.fieldData='.$self->session->db->quote($defaultDepartment);
$f->selectBox(
-name=>"selectDepartment",
-options=>\%depHash,
-value=>[ $defaultDepartment ],
- -label=>WebGUI::International::get('filter departments', "Asset_InOutBoard"),
+ -label=>$i18n->get('filter departments'),
);
my %paginHash;
tie %paginHash, "Tie::IxHash"; ##Because default sort order is alpha
@@ -424,7 +431,7 @@ sub www_viewReport {
-name=>"reportPagination",
-options=>\%paginHash,
-value=>[ $pageReportAfter ],
- -label=>WebGUI::International::get(14, "Asset_InOutBoard"),
+ -label=>$i18n->get(14),
);
$f->submit(-value=>"Search");
$var{'form'} = $f->print;
@@ -468,14 +475,14 @@ order by department, lastName, firstName, InOutBoard_statusLog.dateStamp";
if ($lastDepartment ne $data->{department}) {
$row{deptHasChanged} = 1;
- $row{'department'} = ($data->{department}||WebGUI::International::get(7, "Asset_InOutBoard"));
+ $row{'department'} = ($data->{department}||$i18n->get(7));
$lastDepartment = $data->{department};
}
else { $row{deptHasChanged} = 0; }
$row{'username'} = _defineUsername($data);
- $row{'status'} = ($data->{status}||WebGUI::International::get(15, "Asset_InOutBoard"));
+ $row{'status'} = ($data->{status}||$i18n->get(15));
$row{'dateStamp'} = $self->session->datetime->epochToHuman($data->{dateStamp});
$row{'message'} = ($data->{message}||" ");
if (! exists $changedBy{ $data->{createdBy} }) {
@@ -488,11 +495,11 @@ order by department, lastName, firstName, InOutBoard_statusLog.dateStamp";
}
$var{rows_loop} = \@rows;
$var{'paginateBar'} = $p->getBarTraditional();
- $var{'username.label'} = WebGUI::International::get('username label','Asset_InOutBoard');
- $var{'status.label'} = WebGUI::International::get(5,'Asset_InOutBoard');
- $var{'date.label'} = WebGUI::International::get('date label','Asset_InOutBoard');
- $var{'message.label'} = WebGUI::International::get('message label','Asset_InOutBoard');
- $var{'updatedBy.label'} = WebGUI::International::get('updatedBy label','Asset_InOutBoard');
+ $var{'username.label'} = $i18n->get('username label');
+ $var{'status.label'} = $i18n->get(5);
+ $var{'date.label'} = $i18n->get('date label');
+ $var{'message.label'} = $i18n->get('message label');
+ $var{'updatedBy.label'} = $i18n->get('updatedBy label');
$p->appendTemplateVars(\%var);
}
else { $var{showReport} = 0; }
diff --git a/lib/WebGUI/Asset/Wobject/IndexedSearch.pm b/lib/WebGUI/Asset/Wobject/IndexedSearch.pm
index f83e859de..789f14c6c 100644
--- a/lib/WebGUI/Asset/Wobject/IndexedSearch.pm
+++ b/lib/WebGUI/Asset/Wobject/IndexedSearch.pm
@@ -20,11 +20,13 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_IndexedSearch");
push (@{$definition}, {
tableName=>'IndexedSearch',
className=>'WebGUI::Asset::Wobject::IndexedSearch',
- assetName=>WebGUI::International::get('assetName',"Asset_IndexedSearch"),
+ assetName=>$i18n->get('assetName'),
properties=>{
templateId=>{
fieldType=>"template",
@@ -80,7 +82,7 @@ sub definition {
},
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
@@ -96,23 +98,24 @@ sub getEditForm {
tie my %searchRoot, 'Tie::IxHash';
# Unconditional read to catch intallation errors.
+ my $i18n = WebGUI::International->new($self->session,"Asset_IndexedSearch");
my $sth = $self->session->db->unconditionalRead("select distinct(indexName), indexName from IndexedSearch_docInfo");
unless ($sth->errorCode < 1) {
- return "" . WebGUI::International::get(1,"Asset_IndexedSearch") . $sth->errorMessage."
";
+ return "" . $i18n->get(1) . $sth->errorMessage."
";
}
while (@data = $sth->array) {
$indexName{$data[0]} = $data[1];
}
$sth->finish;
unless(%indexName) {
- return "" . WebGUI::International::get(2,"Asset_IndexedSearch") .
- "
" . WebGUI::International::get(3,"Asset_IndexedSearch") . "
";
+ return "" . $i18n->get(2) .
+ "
" . $i18n->get(3) . "
";
}
# Index to use
# $tabform->getTab("properties")->radioList( -name=>'indexName',
# -options=>\%indexName,
-# -label=>WebGUI::International::get(5,"Asset_IndexedSearch"),
+# -label=>$i18n->get(5),
# -value=>$self->getValue("indexName"),
# -vertical=>1
# );
@@ -124,26 +127,26 @@ sub getEditForm {
);
# Page roots
- #%searchRoot = ( 'any'=>WebGUI::International::get(15,"Asset_IndexedSearch"),
- # $session{page}{pageId}=>WebGUI::International::get(4,"Asset_IndexedSearch"),
+ #%searchRoot = ( 'any'=>$i18n->get(15),
+ # $session{page}{pageId}=>$i18n->get(4),
# $self->session->db->buildHash("select pageId,title from page where parentId='0' and isSystem<>1 order by title")
# );
#$tabform->getTab("properties")->checkList ( -name=>'searchRoot',
# -options=>\%searchRoot,
- # -label=>WebGUI::International::get(6,"Asset_IndexedSearch"),
+ # -label=>$i18n->get(6),
# -value=>[ split("\n", $self->getValue("searchRoot")) ],
# -multiple=>1,
# -vertical=>1,
# );
$tabform->getTab("properties")->yesNo(
-name=>'forceSearchRoots',
- -label=>WebGUI::International::get('force search roots',"Asset_IndexedSearch"),
+ -label=>$i18n->get('force search roots'),
-value=>$self->getValue("forceSearchRoots")
);
# Content of specific user
$tabform->getTab("properties")->selectList ( -name=>'users',
-options=>$self->_getUsers(),
- -label=>WebGUI::International::get(7,"Asset_IndexedSearch"),
+ -label=>$i18n->get(7),
-value=>[ split("\n", $self->getValue("users")) ],
-multiple=>1,
-size=>5
@@ -152,7 +155,7 @@ sub getEditForm {
# Content in specific namespaces
$tabform->getTab("properties")->selectList ( -name=>'namespaces',
-options=>$self->_getNamespaces,
- -label=>WebGUI::International::get(8,"Asset_IndexedSearch"),
+ -label=>$i18n->get(8),
-value=>[ split("\n", $self->getValue("namespaces")) ],
-multiple=>1,
-size=>5
@@ -163,7 +166,7 @@ sub getEditForm {
delete $contentTypes->{content};
$tabform->getTab("properties")->checkList ( -name=>'contentTypes',
-options=>$contentTypes,
- -label=>WebGUI::International::get(10,"Asset_IndexedSearch"),
+ -label=>$i18n->get(10),
-value=>[ split("\n", $self->getValue("contentTypes")) ],
-multiple=>1,
-vertical=>1,
@@ -173,15 +176,15 @@ sub getEditForm {
-namespace=>"IndexedSearch"
);
$tabform->getTab("display")->integer ( -name=>'paginateAfter',
- -label=>WebGUI::International::get(11,"Asset_IndexedSearch"),
+ -label=>$i18n->get(11),
-value=>$self->getValue("paginateAfter"),
);
$tabform->getTab("display")->integer ( -name=>'previewLength',
- -label=>WebGUI::International::get(12,"Asset_IndexedSearch"),
+ -label=>$i18n->get(12),
-value=>$self->getValue("previewLength"),
);
$tabform->getTab("display")->yesNo ( -name=>'highlight',
- -label=>WebGUI::International::get(13,"Asset_IndexedSearch"),
+ -label=>$i18n->get(13),
-value=>$self->getValue("highlight"),
);
@@ -195,7 +198,7 @@ sub getEditForm {
for (1..5) {
my $highlight = "highlight_$_";
$tabform->getTab("display")->text ( -name=>$highlight,
- -label=>WebGUI::International::get(14,"Asset_IndexedSearch") ." $_:",
+ -label=>$i18n->get(14) ." $_:",
-size=>7,
-value=>$self->getValue($highlight),
-subtext=>qq{
@@ -236,9 +239,10 @@ sub view {
$var{query} = $query;
# Set some standard vars
- $var{submit} = WebGUI::Form::submit($self->session,{value=>WebGUI::International::get(16, "Asset_IndexedSearch")});
+ my $i18n = WebGUI::International->new($self->session,"Asset_IndexedSearch");
+ $var{submit} = WebGUI::Form::submit($self->session,{value=>$i18n->get(16)});
$var{actionURL} = $self->getUrl;
- $var{"int.search"} = WebGUI::International::get(16,"Asset_IndexedSearch");
+ $var{"int.search"} = $i18n->get(16);
$var{numberOfResults} = '0';
$var{"select_".$self->getValue("paginateAfter")} = "selected";
@@ -385,7 +389,8 @@ sub www_edit {
my $form = $self->getEditForm;
my $output = $form;
$output = $form->print unless $form =~ /^getAdminConsole->render($output,WebGUI::International::get("26","Asset_IndexedSearch"));
+ my $i18n = WebGUI::International->new($self->session,"Asset_IndexedSearch");
+ return $self->getAdminConsole->render($output,$i18n->get("26"));
}
#-------------------------------------------------------------------
@@ -488,14 +493,15 @@ sub _getNamespaces {
$international{$class} = eval{$class->getName()};
}
}
+ my $i18n = WebGUI::International->new($self->session,"Asset_IndexedSearch");
tie my %namespaces, 'Tie::IxHash';
if ($restricted and $self->get('namespaces') !~ /any/i) {
- $namespaces{any} = WebGUI::International::get(18,"Asset_IndexedSearch");
+ $namespaces{any} = $i18n->get(18);
foreach (split/\n/, $self->get('namespaces')) {
$namespaces{$_} = $international{$_} || ucfirst($_);
}
} else {
- $namespaces{any} = WebGUI::International::get(18,"Asset_IndexedSearch");
+ $namespaces{any} = $i18n->get(18);
foreach ($self->session->db->buildArray("select distinct(namespace) from IndexedSearch_docInfo order by namespace")) {
$namespaces{$_} = $international{$_} ||ucfirst($_);
}
@@ -506,13 +512,14 @@ sub _getNamespaces {
#-------------------------------------------------------------------
sub _getContentTypes {
my ($self, $restricted) = @_;
- my %international = ( 'page' => WebGUI::International::get('page',"Asset_IndexedSearch"),
- 'wobject' => WebGUI::International::get(19,"Asset_IndexedSearch"),
- 'wobjectDetail' => WebGUI::International::get(20,"Asset_IndexedSearch"),
- 'content' => WebGUI::International::get(21,"Asset_IndexedSearch"),
- 'discussion' => WebGUI::International::get('discussion',"Asset_IndexedSearch"),
- 'profile' => WebGUI::International::get(22,"Asset_IndexedSearch"),
- 'any' => WebGUI::International::get(23,"Asset_IndexedSearch"),
+ my $i18n = WebGUI::International->new($self->session,"Asset_IndexedSearch");
+ my %international = ( 'page' => $i18n->get('page'),
+ 'wobject' => $i18n->get(19),
+ 'wobjectDetail' => $i18n->get(20),
+ 'content' =>$i18n->get(21),
+ 'discussion' => $i18n->get('discussion'),
+ 'profile' => $i18n->get(22),
+ 'any' => $i18n->get(23),
);
tie my %contentTypes, 'Tie::IxHash';
if ($restricted and $self->get('contentTypes') !~ /any/i) {
@@ -548,13 +555,14 @@ sub _getSearchablePages {
sub _getUsers {
my ($self, $restricted) = @_;
tie my %users, 'Tie::IxHash';
+ my $i18n = WebGUI::International->new($self->session,"Asset_IndexedSearch");
if ($restricted and $self->get('users') !~ /any/i) {
- $users{any} = WebGUI::International::get(25,"Asset_IndexedSearch");
+ $users{any} = $i18n->get(25);
foreach (split/\n/, $self->get('users')) {
$users{$_} = $_;
}
} else {
- %users = ( 'any' => WebGUI::International::get(25,"Asset_IndexedSearch"),
+ %users = ( 'any' => $i18n->get(25),
$self->session->db->buildHash("select userId, username from users order by username")
);
}
diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm
index 44bc1e6af..7e58f7554 100644
--- a/lib/WebGUI/Asset/Wobject/Layout.pm
+++ b/lib/WebGUI/Asset/Wobject/Layout.pm
@@ -58,9 +58,11 @@ A hash reference passed in from a subclass definition.
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_Layout");
push(@{$definition}, {
- assetName=>WebGUI::International::get("assetName","Asset_Layout"),
+ assetName=>$i18n->get("assetName"),
icon=>'layout.gif',
tableName=>'Layout',
className=>'WebGUI::Asset::Wobject::Layout',
@@ -80,7 +82,7 @@ sub definition {
}
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
@@ -95,17 +97,18 @@ Returns the TabForm object that will be used in generating the edit page for thi
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
+ my $i18n = WebGUI::International->new($self->session,"Asset_Layout");
$tabform->getTab("display")->template(
-value=>$self->getValue('templateId'),
- -label=>WebGUI::International::get('layout template title', 'Asset_Layout'),
- -hoverHelp=>WebGUI::International::get('template description', 'Asset_Layout'),
+ -label=>$i18n->get('layout template title'),
+ -hoverHelp=>$i18n->get('template description'),
-namespace=>"Layout"
);
if ($self->get("assetId") eq "new") {
$tabform->getTab("properties")->whatNext(
-options=>{
- view=>WebGUI::International::get(823, 'Asset_Layout'),
- viewParent=>WebGUI::International::get(847, 'Asset_Layout')
+ view=>$i18n->get(823),
+ viewParent=>$i18n->get(847)
},
-value=>"view"
);
@@ -120,8 +123,8 @@ sub getEditForm {
-name=>"assetsToHide",
-value=>\@assetsToHide,
-options=>\%childIds,
- -label=>WebGUI::International::get('assets to hide', 'Asset_Layout'),
- -hoverHelp=>WebGUI::International::get('assets to hide description', 'Asset_Layout'),
+ -label=>$i18n->get('assets to hide'),
+ -hoverHelp=>$i18n->get('assets to hide description'),
-vertical=>1,
-uiLevel=>9
);
diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm
index f75b38390..e20ba6925 100644
--- a/lib/WebGUI/Asset/Wobject/Matrix.pm
+++ b/lib/WebGUI/Asset/Wobject/Matrix.pm
@@ -23,12 +23,14 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_Matrix");
push(@{$definition}, {
icon=>'matrix.gif',
tableName=>'Matrix',
className=>'WebGUI::Asset::Wobject::Matrix',
- assetName=>WebGUI::International::get('assetName',"Asset_Matrix"),
+ assetName=>$i18n->get('assetName'),
properties=>{
categories=>{
defaultValue=>"Features\nBenefits",
@@ -84,7 +86,7 @@ sub definition {
}
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
@@ -309,13 +311,15 @@ sub www_compare {
#-------------------------------------------------------------------
sub www_copy {
- return WebGUI::International::get('no copy','Asset_Matrix');
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
+ return $i18n->get('no copy');
}
#-------------------------------------------------------------------
sub www_deleteListing {
my $self = shift;
- my $output = sprintf WebGUI::International::get('delete listing confirmation','Asset_Matrix'),
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
+ my $output = sprintf $i18n->get('delete listing confirmation'),
$self->getUrl("func=deleteListingConfirm&listingId=".$self->session->form->process("listingId")),
$self->formatURL("viewDetail",$self->session->form->process("listingId"));
return $self->processStyle($output);
@@ -340,88 +344,89 @@ sub www_deleteListingConfirm {
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm();
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
$tabform->getTab("properties")->textarea(
-name=>"categories",
- -label=>WebGUI::International::get('categories', 'Asset_Matrix'),
- -hoverHelp=>WebGUI::International::get('categories description', 'Asset_Matrix'),
+ -label=>$i18n->get('categories'),
+ -hoverHelp=>$i18n->get('categories description'),
-value=>$self->getValue("categories"),
- -subtext=>WebGUI::International::get('categories subtext', 'Asset_Matrix'),
+ -subtext=>$i18n->get('categories subtext'),
);
$tabform->getTab("properties")->integer(
-name=>"maxComparisons",
- -label=>WebGUI::International::get("max comparisons","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("max comparisons description","Asset_Matrix"),
+ -label=>$i18n->get("max comparisons"),
+ -hoverHelp=>$i18n->get("max comparisons description"),
-value=>$self->getValue("maxComparisons")
);
$tabform->getTab("properties")->integer(
-name=>"maxComparisonsPrivileged",
- -label=>WebGUI::International::get("max comparisons privileged","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("max comparisons privileged description","Asset_Matrix"),
+ -label=>$i18n->get("max comparisons privileged"),
+ -hoverHelp=>$i18n->get("max comparisons privileged description"),
-value=>$self->getValue("maxComparisonsPrivileged")
);
$tabform->getTab("properties")->interval(
-name=>"ratingTimeout",
- -label=>WebGUI::International::get("rating timeout","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("rating timeout description","Asset_Matrix"),
+ -label=>$i18n->get("rating timeout"),
+ -hoverHelp=>$i18n->get("rating timeout description"),
-value=>$self->getValue("ratingTimeout")
);
$tabform->getTab("properties")->interval(
-name=>"ratingTimeoutPrivileged",
- -label=>WebGUI::International::get("rating timeout privileged","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("rating timeout privileged description","Asset_Matrix"),
+ -label=>$i18n->get("rating timeout privileged"),
+ -hoverHelp=>$i18n->get("rating timeout privileged description"),
-value=>$self->getValue("ratingTimeoutPrivileged")
);
$tabform->getTab("security")->group(
-name=>"groupToAdd",
- -label=>WebGUI::International::get("group to add","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("group to add description","Asset_Matrix"),
+ -label=>$i18n->get("group to add"),
+ -hoverHelp=>$i18n->get("group to add description"),
-value=>[$self->getValue("groupToAdd")]
);
$tabform->getTab("security")->group(
-name=>"privilegedGroup",
- -label=>WebGUI::International::get("privileged group","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("privileged group description","Asset_Matrix"),
+ -label=>$i18n->get("privileged group"),
+ -hoverHelp=>$i18n->get("privileged group description"),
-value=>[$self->getValue("privilegedGroup")]
);
$tabform->getTab("security")->group(
-name=>"groupToRate",
- -label=>WebGUI::International::get("rating group","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("rating group description","Asset_Matrix"),
+ -label=>$i18n->get("rating group"),
+ -hoverHelp=>$i18n->get("rating group description"),
-value=>[$self->getValue("groupToRate")]
);
$tabform->getTab("display")->template(
-name=>"templateId",
-value=>$self->getValue("templateId"),
- -label=>WebGUI::International::get("main template","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("main template description","Asset_Matrix"),
+ -label=>$i18n->get("main template"),
+ -hoverHelp=>$i18n->get("main template description"),
-namespace=>"Matrix"
);
$tabform->getTab("display")->template(
-name=>"detailTemplateId",
-value=>$self->getValue("detailTemplateId"),
- -label=>WebGUI::International::get("detail template","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("detail template description","Asset_Matrix"),
+ -label=>$i18n->get("detail template"),
+ -hoverHelp=>$i18n->get("detail template description"),
-namespace=>"Matrix/Detail"
);
$tabform->getTab("display")->template(
-name=>"ratingDetailTemplateId",
-value=>$self->getValue("ratingDetailTemplateId"),
- -label=>WebGUI::International::get("rating detail template","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("rating detail template description","Asset_Matrix"),
+ -label=>$i18n->get("rating detail template"),
+ -hoverHelp=>$i18n->get("rating detail template description"),
-namespace=>"Matrix/RatingDetail"
);
$tabform->getTab("display")->template(
-name=>"searchTemplateId",
-value=>$self->getValue("searchTemplateId"),
- -label=>WebGUI::International::get("search template","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("search template description","Asset_Matrix"),
+ -label=>$i18n->get("search template"),
+ -hoverHelp=>$i18n->get("search template description"),
-namespace=>"Matrix/Search"
);
$tabform->getTab("display")->template(
-name=>"compareTemplateId",
-value=>$self->getValue("compareTemplateId"),
- -label=>WebGUI::International::get("compare template","Asset_Matrix"),
- -hoverHelp=>WebGUI::International::get("compare template description","Asset_Matrix"),
+ -label=>$i18n->get("compare template"),
+ -hoverHelp=>$i18n->get("compare template description"),
-namespace=>"Matrix/Compare"
);
return $tabform;
@@ -431,8 +436,9 @@ sub getEditForm {
sub www_edit {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
return $self->getAdminConsole->render($self->getEditForm->print,
- WebGUI::International::get("edit matrix",'Asset_Matrix'));
+ $i18n->get("edit matrix"));
}
@@ -441,7 +447,8 @@ sub www_edit {
sub www_editListing {
my $self = shift;
my $listing= $self->session->db->getRow("Matrix_listing","listingId",$self->session->form->process("listingId"));
- return WebGUI::International('no edit rights','Asset_Matrix') unless (($self->session->form->process("listingId") eq "new" && $self->session->user->isInGroup($self->get("groupToAdd"))) || $self->session->user->profileField("userId") eq $listing->{maintainerId} || $self->canEdit);
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
+ return $i18n->get('no edit rights') unless (($self->session->form->process("listingId") eq "new" && $self->session->user->isInGroup($self->get("groupToAdd"))) || $self->session->user->profileField("userId") eq $listing->{maintainerId} || $self->canEdit);
my $f = WebGUI::HTMLForm->new($self->session,-action=>$self->getUrl);
$f->hidden(
-name=>"func",
@@ -454,53 +461,53 @@ sub www_editListing {
$f->text(
-name=>"productName",
-value=>$listing->{productName},
- -label=>WebGUI::International::get('product name','Asset_Matrix'),
- -hoverHelp=>WebGUI::International::get('product name description','Asset_Matrix'),
+ -label=>$i18n->get('product name'),
+ -hoverHelp=>$i18n->get('product name description'),
-maxLength=>25
);
$f->text(
-name=>"versionNumber",
-value=>$listing->{versionNumber},
- -label=>WebGUI::International::get('version number','Asset_Matrix'),
- -hoverHelp=>WebGUI::International::get('version number description','Asset_Matrix'),
+ -label=>$i18n->get('version number'),
+ -hoverHelp=>$i18n->get('version number description'),
);
$f->url(
-name=>"productUrl",
-value=>$listing->{productUrl},
- -label=>WebGUI::International::get('product url','Asset_Matrix'),
- -hoverHelp=>WebGUI::International::get('product url description','Asset_Matrix'),
+ -label=>$i18n->get('product url'),
+ -hoverHelp=>$i18n->get('product url description'),
);
$f->text(
-name=>"manufacturerName",
-value=>$listing->{manufacturerName},
- -label=>WebGUI::International::get('manufacturer name','Asset_Matrix'),
- -hoverHelp=>WebGUI::International::get('manufacturer name description','Asset_Matrix'),
+ -label=>$i18n->get('manufacturer name'),
+ -hoverHelp=>$i18n->get('manufacturer name description'),
);
$f->url(
-name=>"manufacturerUrl",
-value=>$listing->{manufacturerUrl},
- -label=>WebGUI::International::get('manufacturer url','Asset_Matrix'),
+ -label=>$i18n->get('manufacturer url'),
);
$f->textarea(
-name=>"description",
-value=>$listing->{description},
- -label=>WebGUI::International::get('description','Asset_Matrix'),
+ -label=>$i18n->get('description'),
);
if ($self->canEdit) {
$f->selectBox(
-name=>"maintainerId",
-value=>[$listing->{maintainerId}],
- -label=>WebGUI::International::get('listing maintainer','Asset_Matrix'),
+ -label=>$i18n->get('listing maintainer'),
-options=>$self->session->db->buildHashRef("select userId,username from users order by username")
- -hoverHelp=>WebGUI::International::get('listing maintainer description','Asset_Matrix'),
+ -hoverHelp=>$i18n->get('listing maintainer description'),
);
}
my %goodBad = (
- "No" => WebGUI::International::get("no",'Asset_Matrix'),
- "Yes" => WebGUI::International::get("yes",'Asset_Matrix'),
- "Free Add On" => WebGUI::International::get("free",'Asset_Matrix'),
- "Costs Extra" => WebGUI::International::get("extra",'Asset_Matrix'),
- "Limited" => WebGUI::International::get("limited",'Asset_Matrix'),
+ "No" => $i18n->get("no"),
+ "Yes" => $i18n->get("yes"),
+ "Free Add On" => $i18n->get("free"),
+ "Costs Extra" => $i18n->get("extra"),
+ "Limited" => $i18n->get("limited"),
);
foreach my $category ($self->getCategories()) {
$f->raw(''.$category.' ');
@@ -523,7 +530,7 @@ sub www_editListing {
-subtext=>" ".$field->{description}
);
} elsif ($field->{fieldType} eq "goodBad") {
- my $value = ($field->{value} || $field->{defaultValue} || WebGUI::International::get("no",'Asset_Matrix'));
+ my $value = ($field->{value} || $field->{defaultValue} || $i18n->get("no"));
$f->selectBox(
-name=>$field->{name},
-value=>[$value],
@@ -562,7 +569,7 @@ sub www_editListing {
$a->finish;
}
$f->submit;
- return $self->processStyle(WebGUI::International::get('edit listing','Asset_Matrix').$f->print);
+ return $self->processStyle($i18n->get('edit listing').$f->print);
}
@@ -570,7 +577,8 @@ sub www_editListing {
sub www_editListingSave {
my $self = shift;
my $listing = $self->session->db->getRow("Matrix_listing","listingId",$self->session->form->process("listingId"));
- return WebGUI::International('no edit rights','Asset_Matrix') unless (($self->session->form->process("listingId") eq "new" && $self->session->user->isInGroup($self->get("groupToAdd"))) || $self->session->user->profileField("userId") eq $listing->{maintainerId} || $self->canEdit);
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
+ return $i18n->get('no edit rights') unless (($self->session->form->process("listingId") eq "new" && $self->session->user->isInGroup($self->get("groupToAdd"))) || $self->session->user->profileField("userId") eq $listing->{maintainerId} || $self->canEdit);
my %data = (
listingId => $self->session->form->process("listingId"),
lastUpdated => $self->session->datetime->time(),
@@ -649,6 +657,7 @@ sub www_editListingSave {
sub www_editField {
my $self = shift;
return $self->session->privilege->insufficient() unless($self->canEdit);
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
my $field = $self->session->db->getRow("Matrix_field","fieldId",$self->session->form->process("fieldId"));
my $f = WebGUI::HTMLForm->new($self->session,-action=>$self->getUrl);
$f->hidden(
@@ -662,34 +671,39 @@ sub www_editField {
$f->text(
-name=>"name",
-value=>$field->{name},
- -label=>WebGUI::International::get('name','Asset_Matrix'),
+ -label=>$i18n->get('field name'),
+ -hoverHelp=>$i18n->get('field name description'),
);
$f->text(
-name=>"label",
-value=>$field->{label},
- -label=>WebGUI::International::get('label','Asset_Matrix'),
+ -label=>$i18n->get('field label'),
+ -hoverHelp=>$i18n->get('field label description'),
);
$f->selectBox(
-name=>"fieldType",
-value=>[$field->{fieldType}],
- -label=>WebGUI::International::get('type','Asset_Matrix'),
+ -label=>$i18n->get('field type'),
+ -hoverHelp=>$i18n->get('field type description'),
-options=>{
- 'goodBad' => WebGUI::International::get('good bad','Asset_Matrix'),
- 'text' => WebGUI::International::get('text','Asset_Matrix'),
- 'url' => WebGUI::International::get('url','Asset_Matrix'),
- 'textarea' => WebGUI::International::get('text area','Asset_Matrix'),
- 'combo' => WebGUI::International::get('combo','Asset_Matrix'),
+ 'goodBad' => $i18n->get('good bad'),
+ 'text' => $i18n->get('text'),
+ 'url' => $i18n->get('url'),
+ 'textarea' => $i18n->get('text area'),
+ 'combo' => $i18n->get('combo'),
}
);
$f->textarea(
-name=>"description",
-value=>$field->{description},
- -label=>WebGUI::International::get('description','Asset_Matrix'),
+ -label=>$i18n->get('field description'),
+ -hoverHelp=>$i18n->get('field description description'),
);
$f->text(
-name=>"defaultValue",
-value=>$field->{defaultValue},
- -label=>WebGUI::International::get('default value','Asset_Matrix'),
+ -label=>$i18n->get('default value'),
+ -hoverHelp=>$i18n->get('default value description'),
);
my %cats;
foreach my $category ($self->getCategories) {
@@ -698,11 +712,12 @@ sub www_editField {
$f->selectBox(
-name=>"category",
-value=>[$field->{category}],
- -label=>WebGUI::International::get('category','Asset_Matrix'),
+ -label=>$i18n->get('category'),
+ -hoverHelp=>$i18n->get('category description'),
-options=>\%cats
);
$f->submit;
- return $self->processStyle(WebGUI::International::get('edit field','Asset_Matrix').$f->print);
+ return $self->processStyle($i18n->get('edit field').$f->print);
}
@@ -727,7 +742,8 @@ sub www_editFieldSave {
sub www_listFields {
my $self = shift;
return $self->session->privilege->insufficient() unless($self->canEdit);
- my $output = sprintf WebGUI::International::get('list fields','Asset_Matrix'),
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
+ my $output = sprintf $i18n->get('list fields'),
$self->getUrl("func=editField&fieldId=new");
my $sth = $self->session->db->read("select fieldId, label from Matrix_field where assetId=".$self->session->db->quote($self->getId)." order by label");
while (my ($id, $label) = $sth->array) {
@@ -957,6 +973,7 @@ sub www_viewDetail {
my $listingId = shift || $self->session->form->process("listingId");
my $hasRated = shift || $self->hasRated($listingId);
my %var;
+ my $i18n = WebGUI::International->new($self->session,'Asset_Matrix');
my $listing = $self->session->db->getRow("Matrix_listing","listingId",$listingId);
my $forum = WebGUI::Asset::Wobject::Collaboration->new($listing->{forumId});
$var{"discussion"} = $forum->view;
@@ -1006,23 +1023,23 @@ sub www_viewDetail {
-extras=>'class="content"',
-name=>"from",
-value=>$self->session->user->profileField("email"),
- -label=>WebGUI::International::get('your email','Asset_Matrix'),
+ -label=>$i18n->get('your email'),
);
$f->selectBox(
-name=>"subject",
-extras=>'class="content"',
-options=>{
- WebGUI::International::get('report error','Asset_Matrix')=>"Report an error.",
- WebGUI::International::get('general comment','Asset_Matrix')=>"General comment.",
+ $i18n->get('report error')=>"Report an error.",
+ $i18n->get('general comment')=>"General comment.",
},
- -label=>WebGUI::International::get('request type','Asset_Matrix'),
+ -label=>$i18n->get('request type'),
);
$f->textarea(
-rows=>4,
-extras=>'class="content"',
-columns=>35,
-name=>"body",
- -label=>WebGUI::International::get('comment','Asset_Matrix'),
+ -label=>$i18n->get('comment'),
);
$f->submit(
-extras=>'class="content"',
@@ -1089,7 +1106,7 @@ sub www_viewDetail {
$f->submit(
-extras=>'class="ratingForm"',
-value=>"Rate",
- -label=>''.WebGUI::International::get('show ratings','Asset_Matrix').' '
+ -label=>''.$i18n->get('show ratings').' '
);
if ($hasRated) {
$var{'ratings'} = $ratingsTable;
diff --git a/lib/WebGUI/Asset/Wobject/MessageBoard.pm b/lib/WebGUI/Asset/Wobject/MessageBoard.pm
index aab8095ab..b2cda4f82 100644
--- a/lib/WebGUI/Asset/Wobject/MessageBoard.pm
+++ b/lib/WebGUI/Asset/Wobject/MessageBoard.pm
@@ -25,7 +25,9 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ return $class->SUPER::definition($definition);
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_MessageBoard");
my %properties;
tie %properties, 'Tie::IxHash';
%properties = (
@@ -34,19 +36,19 @@ sub definition {
fieldType=>"template",
defaultValue=>'PBtmpl0000000000000047',
namespace=>"MessageBoard",
- label=>WebGUI::International::get(73,"Asset_MessageBoard"),
- hoverHelp=>WebGUI::International::get('73 description',"Asset_MessageBoard")
+ label=>$i18n->get(73),
+ hoverHelp=>$i18n->get('73 description')
}
);
push(@{$definition}, {
- assetName=>WebGUI::International::get('assetName',"Asset_MessageBoard"),
+ assetName=>$i18n->get('assetName'),
icon=>'messageBoard.gif',
tableName=>'MessageBoard',
className=>'WebGUI::Asset::Wobject::MessageBoard',
autoGenerateForms=>1,
properties=>\%properties
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
@@ -57,6 +59,7 @@ sub view {
my $count;
my $first;
my @forum_loop;
+ my $i18n = WebGUI::International->new($self->session,"Asset_MessageBoard");
my $children = $self->getLineage(["children"],{includeOnlyClasses=>["WebGUI::Asset::Wobject::Collaboration"],returnObjects=>1});
foreach my $child (@{$children}) {
$count++;
@@ -97,13 +100,13 @@ sub view {
}
$var{'default.listing'} = $first->view if ($count == 1 && defined $first);
$var{'forum.add.url'} = $self->getUrl("func=add;class=WebGUI::Asset::Wobject::Collaboration");
- $var{'forum.add.label'} = WebGUI::International::get(75,"Asset_MessageBoard");
- $var{'title.label'} = WebGUI::International::get('title','Asset_MessageBoard');
- $var{'views.label'} = WebGUI::International::get('views',,'Asset_MessageBoard');
- $var{'rating.label'} = WebGUI::International::get('rating','Asset_MessageBoard');
- $var{'threads.label'} = WebGUI::International::get('threads','Asset_MessageBoard');
- $var{'replies.label'} = WebGUI::International::get('replies','Asset_MessageBoard');
- $var{'lastpost.label'} = WebGUI::International::get('lastpost','Asset_MessageBoard');
+ $var{'forum.add.label'} = $i18n->get(75);
+ $var{'title.label'} = $i18n->get('title');
+ $var{'views.label'} = $i18n->get('views');
+ $var{'rating.label'} = $i18n->get('rating');
+ $var{'threads.label'} = $i18n->get('threads');
+ $var{'replies.label'} = $i18n->get('replies');
+ $var{'lastpost.label'} = $i18n->get('lastpost');
$var{areMultipleForums} = ($count > 1);
$var{forum_loop} = \@forum_loop;
return $self->processTemplate(\%var,$self->get("templateId"));
diff --git a/lib/WebGUI/Asset/Wobject/MultiSearch.pm b/lib/WebGUI/Asset/Wobject/MultiSearch.pm
index 8bb30aa39..b573ae994 100644
--- a/lib/WebGUI/Asset/Wobject/MultiSearch.pm
+++ b/lib/WebGUI/Asset/Wobject/MultiSearch.pm
@@ -42,8 +42,9 @@ defines wobject properties for MultiSearch instances
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
- my $i18n = WebGUI::International->new("Asset_MultiSearch");
+ my $i18n = WebGUI::International->new($session, "Asset_MultiSearch");
my $properties = {
templateId =>{
fieldType=>"template",
@@ -57,8 +58,8 @@ sub definition {
# fieldType=>"textarea",
# defaultValue=>"WebGUI",
# tab=>"properties",
-# hoverHelp=>WebGUI::International::get('article template description','Asset_Article'),
-# label=>WebGUI::International::get(72,"Asset_Article")
+# hoverHelp=>$i18n->get('article template description','Asset_Article'),
+# label=>$i18n->get(72,"Asset_Article")
# },
};
push(@{$definition}, {
@@ -69,7 +70,7 @@ sub definition {
autoGenerateForms=>1,
properties=>$properties
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm
index 074edb815..b4dc2dab0 100644
--- a/lib/WebGUI/Asset/Wobject/Navigation.pm
+++ b/lib/WebGUI/Asset/Wobject/Navigation.pm
@@ -30,9 +30,11 @@ our @ISA = qw(WebGUI::Asset::Wobject);
#-------------------------------------------------------------------
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift;
+ my $i18n = WebGUI::International->new($session,"Asset_Navigation");
push(@{$definition}, {
- assetName=>WebGUI::International::get("assetName","Asset_Navigation"),
+ assetName=>$i18n->get("assetName"),
icon=>'navigation.gif',
tableName=>'Navigation',
className=>'WebGUI::Asset::Wobject::Navigation',
@@ -75,14 +77,14 @@ sub definition {
}
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
sub getEditForm {
my $self = shift;
my $tabform = $self->SUPER::getEditForm;
- my $i18n = WebGUI::International->new("Asset_Navigation");
+ my $i18n = WebGUI::International->new($self->session, "Asset_Navigation");
$tabform->getTab("display")->template(
-value=>$self->getValue('templateId'),
-namespace=>"Navigation",
@@ -258,8 +260,8 @@ sub getEditForm {
# this.form.func.value='preview';
# this.form.target = 'navPreview';
# this.form.submit()">};
- my $saveButton = ' session->user->profileField("userId")) {
$toolbar = $self->session->icon->edit('func=edit'.$returnUrl,$self->get("url"));
}
- my $i18n = WebGUI::International->new("Asset");
+ my $i18n = WebGUI::International->new($self->session, "Asset");
return '"
);
- $tabform->addTab("display",WebGUI::International::get(105,"Asset"),5);
+ $tabform->addTab("display",$i18n->get(105),5);
$tabform->getTab("display")->yesNo(
-name=>"isHidden",
-value=>$self->get("isHidden"),
- -label=>WebGUI::International::get(886,"Asset"),
+ -label=>$i18n->get(886),
-uiLevel=>6,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_isHidden"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_isHidden"})
);
$tabform->getTab("display")->yesNo(
-name=>"newWindow",
-value=>$self->get("newWindow"),
- -label=>WebGUI::International::get(940,"Asset"),
+ -label=>$i18n->get(940),
-uiLevel=>6,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_newWindow"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_newWindow"})
);
$tabform->getTab("display")->yesNo(
-name=>"displayTitle",
- -label=>WebGUI::International::get(174,"Asset"),
+ -label=>$i18n->get(174),
-value=>$self->getValue("displayTitle"),
-uiLevel=>5,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_displayTitle"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_displayTitle"})
);
$tabform->getTab("display")->template(
-name=>"styleTemplateId",
- -label=>WebGUI::International::get(1073,"Asset"),
+ -label=>$i18n->get(1073),
-value=>$self->getValue("styleTemplateId"),
-namespace=>'style',
-afterEdit=>'op=editPage;npp='.$self->session->form->process("npp"),
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_styleTemplateId"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_styleTemplateId"})
);
$tabform->getTab("display")->template(
-name=>"printableStyleTemplateId",
- -label=>WebGUI::International::get(1079,"Asset"),
+ -label=>$i18n->get(1079),
-value=>$self->getValue("printableStyleTemplateId"),
-namespace=>'style',
-afterEdit=>'op=editPage;npp='.$self->session->form->process("npp"),
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_printableStyleTemplateId"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_printableStyleTemplateId"})
);
$tabform->getTab("display")->interval(
-name=>"cacheTimeout",
- -label=>WebGUI::International::get(895,"Asset"),
+ -label=>$i18n->get(895),
-value=>$self->getValue("cacheTimeout"),
-uiLevel=>8,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_cacheTimeout"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_cacheTimeout"})
);
$tabform->getTab("display")->interval(
-name=>"cacheTimeoutVisitor",
- -label=>WebGUI::International::get(896,"Asset"),
+ -label=>$i18n->get(896),
-value=>$self->getValue("cacheTimeoutVisitor"),
-uiLevel=>8,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_cacheTimeoutVisitor"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_cacheTimeoutVisitor"})
);
- $tabform->addTab("security",WebGUI::International::get(107,"Asset"),6);
+ $tabform->addTab("security",$i18n->get(107),6);
$tabform->getTab("security")->yesNo(
-name=>"encryptPage",
-value=>$self->get("encryptPage"),
- -label=>WebGUI::International::get('encrypt page',"Asset"),
+ -label=>$i18n->get('encrypt page'),
-uiLevel=>6,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_encryptPage"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_encryptPage"})
);
$tabform->getTab("security")->dateTime(
-name=>"startDate",
- -label=>WebGUI::International::get(497,"Asset"),
+ -label=>$i18n->get(497),
-value=>$self->get("startDate"),
-uiLevel=>6,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_startDate"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_startDate"})
);
$tabform->getTab("security")->dateTime(
-name=>"endDate",
- -label=>WebGUI::International::get(498,"Asset"),
+ -label=>$i18n->get(498),
-value=>$self->get("endDate"),
-uiLevel=>6,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_endDate"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_endDate"})
);
my $subtext;
if ($self->session->user->isInGroup(3)) {
@@ -223,35 +224,35 @@ sub www_editBranch {
$tabform->getTab("security")->selectBox(
-name=>"ownerUserId",
-options=>$users,
- -label=>WebGUI::International::get(108,"Asset"),
+ -label=>$i18n->get(108),
-value=>[$self->get("ownerUserId")],
-subtext=>$subtext,
-uiLevel=>6,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_ownerUserId"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_ownerUserId"})
);
$tabform->getTab("security")->group(
-name=>"groupIdView",
- -label=>WebGUI::International::get(872,"Asset"),
+ -label=>$i18n->get(872),
-value=>[$self->get("groupIdView")],
-uiLevel=>6,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_groupIdView"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_groupIdView"})
);
$tabform->getTab("security")->group(
-name=>"groupIdEdit",
- -label=>WebGUI::International::get(871,"Asset"),
+ -label=>$i18n->get(871),
-value=>[$self->get("groupIdEdit")],
-excludeGroups=>[1,7],
-uiLevel=>6,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_groupIdEdit"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_groupIdEdit"})
);
- $tabform->addTab("meta",WebGUI::International::get("Metadata","Asset"),3);
+ $tabform->addTab("meta",$i18n->get("Metadata"),3);
$tabform->getTab("meta")->textarea(
-name=>"extraHeadTags",
- -label=>WebGUI::International::get("extra head tags","Asset"),
- -hoverHelp=>WebGUI::International::get('extra head tags description',"Asset"),
+ -label=>$i18n->get("extra head tags"),
+ -hoverHelp=>$i18n->get('extra head tags description'),
-value=>$self->get("extraHeadTags"),
-uiLevel=>5,
- -subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_extraHeadTags"})
+ -subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_extraHeadTags"})
);
if ($self->session->setting->get("metaDataEnabled")) {
my $meta = $self->getMetaDataFields();
@@ -261,7 +262,7 @@ sub www_editBranch {
# Add a "Select..." option on top of a select list to prevent from
# saving the value on top of the list when no choice is made.
if($fieldType eq "selectList") {
- $options = {"", WebGUI::International::get("Select","Asset")};
+ $options = {"", $i18n->get("Select")};
}
$tabform->getTab("meta")->dynamicField(
name=>"metadata_".$meta->{$field}{fieldId},
@@ -271,7 +272,7 @@ sub www_editBranch {
extras=>qq/title="$meta->{$field}{description}"/,
possibleValues=>$meta->{$field}{possibleValues},
options=>$options,
- subtext=>' '.WebGUI::International::get("change","Asset").' '.WebGUI::Form::yesNo($self->session,{name=>"change_metadata_".$meta->{$field}{fieldId}}),
+ subtext=>' '.$i18n->get("change").' '.WebGUI::Form::yesNo($self->session,{name=>"change_metadata_".$meta->{$field}{fieldId}}),
fieldType=>$fieldType
);
}
diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm
index 27798ccf7..60208322d 100644
--- a/lib/WebGUI/AssetClipboard.pm
+++ b/lib/WebGUI/AssetClipboard.pm
@@ -308,22 +308,22 @@ sub www_manageClipboard {
my $self = shift;
my $ac = WebGUI::AdminConsole->new($self->session,"clipboard");
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(12));
+ my $i18n = WebGUI::International->new($self->session, "Asset");
my ($header,$limit);
$ac->setHelp("clipboard manage");
if ($self->session->form->process("systemClipboard") && $self->session->user->isInGroup(3)) {
- $header = WebGUI::International::get(966,"Asset");
- $ac->addSubmenuItem($self->getUrl('func=manageClipboard'), WebGUI::International::get(949,"Asset"));
- $ac->addSubmenuItem($self->getUrl('func=emptyClipboard;systemClipboard=1'), WebGUI::International::get(959,"Asset"),
- 'onclick="return window.confirm(\''.WebGUI::International::get(951).'\')"',"Asset");
+ $header = $i18n->get(966);
+ $ac->addSubmenuItem($self->getUrl('func=manageClipboard'), $i18n->get(949));
+ $ac->addSubmenuItem($self->getUrl('func=emptyClipboard;systemClipboard=1'), $i18n->get(959),
+ 'onclick="return window.confirm(\''.$i18n->get(951,"WebGUI").'\')"',"Asset");
} else {
- $ac->addSubmenuItem($self->getUrl('func=manageClipboard;systemClipboard=1'), WebGUI::International::get(954,"Asset"));
- $ac->addSubmenuItem($self->getUrl('func=emptyClipboard'), WebGUI::International::get(950,"Asset"),
- 'onclick="return window.confirm(\''.WebGUI::International::get(951).'\')"',"Asset");
+ $ac->addSubmenuItem($self->getUrl('func=manageClipboard;systemClipboard=1'), $i18n->get(954));
+ $ac->addSubmenuItem($self->getUrl('func=emptyClipboard'), $i18n->get(950),
+ 'onclick="return window.confirm(\''.$i18n->(951,"WebGUI").'\')"',"Asset");
$limit = 1;
}
$self->session->style->setLink($self->session->config->get("extrasURL").'/assetManager/assetManager.css', {rel=>"stylesheet",type=>"text/css"});
$self->session->style->setScript($self->session->config->get("extrasURL").'/assetManager/assetManager.js', {type=>"text/javascript"});
- my $i18n = WebGUI::International->new("Asset");
my $output = "
|;
$f->selectBox(
-name=>"authLDAP_ldapConnection",
- -label=>WebGUI::International::get("ldapConnection",'AuthLDAP'),
- -hoverHelp=>WebGUI::International::get("ldapConnection description",'AuthLDAP'),
+ -label=>$i18n->get("ldapConnection"),
+ -hoverHelp=>$i18n->get("ldapConnection description"),
-options=>WebGUI::LDAPLink->getList($self->session,),
-value=>[$ldapConnection],
-extras=>q|onchange="this.form.authLDAP_ldapUrl.value=ldapValue[this.options[this.selectedIndex].value];"|
@@ -123,12 +123,12 @@ sub addUserForm {
}
$f->url(
-name => "authLDAP_ldapUrl",
- -label => WebGUI::International::get(3,'AuthLDAP'),
+ -label => $i18n->get(3),
-value => $ldapUrl,
);
$f->text(
-name => "authLDAP_connectDN",
- -label => WebGUI::International::get(4,'AuthLDAP'),
+ -label => $i18n->get(4),
-value => $connectDN,
);
$self->session->style->setRawHeadTags($jscript);
@@ -162,8 +162,9 @@ sub authenticate {
my $userData = $self->getParams;
- $error .= WebGUI::International::get(12,'AuthLDAP') if ($userData->{ldapUrl} eq "");
- $error .= WebGUI::International::get(11,'AuthLDAP') if ($userData->{connectDN} eq "");
+ my $i18n = WebGUI::International->new($self->session);
+ $error .= $i18n->get(12,'AuthLDAP') if ($userData->{ldapUrl} eq "");
+ $error .= $i18n->get(11,'AuthLDAP') if ($userData->{connectDN} eq "");
$self->error($error);
if($error ne ""){
@@ -172,21 +173,21 @@ sub authenticate {
}
if($uri = URI->new($userData->{ldapUrl})) {
- $ldap = Net::LDAP->new($uri->host, (port=>$uri->port)) or $error .= WebGUI::International::get(2,'AuthLDAP');
+ $ldap = Net::LDAP->new($uri->host, (port=>$uri->port)) or $error .= $i18n->get(2,'AuthLDAP');
if($error ne ""){
$self->user(WebGUI::User->new($self->session,1));
return 0 ;
}
$auth = $ldap->bind(dn=>$userData->{connectDN}, password=>$identifier);
if ($auth->code == 48 || $auth->code == 49){
- $error .= WebGUI::International::get(68);
+ $error .= $i18n->get(68);
}elsif($auth->code > 0){
- $error .= 'LDAP error "'.$ldapStatusCode{$auth->code}.'" occured.'.WebGUI::International::get(69);
- $self->session->errorHandler->error("LDAP error: ".$ldapStatusCode{$auth->code});
+ $error .= 'LDAP error "'.$self->ldapStatusCode($auth->code).'" occured.'.$i18n->get(69);
+ $self->session->errorHandler->error("LDAP error: ".$self->ldapStatusCode($auth->code));
}
$ldap->unbind;
}else{
- $error .= WebGUI::International::get(13,'AuthLDAP');
+ $error .= $i18n->get(13,'AuthLDAP');
$self->session->errorHandler->error("Could not process this LDAP URL: ".$userData->{ldapUrl});
}
if($error ne ""){
@@ -213,7 +214,8 @@ sub createAccount {
}
my $connection = $self->{_connection};
$vars->{'create.message'} = $_[0] if ($_[0]);
- $vars->{'create.form.ldapConnection.label'} = WebGUI::International::get("ldapConnection","AuthLDAP");
+ my $i18n = WebGUI::International->new($self->session,"AuthLDAP");
+ $vars->{'create.form.ldapConnection.label'} = $i18n->get("ldapConnection");
my $url = $self->session->url->page("op=auth;method=createAccount;connection=");
$vars->{'create.form.ldapConnection'} = WebGUI::Form::selectBox({
@@ -237,10 +239,11 @@ sub createAccountSave {
my $username = $self->session->form->get('authLDAP_ldapId');
my $password = $self->session->form->get('authLDAP_identifier');
my $error = "";
+ my $i18n = WebGUI::International->new($self->session);
#Validate user in LDAP
if(!$self->_isValidLDAPUser()){
- return $self->createAccount("".WebGUI::International::get(70)." ".$self->error);
+ return $self->createAccount("".$i18n->get(70)." ".$self->error);
}
my $connection = $self->{_connection};
@@ -271,11 +274,11 @@ sub createAccountSave {
#Validate profile data.
my ($profile, $temp, $warning) = WebGUI::Operation::Profile::validateProfileData();
$error .= $temp;
- return $self->createAccount("".WebGUI::International::get(70)." ".$error) unless ($error eq "");
+ return $self->createAccount("".$i18n->get(70)." ".$error) unless ($error eq "");
#If Email address is not unique, a warning is displayed
if($warning ne "" && !$self->session->form->process("confirm")){
$self->session->form->process("confirm") = 1;
- return $self->createAccount(''.WebGUI::International::get(1078).' ');
+ return $self->createAccount(''.$i18n->get(1078).' ');
}
my $properties;
@@ -304,11 +307,12 @@ sub displayAccount {
my $self = shift;
my $vars;
return $self->displayLogin($_[0]) if ($self->userId eq '1');
- $vars->{displayTitle} = ''.WebGUI::International::get(61).' ';
- $vars->{'account.message'} = WebGUI::International::get(856);
+ my $i18n = WebGUI::International->new($self->session);
+ $vars->{displayTitle} = ''.$i18n->get(61).' ';
+ $vars->{'account.message'} = $i18n->get(856);
if($self->session->setting->get("useKarma")){
$vars->{'account.form.karma'} = $self->session->user->profileField("karma");
- $vars->{'account.form.karma.label'} = WebGUI::International::get(537);
+ $vars->{'account.form.karma.label'} = $i18n->get(537);
}
$vars->{'account.options'} = WebGUI::Operation::Shared::accountOptions();
return WebGUI::Asset::Template->new($self->session,$self->getAccountTemplateId)->process($vars);
@@ -365,7 +369,8 @@ sub editUserSettingsForm {
options=>WebGUI::LDAPLink->getList($self->session,),
value=>[$self->session->setting->get("ldapConnection")]
});
- my $ldapConnectionLabel = WebGUI::International::get("ldapConnection",'AuthLDAP');
+ my $i18n = WebGUI::International->new($self->session,'AuthLDAP');
+ my $ldapConnectionLabel = $i18n->get("ldapConnection");
my $buttons = "";
if($self->session->setting->get("ldapConnection")) {
$buttons = $self->session->icon->edit("op=editLDAPLink;returnUrl=".$self->session->url->escape($self->session->url->page("op=editSettings")).";llid=".$self->session->setting->get("ldapConnection"));
@@ -398,7 +403,8 @@ sub login {
my $self = shift;
if(!$self->authenticate($self->session->form->process("username"),$self->session->form->process("identifier"))){
$self->session->errorHandler->security("login to account ".$self->session->form->process("username")." with invalid information.");
- return $self->displayLogin("".WebGUI::International::get(70)." ".$self->error);
+ my $i18n = WebGUI::International->new($self->session);
+ return $self->displayLogin("".$i18n->get(70)." ".$self->error);
}
$self->session->scratch->delete("ldapConnection");
return $self->SUPER::login(); #Standard login routine for login
@@ -412,8 +418,19 @@ sub new {
my @callable = ('createAccount','deactivateAccount','displayAccount','displayLogin','login','logout','createAccountSave','deactivateAccountConfirm');
my $self = WebGUI::Auth->new($authMethod,$userId,\@callable);
$self->{_connection} = WebGUI::LDAPLink->new($self->session,($self->session->scratch->get("ldapConnection") || $self->session->setting->get("ldapConnection")))->get;
+ my $i18n = WebGUI::International->new($self->session, "AuthLDAP");
+ my %ldapStatusCode = map { $_ => $i18n->get("LDAPLink_".$_) }
+ (0..21, 32,33,34,36, 48..54, 64..71, 80);
+ $self->{_statusCode} = \%ldapStatusCode;
bless $self, $class;
}
+#-------------------------------------------------------------------
+sub ldapStatusCode {
+ my ($self, $code) = @_;
+ return $self->{_statusCode}->{$code};
+
+}
+
1;
diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm
index 3282a548b..0d31d7ca5 100644
--- a/lib/WebGUI/Auth/WebGUI.pm
+++ b/lib/WebGUI/Auth/WebGUI.pm
@@ -42,15 +42,16 @@ sub _isValidPassword {
WebGUI::Macro::negate(\$confirm);
my $error = "";
+ my $i18n = WebGUI::International->new($self->session,'AuthWebGUI');
if ($password ne $confirm) {
- $error .= ''.WebGUI::International::get(3,'AuthWebGUI').' ';
+ $error .= ''.$i18n->get(3).' ';
}
if ($password eq "") {
- $error .= ''.WebGUI::International::get(4,'AuthWebGUI').' ';
+ $error .= ''.$i18n->get(4).' ';
}
if ($self->getSetting("passwordLength") && length($password) < $self->getSetting("passwordLength")){
- $error .= ''.WebGUI::International::get(7,'AuthWebGUI')." ".$self->getSetting("passwordLength").' ';
+ $error .= ''.$i18n->get(7)." ".$self->getSetting("passwordLength").' ';
}
$self->error($error);
@@ -81,14 +82,15 @@ sub addUserForm {
my $self = shift;
my $userData = $self->getParams;
my $f = WebGUI::HTMLForm->new($self->session);
+ my $i18n = WebGUI::International->new($self->session);
$f->password(
name=>"authWebGUI.identifier",
- label=>WebGUI::International::get(51),
+ label=>$i18n->get(51),
value=>"password"
);
$f->interval(
-name=>"authWebGUI.passwordTimeout",
- -label=>WebGUI::International::get(16,'AuthWebGUI'),
+ -label=>$i18n->get(16,'AuthWebGUI'),
-value=>$userData->{passwordTimeout},
-defaultValue=>$self->session->setting->get("webguiPasswordTimeout")
);
@@ -99,7 +101,7 @@ sub addUserForm {
$f->yesNo(
-name=>"authWebGUI.changeUsername",
-value=>$userChange,
- -label=>WebGUI::International::get(21,'AuthWebGUI')
+ -label=>$i18n->get(21,'AuthWebGUI')
);
my $passwordChange = $self->session->setting->get("webguiChangePassword");
if($passwordChange || $passwordChange eq "0"){
@@ -108,7 +110,7 @@ sub addUserForm {
$f->yesNo(
-name=>"authWebGUI.changePassword",
-value=>$passwordChange,
- -label=>WebGUI::International::get(20,'AuthWebGUI')
+ -label=>$i18n->get(20,'AuthWebGUI')
);
return $f->printRowsOnly;
}
@@ -164,6 +166,7 @@ sub createAccount {
} elsif (!$self->session->setting->get("anonymousRegistration")) {
return $self->displayLogin;
}
+ my $i18n = WebGUI::International->new($self->session);
$vars->{'create.message'} = $_[0] if ($_[0]);
my $storage = WebGUI::Storage::Image->createTemp;
my ($filename, $challenge) = $storage->addFileFromCaptcha;
@@ -172,18 +175,18 @@ sub createAccount {
$vars->{'create.form.captcha'} = WebGUI::Form::text($self->session,{"name"=>"authWebGUI.captcha", size=>6, maxlength=>6})
.WebGUI::Form::hidden($self->session,{name=>"authWebGUI.captcha.validation", value=>Digest::MD5::md5_base64(lc($challenge))})
.' ';
- $vars->{'create.form.captcha.label'} = WebGUI::International::get("captcha label","AuthWebGUI");
+ $vars->{'create.form.captcha.label'} = $i18n->get("captcha label","AuthWebGUI");
}
$vars->{'create.form.username'} = WebGUI::Form::text($self->session,{"name"=>"authWebGUI.username","value"=>$self->session->form->process(""authWebGUI.username"}"));
- $vars->{'create.form.username.label'} = WebGUI::International::get(50);
+ $vars->{'create.form.username.label'} = $i18n->get(50);
$vars->{'create.form.password'} = WebGUI::Form::password($self->session,{"name"=>"authWebGUI.identifier"});
- $vars->{'create.form.password.label'} = WebGUI::International::get(51);
+ $vars->{'create.form.password.label'} = $i18n->get(51);
$vars->{'create.form.passwordConfirm'} = WebGUI::Form::password($self->session,{"name"=>"authWebGUI.identifierConfirm"});
- $vars->{'create.form.passwordConfirm.label'} = WebGUI::International::get(2,'AuthWebGUI');
+ $vars->{'create.form.passwordConfirm.label'} = $i18n->get(2,'AuthWebGUI');
$vars->{'create.form.hidden'} = WebGUI::Form::hidden($self->session,{"name"=>"confirm","value"=>$self->session->form->process("confirm")});
$vars->{'recoverPassword.isAllowed'} = $self->getSetting("passwordRecovery");
$vars->{'recoverPassword.url'} = $self->session->url->page('op=auth;method=recoverPassword');
- $vars->{'recoverPassword.label'} = WebGUI::International::get(59);
+ $vars->{'recoverPassword.label'} = $i18n->get(59);
return $self->SUPER::createAccount("createAccountSave",$vars);
}
@@ -198,10 +201,11 @@ sub createAccountSave {
my $passConfirm = $self->session->form->get('authWebGUI.identifierConfirm');
my $error;
+ my $i18n = WebGUI::International->new($self->session);
$error = $self->error unless($self->validUsername($username));
if ($self->session->setting->get("webguiUseCaptcha")) {
unless ($self->session->form->get('authWebGUI.captcha.validation') eq Digest::MD5::md5_base64(lc($self->session->form->get('authWebGUI.captcha')))) {
- $error .= WebGUI::International::get("captcha failure","AuthWebGUI");
+ $error .= $i18n->get("captcha failure","AuthWebGUI");
}
}
$error .= $self->error unless($self->_isValidPassword($password,$passConfirm));
@@ -213,7 +217,7 @@ sub createAccountSave {
#If Email address is not unique, a warning is displayed
if($warning ne "" && !$self->session->form->process("confirm")){
$self->session->form->process("confirm") = 1;
- return $self->createAccount(''.WebGUI::International::get(1078).' ');
+ return $self->createAccount(''.$i18n->get(1078).' ');
}
my $properties;
@@ -229,8 +233,8 @@ sub createAccountSave {
$self->saveParams($self->userId,"WebGUI",{emailValidationKey=>$key});
WebGUI::Mail::send(
$profile->{email},
- WebGUI::International::get('email address validation email subject','AuthWebGUI'),
- WebGUI::International::get('email address validation email body','AuthWebGUI')."\n\n".$self->session->url->getSiteURL().$self->session->url->page("op=auth;method=validateEmail;key=".$key),
+ $i18n->get('email address validation email subject','AuthWebGUI'),
+ $i18n->get('email address validation email body','AuthWebGUI')."\n\n".$self->session->url->getSiteURL().$self->session->url->page("op=auth;method=validateEmail;key=".$key),
);
$self->user->status("Deactivated");
$self->session->var->end($self->session->var->get("sessionId"));
@@ -238,7 +242,7 @@ sub createAccountSave {
my $u = WebGUI::User->new($self->session,1);
$self->{user} = $u;
$self->logout;
- return $self->displayLogin(WebGUI::International::get('check email for validation','AuthWebGUI'));
+ return $self->displayLogin($i18n->get('check email for validation','AuthWebGUI'));
}
return "";
}
@@ -262,22 +266,23 @@ sub displayAccount {
my $self = shift;
my $vars;
return $self->displayLogin($_[0]) if ($self->userId eq '1');
+ my $i18n = WebGUI::International->new($self->session);
my $userData = $self->getParams;
$vars->{'account.message'} = $_[0] if ($_[0]);
$vars->{'account.noform'} = 1;
if($userData->{changeUsername} || (!defined $userData->{changeUsername} && $self->session->setting->get("webguiChangeUsername"))){
$vars->{'account.form.username'} = WebGUI::Form::text($self->session,{"name"=>"authWebGUI.username","value"=>$self->username});
- $vars->{'account.form.username.label'} = WebGUI::International::get(50);
+ $vars->{'account.form.username.label'} = $i18n->get(50);
$vars->{'account.noform'} = 0;
}
if($userData->{changePassword} || (!defined $userData->{changePassword} && $self->session->setting->get("webguiChangePassword"))){
$vars->{'account.form.password'} = WebGUI::Form::password($self->session,{"name"=>"authWebGUI.identifier","value"=>"password"});
- $vars->{'account.form.password.label'} = WebGUI::International::get(51);
+ $vars->{'account.form.password.label'} = $i18n->get(51);
$vars->{'account.form.passwordConfirm'} = WebGUI::Form::password($self->session,{"name"=>"authWebGUI.identifierConfirm","value"=>"password"});
- $vars->{'account.form.passwordConfirm.label'} = WebGUI::International::get(2,'AuthWebGUI');
+ $vars->{'account.form.passwordConfirm.label'} = $i18n->get(2,'AuthWebGUI');
$vars->{'account.noform'} = 0;
}
- $vars->{'account.nofields'} = WebGUI::International::get(22,'AuthWebGUI');
+ $vars->{'account.nofields'} = $i18n->get(22,'AuthWebGUI');
return $self->SUPER::displayAccount("updateAccount",$vars);
}
@@ -293,10 +298,11 @@ sub displayLogin {
my $self = shift;
my $vars;
return $self->displayAccount($_[0]) if ($self->userId ne "1");
+ my $i18n = WebGUI::International->new($self->session);
$vars->{'login.message'} = $_[0] if ($_[0]);
$vars->{'recoverPassword.isAllowed'} = $self->getSetting("passwordRecovery");
$vars->{'recoverPassword.url'} = $self->session->url->page('op=auth;method=recoverPassword');
- $vars->{'recoverPassword.label'} = WebGUI::International::get(59);
+ $vars->{'recoverPassword.label'} = $i18n->get(59);
return $self->SUPER::displayLogin("login",$vars);
}
@@ -348,93 +354,94 @@ sub editUserFormSave {
sub editUserSettingsForm {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session,'AuthWebGUI');
my $f = WebGUI::HTMLForm->new($self->session);
$f->text(
-name=>"webguiPasswordLength",
-value=>$self->session->setting->get("webguiPasswordLength"),
- -label=>WebGUI::International::get(15,'AuthWebGUI'),
+ -label=>$i18n->get(15),
-size=>5,
-maxLength=>5,
);
$f->interval(
-name=>"webguiPasswordTimeout",
- -label=>WebGUI::International::get(16,'AuthWebGUI'),
+ -label=>$i18n->get(16),
-value=>$self->session->setting->get("webguiPasswordTimeout")
);
$f->yesNo(
-name=>"webguiExpirePasswordOnCreation",
-value=>$self->session->setting->get("webguiExpirePasswordOnCreation"),
- -label=>WebGUI::International::get(9,'AuthWebGUI')
+ -label=>$i18n->get(9)
);
$f->yesNo(
-name=>"webguiSendWelcomeMessage",
-value=>$self->session->setting->get("webguiSendWelcomeMessage"),
- -label=>WebGUI::International::get(868)
+ -label=>$i18n->get(868,'WebGUI')
);
$f->textarea(
-name=>"webguiWelcomeMessage",
-value=>$self->session->setting->get("webguiWelcomeMessage"),
- -label=>WebGUI::International::get(869)
+ -label=>$i18n->get(869,'WebGUI')
);
$f->yesNo(
-name=>"webguiChangeUsername",
-value=>$self->session->setting->get("webguiChangeUsername"),
- -label=>WebGUI::International::get(19,'AuthWebGUI')
+ -label=>$i18n->get(19)
);
$f->yesNo(
-name=>"webguiChangePassword",
-value=>$self->session->setting->get("webguiChangePassword"),
- -label=>WebGUI::International::get(18,'AuthWebGUI')
+ -label=>$i18n->get(18)
);
$f->yesNo(
-name=>"webguiPasswordRecovery",
-value=>$self->session->setting->get("webguiPasswordRecovery"),
- -label=>WebGUI::International::get(6,'AuthWebGUI')
+ -label=>$i18n->get(6)
);
$f->textarea(
-name=>"webguiRecoverPasswordEmail",
- -label=>WebGUI::International::get(134),
+ -label=>$i18n->get(134, 'WebGUI'),
-value=>$self->session->setting->get("webguiRecoverPasswordEmail")
);
$f->yesNo(
-name=>"webguiValidateEmail",
-value=>$self->session->setting->get("webguiValidateEmail"),
- -label=>WebGUI::International::get('validate email','AuthWebGUI')
+ -label=>$i18n->get('validate email')
);
$f->yesNo(
-name=>"webguiUseCaptcha",
-value=>$self->session->setting->get("webguiUseCaptcha"),
- -label=>WebGUI::International::get('use captcha','AuthWebGUI')
+ -label=>$i18n->get('use captcha')
);
$f->template(
-name=>"webguiAccountTemplate",
-value=>$self->session->setting->get("webguiAccountTemplate"),
-namespace=>"Auth/WebGUI/Account",
- -label=>WebGUI::International::get("account template","AuthWebGUI")
+ -label=>$i18n->get("account template")
);
$f->template(
-name=>"webguiCreateAccountTemplate",
-value=>$self->session->setting->get("webguiCreateAccountTemplate"),
-namespace=>"Auth/WebGUI/Create",
- -label=>WebGUI::International::get("create account template","AuthWebGUI")
+ -label=>$i18n->get("create account template")
);
$f->template(
-name=>"webguiExpiredPasswordTemplate",
-value=>$self->session->setting->get("webguiExpiredPasswordTemplate"),
-namespace=>"Auth/WebGUI/Expired",
- -label=>WebGUI::International::get("expired password template","AuthWebGUI")
+ -label=>$i18n->get("expired password template")
);
$f->template(
-name=>"webguiLoginTemplate",
-value=>$self->session->setting->get("webguiLoginTemplate"),
-namespace=>"Auth/WebGUI/Login",
- -label=>WebGUI::International::get("login template","AuthWebGUI")
+ -label=>$i18n->get("login template")
);
$f->template(
-name=>"webguiPasswordRecoveryTemplate",
-value=>$self->session->setting->get("webguiPasswordRecoveryTemplate"),
-namespace=>"Auth/WebGUI/Recovery",
- -label=>WebGUI::International::get("password recovery template","AuthWebGUI")
+ -label=>$i18n->get("password recovery template")
);
return $f->printRowsOnly;
}
@@ -471,7 +478,8 @@ sub login {
if(!$self->authenticate($self->session->form->process("username"),$self->session->form->process("identifier"))){
$self->session->http->setStatus("401","Incorrect Credentials");
$self->session->errorHandler->security("login to account ".$self->session->form->process("username")." with invalid information.");
- return $self->displayLogin("".WebGUI::International::get(70)." ".$self->error);
+ my $i18n = WebGUI::International->new($self->session);
+ return $self->displayLogin("".$i18n->get(70)." ".$self->error);
}
my $userData = $self->getParams;
@@ -504,7 +512,8 @@ sub recoverPassword {
return $self->displayLogin if($self->userId ne "1");
my $template = 'Auth/WebGUI/Recovery';
my $vars;
- $vars->{title} = WebGUI::International::get(71);
+ my $i18n = WebGUI::International->new($self->session);
+ $vars->{title} = $i18n->get(71);
$vars->{'recover.form.header'} = "\n\n".WebGUI::Form::formHeader($self->session,{});
$vars->{'recover.form.hidden'} = WebGUI::Form::hidden($self->session,{"name"=>"op","value"=>"auth"});
$vars->{'recover.form.hidden'} .= WebGUI::Form::hidden($self->session,{"name"=>"method","value"=>"recoverPasswordFinish"});
@@ -512,21 +521,22 @@ sub recoverPassword {
$vars->{'recover.form.submit'} = WebGUI::Form::submit($self->session,{});
$vars->{'recover.form.footer'} = WebGUI::Form::formFooter($self->session,);
$vars->{'login.url'} = $self->session->url->page('op=auth;method=init');
- $vars->{'login.label'} = WebGUI::International::get(58);
+ $vars->{'login.label'} = $i18n->get(58);
$vars->{'anonymousRegistration.isAllowed'} = ($self->session->setting->get("anonymousRegistration"));
$vars->{'createAccount.url'} = $self->session->url->page('op=auth=;method=createAccount');
- $vars->{'createAccount.label'} = WebGUI::International::get(67);
+ $vars->{'createAccount.label'} = $i18n->get(67);
$vars->{'recover.message'} = $_[0] if ($_[0]);
$vars->{'recover.form.email'} = WebGUI::Form::text($self->session,{"name"=>"email"});
- $vars->{'recover.form.email.label'} = WebGUI::International::get(56);
+ $vars->{'recover.form.email.label'} = $i18n->get(56);
return WebGUI::Asset::Template->new($self->session,$self->getPasswordRecoveryTemplateId)->process($vars);
}
#-------------------------------------------------------------------
sub recoverPasswordFinish {
my $self = shift;
- return $self->recoverPassword(''.WebGUI::International::get(743).' ') if ($self->session->form->process("email") eq "");
+ my $i18n = WebGUI::International->new($self->session);
+ return $self->recoverPassword('') if ($self->session->form->process("email") eq "");
return $self->displayLogin unless ($self->session->setting->get("webguiPasswordRecovery"));
my($sth,$username,$userId,$password,$flag,$message,$output,$encryptedPassword,$authMethod);
@@ -544,15 +554,15 @@ sub recoverPasswordFinish {
_logSecurityMessage();
$self->session->errorHandler->security("recover a password. Password emailed to: ".$self->session->form->process("email"));
$message = $self->session->setting->get("webguiRecoverPasswordEmail");
- $message .= "\n".WebGUI::International::get(50).": ".$username."\n";
- $message .= WebGUI::International::get(51).": ".$password."\n";
- WebGUI::Mail::send($self->session->form->process("email"),WebGUI::International::get(74),$message);
+ $message .= "\n".$i18n->get(50).": ".$username."\n";
+ $message .= $i18n->get(51).": ".$password."\n";
+ WebGUI::Mail::send($self->session->form->process("email"),$i18n->get(74),$message);
$flag++;
}
$sth->finish();
- return $self->displayLogin(''.WebGUI::International::get(75).' ') if($flag);
- return $self->recoverPassword(''.WebGUI::International::get(76).' ');
+ return $self->displayLogin('') if($flag);
+ return $self->recoverPassword('');
}
#-------------------------------------------------------------------
@@ -560,7 +570,8 @@ sub resetExpiredPassword {
my $self = shift;
my $vars;
- $vars->{displayTitle} = ''.WebGUI::International::get(8,'AuthWebGUI').' ';
+ my $i18n = WebGUI::International->new($self->session);
+ $vars->{displayTitle} = ''.$i18n->get(8,'AuthWebGUI').' ';
$vars->{'expired.message'} = $_[0] if($_[0]);
$vars->{'expired.form.header'} = "\n\n".WebGUI::Form::formHeader($self->session,{});
$vars->{'expired.form.hidden'} = WebGUI::Form::hidden($self->session,{"name"=>"op","value"=>"auth"});
@@ -568,11 +579,11 @@ sub resetExpiredPassword {
$vars->{'expired.form.hidden'} .= WebGUI::Form::hidden($self->session,{"name"=>"uid","value"=>$self->session->form->process("uid")});
$vars->{'expired.form.oldPassword'} = WebGUI::Form::password($self->session,{"name"=>"oldPassword"});
- $vars->{'expired.form.oldPassword.label'} = WebGUI::International::get(10,'AuthWebGUI');
+ $vars->{'expired.form.oldPassword.label'} = $i18n->get(10,'AuthWebGUI');
$vars->{'expired.form.password'} = WebGUI::Form::password($self->session,{"name"=>"identifier"});
- $vars->{'expired.form.password.label'} = WebGUI::International::get(11,'AuthWebGUI');
+ $vars->{'expired.form.password.label'} = $i18n->get(11,'AuthWebGUI');
$vars->{'expired.form.passwordConfirm'} = WebGUI::Form::password($self->session,{"name"=>"identifierConfirm"});
- $vars->{'expired.form.passwordConfirm.label'} = WebGUI::International::get(2,'AuthWebGUI');
+ $vars->{'expired.form.passwordConfirm.label'} = $i18n->get(2,'AuthWebGUI');
$vars->{'expired.form.submit'} = WebGUI::Form::submit($self->session,{});
$vars->{'expired.form.footer'} = WebGUI::Form::formFooter($self->session,);
@@ -585,14 +596,15 @@ sub resetExpiredPasswordSave {
my ($error,$u,$properties,$msg);
$u = WebGUI::User->new($self->session,$self->session->form->process("uid"));
+ my $i18n = WebGUI::International->new($self->session);
$self->session->form->process("username") = $u->username;
$error .= $self->error if(!$self->authenticate($u->username,$self->session->form->process("oldPassword")));
- $error .= ''.WebGUI::International::get(5,'AuthWebGUI').' ' if($self->session->form->process("identifier") eq "password");
- $error .= ''.WebGUI::International::get(12,'AuthWebGUI').' ' if ($self->session->form->process("oldPassword") eq $self->session->form->process("identifier"));
+ $error .= ''.$i18n->get(5,'AuthWebGUI').' ' if($self->session->form->process("identifier") eq "password");
+ $error .= ''.$i18n->get(12,'AuthWebGUI').' ' if ($self->session->form->process("oldPassword") eq $self->session->form->process("identifier"));
$error .= $self->error if(!$self->_isValidPassword($self->session->form->process("identifier"),$self->session->form->process("identifierConfirm")));
- return $self->resetExpiredPassword("".WebGUI::International::get(70)." ".$error) if($error ne "");
+ return $self->resetExpiredPassword("".$i18n->get(70)." ".$error) if($error ne "");
$properties->{identifier} = Digest::MD5::md5_base64($self->session->form->process("identifier"));
$properties->{passwordLastUpdated} =$self->session->datetime->time();
@@ -602,7 +614,7 @@ sub resetExpiredPasswordSave {
$msg = $self->login;
if($msg eq ""){
- $msg = "".WebGUI::International::get(17,'AuthWebGUI').' ';
+ $msg = "".$i18n->get(17,'AuthWebGUI').' ';
}
return $self->displayLogin($msg);
}
@@ -630,10 +642,11 @@ sub validateEmail {
sub updateAccount {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session);
my $username = $self->session->form->get('authWebGUI.username');
my $password = $self->session->form->get('authWebGUI.identifier');
my $passConfirm = $self->session->form->get('authWebGUI.identifierConfirm');
- my $display = ''.WebGUI::International::get(81).' ';
+ my $display = ''.$i18n->get(81).' ';
my $error = "";
if($self->userId eq '1'){
diff --git a/lib/WebGUI/Commerce/Payment.pm b/lib/WebGUI/Commerce/Payment.pm
index e533f4652..8b012bf05 100644
--- a/lib/WebGUI/Commerce/Payment.pm
+++ b/lib/WebGUI/Commerce/Payment.pm
@@ -82,10 +82,11 @@ sub configurationForm {
$form = shift;
$f = WebGUI::HTMLForm->new($self->session);
+ my $i18n = WebGUI::International->new($self->session, 'Commerce');
$f->yesNo(
-name => $self->prepend('enabled'),
-value => $self->enabled,
- -label => WebGUI::International::get('enable', 'Commerce'),
+ -label => $i18n->get('enable'),
);
$f->raw($form);
@@ -420,7 +421,7 @@ The period you want the name for.
sub recurringPeriodValues {
my ($i18n, %periods);
- $i18n = WebGUI::International->new('Commerce');
+ $i18n = WebGUI::International->new($self->session, 'Commerce');
tie %periods, "Tie::IxHash";
%periods = (
Weekly => $i18n->get('weekly'),
diff --git a/lib/WebGUI/Commerce/Payment/ITransact.pm b/lib/WebGUI/Commerce/Payment/ITransact.pm
index 2f79e9c87..e02dd1265 100644
--- a/lib/WebGUI/Commerce/Payment/ITransact.pm
+++ b/lib/WebGUI/Commerce/Payment/ITransact.pm
@@ -106,7 +106,7 @@ sub checkoutForm {
my ($self, $u, $f, %months, %years, $i18n);
$self = shift;
- $i18n = WebGUI::International->new('CommercePaymentITransact');
+ $i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
$u = WebGUI::User->new($self->session->user->profileField("userId"));
@@ -433,7 +433,7 @@ sub checkoutForm {
sub configurationForm {
my ($self, $f, $i18n);
$self = shift;
- $i18n = WebGUI::International->new('CommercePaymentITransact');
+ $i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
$f = WebGUI::HTMLForm->new($self->session);
$f->text(
@@ -567,7 +567,8 @@ sub errorCode {
#-------------------------------------------------------------------
sub name {
- return WebGUI::International::get('module name', "CommercePaymentITransact");
+ my $i18n = WebGUI::International->new($self->session, "CommercePaymentITransact");
+ return $i18n->get('module name');
}
#-------------------------------------------------------------------
@@ -584,10 +585,11 @@ sub normalTransaction {
$normal = shift;
if ($normal) {
+ $i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
$self->{_recurring} = 0;
$self->{_transactionParams} = {
AMT => sprintf('%.2f', $normal->{amount}),
- DESCRIPTION => $normal->{description} || WebGUI::International::get('no description', "CommercePaymentITransact"),
+ DESCRIPTION => $normal->{description} || $i18n->get('no description'),
INVOICENUMBER => $normal->{invoiceNumber},
ORGID => $normal->{id},
};
@@ -608,13 +610,14 @@ sub recurringTransaction {
$initialAmount = ($self->session->datetime->getDaysInMonth(time) - ($self->session->datetime->localtime)[2])*$recurring->{amount}/$self->session->datetime->getDaysInMonth(time);
$initialAmount = $recurring->{amount} if ($initialAmount < 1);
$self->{_recurring} = 1;
+ $i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
$self->{_transactionParams} = {
START => $recurring->{start} || $self->session->datetime->epochToHuman($self->session->datetime->addToDate(time, 0, 0, 1), '%m%d%y'),
AMT => sprintf('%.2f', $recurring->{amount}),
INITIALAMT => sprintf('%.2f', $initialAmount),
TERM => $recurring->{term} || 9999,
RECIPE => _resolveRecipe($recurring->{payPeriod}),
- DESCRIPTION => $recurring->{description} || WebGUI::International::get('no description', "CommercePaymentITransact"),
+ DESCRIPTION => $recurring->{description} || $i18n->get('no description'),
INVOICENUMBER => $recurring->{invoiceNumber},
ORGID => $recurring->{id},
};
diff --git a/lib/WebGUI/Commerce/Shipping.pm b/lib/WebGUI/Commerce/Shipping.pm
index 4efc8fa8f..1c053ee25 100644
--- a/lib/WebGUI/Commerce/Shipping.pm
+++ b/lib/WebGUI/Commerce/Shipping.pm
@@ -48,10 +48,11 @@ sub configurationForm {
$form = shift;
$f = WebGUI::HTMLForm->new($self->session);
+ my $i18n = WebGUI::International->new($self->session, 'Commerce');
$f->yesNo(
-name => $self->prepend('enabled'),
-value => $self->enabled,
- -label => WebGUI::International::get('enable', 'Commerce'),
+ -label => $i18n->get('enable'),
);
$f->raw($form);
diff --git a/lib/WebGUI/Commerce/Shipping/ByPrice.pm b/lib/WebGUI/Commerce/Shipping/ByPrice.pm
index ee7331600..a9bc15693 100644
--- a/lib/WebGUI/Commerce/Shipping/ByPrice.pm
+++ b/lib/WebGUI/Commerce/Shipping/ByPrice.pm
@@ -24,9 +24,10 @@ sub configurationForm {
$self = shift;
$f = WebGUI::HTMLForm->new($self->session);
+ my $i18n = WebGUI::International->new($self->session, 'CommerceShippingByPrice');
$f->float(
-name => $self->prepend('percentageOfPrice'),
- -label => WebGUI::International::get('percentage of price', 'CommerceShippingByPrice'),
+ -label => $i18n->get('percentage of price'),
-value => $self->get('percentageOfPrice')
);
@@ -45,7 +46,8 @@ sub init {
#-------------------------------------------------------------------
sub name {
- return WebGUI::International::get('title', 'CommerceShippingByPrice');
+ my $i18n = WebGUI::International->new($self->session, 'CommerceShippingByPrice');
+ return $i18n->get('title');
}
1;
diff --git a/lib/WebGUI/Commerce/Shipping/ByWeight.pm b/lib/WebGUI/Commerce/Shipping/ByWeight.pm
index 8b1476e6f..cdd5b2d62 100644
--- a/lib/WebGUI/Commerce/Shipping/ByWeight.pm
+++ b/lib/WebGUI/Commerce/Shipping/ByWeight.pm
@@ -24,9 +24,10 @@ sub configurationForm {
$self = shift;
$f = WebGUI::HTMLForm->new($self->session);
+ my $i18n = WebGUI::International->new($self->session, 'CommerceShippingByWeight');
$f->float(
-name => $self->prepend('pricePerUnitWeight'),
- -label => WebGUI::International::get('price per weight', 'CommerceShippingByWeight'),
+ -label => $i18n->get('price per weight'),
-value => $self->get('pricePerUnitWeight')
);
@@ -45,7 +46,8 @@ sub init {
#-------------------------------------------------------------------
sub name {
- return WebGUI::International::get('title', 'CommerceShippingByWeight');
+ my $i18n = WebGUI::International->new($self->session, 'CommerceShippingByWeight');
+ return $i18n->get('title');
}
1;
diff --git a/lib/WebGUI/Commerce/Shipping/PerTransaction.pm b/lib/WebGUI/Commerce/Shipping/PerTransaction.pm
index 70f89d417..b90bca052 100644
--- a/lib/WebGUI/Commerce/Shipping/PerTransaction.pm
+++ b/lib/WebGUI/Commerce/Shipping/PerTransaction.pm
@@ -20,9 +20,10 @@ sub configurationForm {
$self = shift;
$f = WebGUI::HTMLForm->new($self->session);
+ my $i18n = WebGUI::International->new($self->session, 'CommerceShippingPerTransaction');
$f->float(
-name => $self->prepend('pricePerTransaction'),
- -label => WebGUI::International::get('price', 'CommerceShippingPerTransaction'),
+ -label => $i18n->get('price'),
-value => $self->get('pricePerTransaction')
);
@@ -41,7 +42,8 @@ sub init {
#-------------------------------------------------------------------
sub name {
- return WebGUI::International::get('title', 'CommerceShippingPerTransaction');
+ my $i18n = WebGUI::International->new($self->session, 'CommerceShippingPerTransaction');
+ return $i18n->get('title');
}
1;
diff --git a/lib/WebGUI/DatabaseLink.pm b/lib/WebGUI/DatabaseLink.pm
index 9c6628e03..98eca98ab 100644
--- a/lib/WebGUI/DatabaseLink.pm
+++ b/lib/WebGUI/DatabaseLink.pm
@@ -194,7 +194,8 @@ A reference to the current session.
sub getList {
my $session = shift;
my $list = $session->db->buildHashRef("select databaseLinkId, title from databaseLink order by title");
- $list->{'0'} = WebGUI::International::get(1076);
+ my $i18n = WebGUI::International->new($self->session);
+ $list->{'0'} = $i18n->get(1076);
return $list;
}
diff --git a/lib/WebGUI/Form/Asset.pm b/lib/WebGUI/Form/Asset.pm
index 53e3cb751..8f7a81d83 100644
--- a/lib/WebGUI/Form/Asset.pm
+++ b/lib/WebGUI/Form/Asset.pm
@@ -20,7 +20,6 @@ use WebGUI::Asset;
use WebGUI::Form::Button;
use WebGUI::Form::Hidden;
use WebGUI::Form::Text;
-use WebGUI::International;
use WebGUI::Session;
=head1 NAME
@@ -67,22 +66,24 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("asset","Asset")
+ defaultValue=>$i18n->get("asset");
},
label=>{
- defaultValue=>WebGUI::International::get("asset","Asset")
+ defaultValue=>$i18n->get("asset");
},
name=>{
- defaultValue=> "asset"
+ defaultValue=>"asset";
},
class=>{
defaultValue=> undef
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Button.pm b/lib/WebGUI/Form/Button.pm
index 0762e276e..096f1bce3 100644
--- a/lib/WebGUI/Form/Button.pm
+++ b/lib/WebGUI/Form/Button.pm
@@ -55,16 +55,18 @@ The default text to appear on the button. Defaults to an internationalized versi
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session,"WebGUI");
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("button","WebGUI")
+ defaultValue=>"button"
},
defaultValue=>{
- defaultValue=>WebGUI::International::get(62,"WebGUI")
+ defaultValue=>$i18n->get(62)
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/CheckList.pm b/lib/WebGUI/Form/CheckList.pm
index 2799f731e..98b88dbe4 100644
--- a/lib/WebGUI/Form/CheckList.pm
+++ b/lib/WebGUI/Form/CheckList.pm
@@ -17,7 +17,6 @@ package WebGUI::Form::CheckList;
use strict;
use base 'WebGUI::Form::List';
use WebGUI::Form::Checkbox;
-use WebGUI::International;
use WebGUI::Session;
=head1 NAME
@@ -60,10 +59,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($self->session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("941","WebGUI"),
+ defaultValue=>$i18n->get("941"),
},
vertical=>{
defaultValue=>0
@@ -72,7 +73,7 @@ sub definition {
defaultValue=>1
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Checkbox.pm b/lib/WebGUI/Form/Checkbox.pm
index e2b9a18df..40cacd167 100644
--- a/lib/WebGUI/Form/Checkbox.pm
+++ b/lib/WebGUI/Form/Checkbox.pm
@@ -16,7 +16,6 @@ package WebGUI::Form::Checkbox;
use strict;
use base 'WebGUI::Form::Control';
-use WebGUI::International;
use WebGUI::Session;
=head1 NAME
@@ -63,10 +62,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("943","WebGUI")
+ defaultValue=>$i18n->get("943"),
},
checked=>{
defaultValue=> 0
@@ -78,7 +79,7 @@ sub definition {
defaultValue=>1
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
diff --git a/lib/WebGUI/Form/Codearea.pm b/lib/WebGUI/Form/Codearea.pm
index bbca415bb..bfa73cfcb 100644
--- a/lib/WebGUI/Form/Codearea.pm
+++ b/lib/WebGUI/Form/Codearea.pm
@@ -57,16 +57,18 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("codearea","WebGUI")
+ defaultValue=>$i18n->get("codearea")
},
profileEnabled=>{
defaultValue=>1
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Color.pm b/lib/WebGUI/Form/Color.pm
index 92010e42e..c8e962af9 100644
--- a/lib/WebGUI/Form/Color.pm
+++ b/lib/WebGUI/Form/Color.pm
@@ -48,13 +48,15 @@ See the super class for additional details.
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("color","WebGUI")
+ defaultValue=>$i18n->get("color")
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Combo.pm b/lib/WebGUI/Form/Combo.pm
index a93d09767..2f29da84b 100644
--- a/lib/WebGUI/Form/Combo.pm
+++ b/lib/WebGUI/Form/Combo.pm
@@ -57,16 +57,18 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("combobox","WebGUI")
+ defaultValue=>$i18n->get("combobox")
},
profileEnabled=>{
defaultValue=>1
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/ContentType.pm b/lib/WebGUI/Form/ContentType.pm
index 429abd8eb..4591ffd1c 100644
--- a/lib/WebGUI/Form/ContentType.pm
+++ b/lib/WebGUI/Form/ContentType.pm
@@ -63,13 +63,15 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("1007","WebGUI")
+ defaultValue=>$i18n->get("1007")
},
label=>{
- defaultValue=>WebGUI::International::get("1007","WebGUI")
+ defaultValue=>$i18n->get("1007")
},
types=>{
defaultValue=>[qw(mixed html code text)]
@@ -78,7 +80,7 @@ sub definition {
defaultValue=>"mixed",
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Control.pm b/lib/WebGUI/Form/Control.pm
index c7735b807..afd79ab5a 100644
--- a/lib/WebGUI/Form/Control.pm
+++ b/lib/WebGUI/Form/Control.pm
@@ -18,6 +18,7 @@ use strict;
use WebGUI::Grouping;
use WebGUI::Session;
use WebGUI::Operation::Shared;
+use WebGUI::International;
=head1 NAME
@@ -51,10 +52,14 @@ The following methods are available via this package.
#-------------------------------------------------------------------
-=head2 definition ( [ additionalTerms ] )
+=head2 definition ( $session, [ additionalTerms ] )
Defines the schema or parameters for a form field.
+=head3 session
+
+The session object, usually for internationalization.
+
=head3 additionalTerms
An array reference containing a hash of hashes of parameter names and their definitions.
@@ -94,7 +99,7 @@ Add extra attributes to the form tag like
=head4 formName
-The internationalized form name.
+The key to look up for the form name.
=head4 label
@@ -146,6 +151,7 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
push(@{$definition}, {
formName=>{
@@ -300,7 +306,8 @@ Returns a human readable name for this form control type. You MUST override this
sub getName {
my $self = shift;
- my $definition = $self->definition;
+ my $session = shift;
+ my $definition = $self->definition($session);
return $definition->[0]->{formName}->{defaultValue};
}
diff --git a/lib/WebGUI/Form/DatabaseLink.pm b/lib/WebGUI/Form/DatabaseLink.pm
index 18ea87e95..18d4756c0 100644
--- a/lib/WebGUI/Form/DatabaseLink.pm
+++ b/lib/WebGUI/Form/DatabaseLink.pm
@@ -73,13 +73,15 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("1075","WebGUI")
+ defaultValue=>$i18n->get("1075")
},
label=>{
- defaultValue=>WebGUI::International::get("1075","WebGUI")
+ defaultValue=>$i18n->get("1075")
},
name=>{
defaultValue=>"databaseLinkId"
diff --git a/lib/WebGUI/Form/Date.pm b/lib/WebGUI/Form/Date.pm
index 3c5097d44..2e1dac5f0 100644
--- a/lib/WebGUI/Form/Date.pm
+++ b/lib/WebGUI/Form/Date.pm
@@ -75,13 +75,15 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("479","WebGUI")
+ defaultValue=>$i18n->get("479")
},
defaultValue=>{
- defaultValue=$self->session->datetime->time()
+ defaultValue=$session->datetime->time()
},
maxlength=>{
defaultValue=> 10
@@ -96,7 +98,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/DateTime.pm b/lib/WebGUI/Form/DateTime.pm
index 9f4791462..e578683de 100644
--- a/lib/WebGUI/Form/DateTime.pm
+++ b/lib/WebGUI/Form/DateTime.pm
@@ -70,13 +70,15 @@ If no value is specified, this will be used. Defaults to today and now.
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("972","WebGUI")
+ defaultValue=>$i18n->get("972")
},
defaultValue=>{
- defaultValue=$self->session->datetime->time()
+ defaultValue=$session->datetime->time()
},
maxlength=>{
defaultValue=> 19
@@ -88,7 +90,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/DynamicField.pm b/lib/WebGUI/Form/DynamicField.pm
index be83e5bee..94eebebe1 100644
--- a/lib/WebGUI/Form/DynamicField.pm
+++ b/lib/WebGUI/Form/DynamicField.pm
@@ -56,16 +56,18 @@ Defaults to "Text". Should be any valid field type.
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("475","WebGUI"),
+ defaultValue=>$i18n->get("475"),
},
fieldType=>{
defaultValue=> "Text"
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
@@ -76,7 +78,21 @@ Creates the object for the appropriate field type.
=head3 params
-The normal params you'd pass in to the field. Included in this list must be one element called "fieldType" which specifies what type of field to dynamically render.
+The normal params you'd pass in to the field. Included in this list
+must be one element called "fieldType" which specifies what type of
+field to dynamically render. List-type forms, however, can take
+two additional parameters:
+
+=head4 possibleValues
+
+This is a newline delimited set of values. A hash will be set by splitting the string
+on newlines and making the key and value of each hash entry equal.
+
+=head4 value
+
+For List-type forms which support multiple select, this is normally an arrayref holding all pre-selected
+values. However, if it is a scalar string, the string will be split on newlines and the resulting
+array will be used.
=cut
diff --git a/lib/WebGUI/Form/Email.pm b/lib/WebGUI/Form/Email.pm
index 7b2aa33a4..b25a7bb35 100644
--- a/lib/WebGUI/Form/Email.pm
+++ b/lib/WebGUI/Form/Email.pm
@@ -56,16 +56,18 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("480","WebGUI")
+ defaultValue=>$i18n->get("480")
},
profileEnabled=>{
defaultValue=>1
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/FieldType.pm b/lib/WebGUI/Form/FieldType.pm
index 9e5773070..1e2defccd 100644
--- a/lib/WebGUI/Form/FieldType.pm
+++ b/lib/WebGUI/Form/FieldType.pm
@@ -135,7 +135,7 @@ sub toHtml {
$self->session->errorHandler->error("Couldn't compile form control: ".$type.". Root cause: ".$@);
next;
}
- $options{$type} = $class->getName;
+ $options{$type} = $class->getName($self->session);
}
$self->get("options") = \%options;
diff --git a/lib/WebGUI/Form/File.pm b/lib/WebGUI/Form/File.pm
index 8915ffdfb..f453f9101 100644
--- a/lib/WebGUI/Form/File.pm
+++ b/lib/WebGUI/Form/File.pm
@@ -65,10 +65,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("file","WebGUI")
+ defaultValue=>$i18n->get("file")
},
name=>{
defaultValue=>"file"
@@ -80,7 +82,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/FilterContent.pm b/lib/WebGUI/Form/FilterContent.pm
index b40bf30b2..2f928a8b9 100644
--- a/lib/WebGUI/Form/FilterContent.pm
+++ b/lib/WebGUI/Form/FilterContent.pm
@@ -64,22 +64,24 @@ A tooltip for what to do with this field. Defaults to a general explaination of
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("418","WebGUI")
+ defaultValue=>$i18n->get("418")
},
name=>{
defaultValue=>"filterContent"
},
hoverHelp=>{
- defaultValue=>WebGUI::International::get('418 description', 'WebGUI')
+ defaultValue=>$i18n->get('418 description')
},
defaultValue=>{
defaultValue=>"most",
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Float.pm b/lib/WebGUI/Form/Float.pm
index 0bd3aaa21..12fadc238 100644
--- a/lib/WebGUI/Form/Float.pm
+++ b/lib/WebGUI/Form/Float.pm
@@ -68,10 +68,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("float","WebGUI")
+ defaultValue=>$i18n->get("float")
},
maxlength=>{
defaultValue=> 14
@@ -86,7 +88,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Group.pm b/lib/WebGUI/Form/Group.pm
index 21f49b53c..9a32e6760 100644
--- a/lib/WebGUI/Form/Group.pm
+++ b/lib/WebGUI/Form/Group.pm
@@ -74,10 +74,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("group","WebGUI")
+ defaultValue=>$i18n->get("group")
},
size=>{
defaultValue=>1
@@ -95,7 +97,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/HTMLArea.pm b/lib/WebGUI/Form/HTMLArea.pm
index 99ae25439..6a538a075 100644
--- a/lib/WebGUI/Form/HTMLArea.pm
+++ b/lib/WebGUI/Form/HTMLArea.pm
@@ -71,25 +71,27 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("477","WebGUI")
+ defaultValue=>$i18n->get("477")
},
rows=>{
- defaultValue=> $self->session->setting->get("textAreaRows")+20
+ defaultValue=> $session->setting->get("textAreaRows")+20
},
columns=>{
- defaultValue=> $self->session->setting->get("textAreaCols")+10
+ defaultValue=> $session->setting->get("textAreaCols")+10
},
richEditId=>{
- defaultValue=>$self->session->setting->get("richEditor") || "PBrichedit000000000001"
+ defaultValue=>$session->setting->get("richEditor") || "PBrichedit000000000001"
},
profileEnabled=>{
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Hidden.pm b/lib/WebGUI/Form/Hidden.pm
index b36e940d7..e385860f7 100644
--- a/lib/WebGUI/Form/Hidden.pm
+++ b/lib/WebGUI/Form/Hidden.pm
@@ -55,16 +55,18 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("hidden","WebGUI")
+ defaultValue=>$i18n->get("hidden")
},
profileEnabled=>{
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/HiddenList.pm b/lib/WebGUI/Form/HiddenList.pm
index 7f810ca59..6224ff52c 100644
--- a/lib/WebGUI/Form/HiddenList.pm
+++ b/lib/WebGUI/Form/HiddenList.pm
@@ -63,16 +63,18 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("hidden list","WebGUI"),
+ defaultValue=>$i18n->get("hidden list"),
},
profileEnabled=>{
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Image.pm b/lib/WebGUI/Form/Image.pm
index 193c4189a..ac55a37dd 100644
--- a/lib/WebGUI/Form/Image.pm
+++ b/lib/WebGUI/Form/Image.pm
@@ -67,10 +67,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("image","WebGUI")
+ defaultValue=>$i18n->get("image")
},
name=>{
defaultValue=>"file"
@@ -82,7 +84,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
diff --git a/lib/WebGUI/Form/Integer.pm b/lib/WebGUI/Form/Integer.pm
index 07bce2572..c0b05b96a 100644
--- a/lib/WebGUI/Form/Integer.pm
+++ b/lib/WebGUI/Form/Integer.pm
@@ -68,10 +68,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("482","WebGUI")
+ defaultValue=>$i18n->get("482")
},
maxlength=>{
defaultValue=> 11
@@ -86,7 +88,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Interval.pm b/lib/WebGUI/Form/Interval.pm
index b9a993298..b1e8a1be5 100644
--- a/lib/WebGUI/Form/Interval.pm
+++ b/lib/WebGUI/Form/Interval.pm
@@ -65,10 +65,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("interval","WebGUI"),
+ defaultValue=>$i18n->get("interval"),
},
defaultValue=>{
defaultValue=>1,
@@ -77,7 +79,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/LdapLink.pm b/lib/WebGUI/Form/LdapLink.pm
index f14eea7ec..0183d3299 100644
--- a/lib/WebGUI/Form/LdapLink.pm
+++ b/lib/WebGUI/Form/LdapLink.pm
@@ -79,13 +79,15 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("LDAPLink_1075","AuthLDAP")
+ defaultValue=>$i18n->get("LDAPLink_1075","AuthLDAP")
},
label=>{
- defaultValue=>WebGUI::International::get("LDAPLink_1075","AuthLDAP")
+ defaultValue=>$i18n->get("LDAPLink_1075","AuthLDAP")
},
size=>{
defaultValue=>1
@@ -103,7 +105,7 @@ sub definition {
defaultValue=>undef
}
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/List.pm b/lib/WebGUI/Form/List.pm
index f48b8f3eb..c0c7369a9 100644
--- a/lib/WebGUI/Form/List.pm
+++ b/lib/WebGUI/Form/List.pm
@@ -94,9 +94,14 @@ sub correctValues {
my ($self, $value) = @_;
return unless defined $value;
my @defaultValues;
- foreach (split(/\n/, $value)) {
- s/\s+$//; # remove trailing spaces
- push(@defaultValues, $_);
+ if (ref $value eq "ARRAY") {
+ @defaultValues = @{ $value };
+ }
+ else {
+ foreach (split(/\n/, $value)) {
+ s/\s+$//; # remove trailing spaces
+ push(@defaultValues, $_);
+ }
}
$self->get("value") = \@defaultValues;
}
@@ -140,10 +145,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("486","WebGUI"),
+ defaultValue=>$i18n->get("486"),
},
options=>{
defaultValue=>{}
@@ -164,7 +171,7 @@ sub definition {
defaultValue=>0
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
diff --git a/lib/WebGUI/Form/Password.pm b/lib/WebGUI/Form/Password.pm
index 015ed79ce..4a35cd0f7 100644
--- a/lib/WebGUI/Form/Password.pm
+++ b/lib/WebGUI/Form/Password.pm
@@ -63,10 +63,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("51","WebGUI")
+ defaultValue=>$i18n->get("51")
},
maxlength=>{
defaultValue=>35
@@ -78,7 +80,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Phone.pm b/lib/WebGUI/Form/Phone.pm
index c761e9f9b..ad721cfb1 100644
--- a/lib/WebGUI/Form/Phone.pm
+++ b/lib/WebGUI/Form/Phone.pm
@@ -56,16 +56,18 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("481","WebGUI")
+ defaultValue=>$i18n->get("481")
},
profileEnabled=>{
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Radio.pm b/lib/WebGUI/Form/Radio.pm
index ae4ea7f22..d8f0aa5cd 100644
--- a/lib/WebGUI/Form/Radio.pm
+++ b/lib/WebGUI/Form/Radio.pm
@@ -59,10 +59,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("radio","WebGUI")
+ defaultValue=>$i18n->get("radio")
},
checked=>{
defaultValue=> 0
@@ -71,7 +73,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
diff --git a/lib/WebGUI/Form/RadioList.pm b/lib/WebGUI/Form/RadioList.pm
index 7ef7b9cfa..ae91243bf 100644
--- a/lib/WebGUI/Form/RadioList.pm
+++ b/lib/WebGUI/Form/RadioList.pm
@@ -71,10 +71,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("942","WebGUI")
+ defaultValue=>$i18n->get("942")
},
vertical=>{
defaultValue=>0
@@ -83,7 +85,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
diff --git a/lib/WebGUI/Form/ReadOnly.pm b/lib/WebGUI/Form/ReadOnly.pm
index cb3b6a9ea..ab385827c 100644
--- a/lib/WebGUI/Form/ReadOnly.pm
+++ b/lib/WebGUI/Form/ReadOnly.pm
@@ -56,16 +56,18 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("read only","WebGUI")
+ defaultValue=>$i18n->get("read only")
},
profileEnabled=>{
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/SelectBox.pm b/lib/WebGUI/Form/SelectBox.pm
index 5712c8c69..58ef32682 100644
--- a/lib/WebGUI/Form/SelectBox.pm
+++ b/lib/WebGUI/Form/SelectBox.pm
@@ -69,10 +69,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("487","WebGUI"),
+ defaultValue=>$i18n->get("487"),
},
size=>{
defaultValue=>1,
@@ -81,7 +83,7 @@ sub definition {
defaultValue=>1,
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/SelectList.pm b/lib/WebGUI/Form/SelectList.pm
index 148847c95..0823f3c0a 100644
--- a/lib/WebGUI/Form/SelectList.pm
+++ b/lib/WebGUI/Form/SelectList.pm
@@ -63,10 +63,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("484","WebGUI"),
+ defaultValue=>$i18n->get("484"),
},
multiple=>{
defaultValue=>1
@@ -78,7 +80,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Submit.pm b/lib/WebGUI/Form/Submit.pm
index e9faec396..930c73dc4 100644
--- a/lib/WebGUI/Form/Submit.pm
+++ b/lib/WebGUI/Form/Submit.pm
@@ -47,13 +47,15 @@ See the super class for additional details.
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("submit","WebGUI")
+ defaultValue=>$i18n->get("submit")
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Template.pm b/lib/WebGUI/Form/Template.pm
index 7b54575db..236c85506 100644
--- a/lib/WebGUI/Form/Template.pm
+++ b/lib/WebGUI/Form/Template.pm
@@ -66,13 +66,15 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("assetName","Asset_Template")
+ defaultValue=>$i18n->get("assetName")
},
label=>{
- defaultValue=>WebGUI::International::get("assetName","Asset_Template")
+ defaultValue=>$i18n->get("assetName")
},
name=>{
defaultValue=>"templateId"
@@ -81,7 +83,7 @@ sub definition {
defaultValue=>undef
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Text.pm b/lib/WebGUI/Form/Text.pm
index f4548cc7c..88e944dd6 100644
--- a/lib/WebGUI/Form/Text.pm
+++ b/lib/WebGUI/Form/Text.pm
@@ -63,22 +63,24 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=> WebGUI::International::get("475","WebGUI")
+ defaultValue=> $i18n->get("475")
},
maxlength=>{
defaultValue=> 255
},
size=>{
- defaultValue=>$self->session->setting->get("textBoxSize") || 30
+ defaultValue=>$session->setting->get("textBoxSize") || 30
},
profileEnabled=>{
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Textarea.pm b/lib/WebGUI/Form/Textarea.pm
index 7d41b5dad..471d03524 100644
--- a/lib/WebGUI/Form/Textarea.pm
+++ b/lib/WebGUI/Form/Textarea.pm
@@ -67,16 +67,18 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("476","WebGUI")
+ defaultValue=>$i18n->get("476")
},
rows=>{
- defaultValue=> $self->session->setting->get("textAreaRows") || 5
+ defaultValue=> $session->setting->get("textAreaRows") || 5
},
columns=>{
- defaultValue=> $self->session->setting->get("textAreaCols") || 50
+ defaultValue=> $session->setting->get("textAreaCols") || 50
},
wrap=>{
defaultValue=>"virtual"
@@ -85,7 +87,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/TimeField.pm b/lib/WebGUI/Form/TimeField.pm
index 540621547..58213a1ab 100644
--- a/lib/WebGUI/Form/TimeField.pm
+++ b/lib/WebGUI/Form/TimeField.pm
@@ -67,10 +67,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("971","WebGUI")
+ defaultValue=>$i18n->get("971")
},
maxlength=>{
defaultValue=>8
@@ -82,7 +84,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/TimeZone.pm b/lib/WebGUI/Form/TimeZone.pm
index f024cf0c0..9b000f91d 100644
--- a/lib/WebGUI/Form/TimeZone.pm
+++ b/lib/WebGUI/Form/TimeZone.pm
@@ -48,16 +48,18 @@ See the super class for additional details.
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("timezone","DateTime")
+ defaultValue=>$i18n->get("timezone")
},
value=>{
defaultValue=>undef
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Url.pm b/lib/WebGUI/Form/Url.pm
index 7388e85b5..2c4083280 100644
--- a/lib/WebGUI/Form/Url.pm
+++ b/lib/WebGUI/Form/Url.pm
@@ -60,10 +60,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("478","WebGUI")
+ defaultValue=>$i18n->get("478")
},
maxlength=>{
defaultValue=> 2048
@@ -72,7 +74,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/WhatNext.pm b/lib/WebGUI/Form/WhatNext.pm
index 815af44e0..a8de02bc2 100644
--- a/lib/WebGUI/Form/WhatNext.pm
+++ b/lib/WebGUI/Form/WhatNext.pm
@@ -59,19 +59,21 @@ A text label that will be displayed if toHtmlWithWrapper() is called. Defaults t
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("744","WebGUI")
+ defaultValue=>$i18n->get("744")
},
label=>{
- defaultValue=>WebGUI::International::get("744","WebGUI")
+ defaultValue=>$i18n->get("744")
},
name=>{
defaultValue=>"proceed"
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/YesNo.pm b/lib/WebGUI/Form/YesNo.pm
index 8a1caf3b4..8ec49e2ed 100644
--- a/lib/WebGUI/Form/YesNo.pm
+++ b/lib/WebGUI/Form/YesNo.pm
@@ -60,10 +60,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=>WebGUI::International::get("483","WebGUI")
+ defaultValue=>$i18n->get("483")
},
defaultValue=>{
defaultValue=>0
@@ -72,7 +74,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Form/Zipcode.pm b/lib/WebGUI/Form/Zipcode.pm
index 517d40692..3b6ed0e92 100644
--- a/lib/WebGUI/Form/Zipcode.pm
+++ b/lib/WebGUI/Form/Zipcode.pm
@@ -60,10 +60,12 @@ Flag that tells the User Profile system that this is a valid form element in a U
sub definition {
my $class = shift;
+ my $session = shift;
my $definition = shift || [];
+ my $i18n = WebGUI::International->new($session);
push(@{$definition}, {
formName=>{
- defaultValue=> WebGUI::International::get("944","WebGUI")
+ defaultValue=> $i18n->get("944")
},
maxlength=>{
defaultValue=> 10
@@ -72,7 +74,7 @@ sub definition {
defaultValue=>1
},
});
- return $class->SUPER::definition($definition);
+ return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Help/Asset_Matrix.pm b/lib/WebGUI/Help/Asset_Matrix.pm
index 16c5d4511..75ec16df4 100644
--- a/lib/WebGUI/Help/Asset_Matrix.pm
+++ b/lib/WebGUI/Help/Asset_Matrix.pm
@@ -144,8 +144,46 @@ our $HELP = {
tag => 'matrix add/edit',
namespace => 'Asset_Matrix'
},
+ ],
+ },
+ 'field add/edit' => {
+ title => 'field add/edit help title',
+ body => 'field add/edit help body',
+ fields => [
+ {
+ title => 'field name',
+ description => 'field name description',
+ namespace => 'Asset_Matrix',
+ },
+ {
+ title => 'field label',
+ description => 'field label description',
+ namespace => 'Asset_Matrix',
+ },
+ {
+ title => 'field type',
+ description => 'field type description',
+ namespace => 'Asset_Matrix',
+ },
+ {
+ title => 'field description',
+ description => 'field description description',
+ namespace => 'Asset_Matrix',
+ },
+ {
+ title => 'default value',
+ description => 'default value description',
+ namespace => 'Asset_Matrix',
+ },
+ {
+ title => 'category',
+ description => 'category description',
+ namespace => 'Asset_Matrix',
+ },
+ ],
+ related => [
{
- tag => 'listing detail template',
+ tag => 'matrix add/edit',
namespace => 'Asset_Matrix'
},
],
diff --git a/lib/WebGUI/International.pm b/lib/WebGUI/International.pm
index 63f1a2ac1..43e37dc2d 100644
--- a/lib/WebGUI/International.pm
+++ b/lib/WebGUI/International.pm
@@ -51,7 +51,7 @@ These functions/methods are available from this package:
#-------------------------------------------------------------------
-=head2 get ( internationalId [ , namespace, languageId ] )
+=head2 get ( internationalId [ , namespace, language ] )
Returns the internationalized message string for the user's language. If there is no internationalized message, this method will return the English string.
@@ -63,26 +63,21 @@ An integer that relates to a message in the international table in the WebGUI da
A string that relates to the namespace field in the international table in the WebGUI database. Defaults to 'WebGUI'.
-=head3 languageId
+=head3 language
-An integer that specifies the language that the user should see. Defaults to the user's defined language. If the user hasn't specified a default language it defaults to '1' (English).
+A string that specifies the language that the user should see. Defaults to the user's defined language. If the user hasn't specified a default language it defaults to 'English'.
=cut
+my $safeRe = qr/[^\w\d\s\/]/;
+
sub get {
- my ($id, $language, $namespace);
- if (ref($_[0]) eq "WebGUI::International") {
- $id = $_[1];
- $namespace = $_[2] || $_[0]->{_namespace} || "WebGUI";
- $language = $_[3] || $_[0]->{_language} || $self->session->user->profileField("language") || "English";
- } else {
- $id = $_[0];
- $namespace = $_[1] || "WebGUI";
- $language = $_[2] || $self->session->user->profileField("language") || "English";
- }
- $id =~ s/[^\w\d\s\/]//g;
- $language =~ s/[^\w\d\s\/]//g;
- $namespace =~ s/[^\w\d\s\/]//g;
+ my ($self, $id, $namespace, $language) = @_;
+ $namespace = $namespace || $_[0]->{_namespace} || "WebGUI";
+ $language = $language || $_[0]->{_language} || $self->session->user->profileField("language") || "English";
+ $id =~ s/$safeRe//g;
+ $language =~ s/$safeRe//g;
+ $namespace =~ s/$safeRe//g;
my $cmd = "WebGUI::i18n::".$language."::".$namespace;
my $load = "use ".$cmd;
eval($load);
@@ -90,18 +85,18 @@ sub get {
$cmd = "\$".$cmd."::I18N->{'".$id."'}{message}";
my $output = eval($cmd);
$self->session->errorHandler->warn("Couldn't get value from ".$cmd." because ".$@) if ($@);
- $output = get($id,$namespace,"English") if ($output eq "" && $language ne "English");
+ $output = $self->get($id,$namespace,"English") if ($output eq "" && $language ne "English");
return $output;
}
#-------------------------------------------------------------------
-=head2 getLanguage ( [ languageId , propertyName] )
+=head2 getLanguage ( [ language , propertyName] )
Returns a hash reference to a particular language's properties.
-=head3 languageId
+=head3 language
Defaults to "English". The language to retrieve the properties for.
@@ -112,8 +107,8 @@ If this is specified, only the value of the property will be returned, instead o
=cut
sub getLanguage {
- my $language = shift || "English";
- my $property = shift;
+ my ($self, $language, $property) = @_;
+ $language = $language || $self->{_language} || "English";
my $cmd = "WebGUI::i18n::".$language;
my $load = "use ".$cmd;
eval($load);
@@ -136,11 +131,12 @@ sub getLanguage {
=head2 getLanguages ( )
-Returns a hash reference to the languages (languageId/lanugage) installed on this WebGUI system.
+Returns a hash reference to the languages installed on this WebGUI system.
=cut
sub getLanguages {
+ my ($self) = @_;
my ($hashRef);
my $dir = $self->session->config->getWebguiRoot."/lib/WebGUI/i18n";
opendir (DIR,$dir) or $self->session->errorHandler->fatal("Can't open I18N directory! ".$dir);
@@ -166,21 +162,15 @@ Manipulates a URL to make sure it will work on the internet. It removes things l
The URL to manipulate.
-=head3 languageId
+=head3 language
-Specify a default language. Defaults to user preference.
+Specify a default language. Defaults to user preference or "English".
=cut
sub makeUrlCompliant {
- my ($language, $url);
- if (ref($_[0]) eq "WebGUI::International") {
- $url = $_[1];
- $language = $_[2] || $_[0]->{_language} || $self->session->user->profileField("language") || "English";
- } else {
- $url = $_[0];
- $language = $_[1] || $self->session->user->profileField("language") || "English";
- }
+ my ($self, $url, $language) = @_;
+ $language = $language || $_[0]->{_language} || $self->session->user->profileField("language") || "English";
my $cmd = "WebGUI::i18n::".$language;
my $load = "use ".$cmd;
eval($load);
@@ -194,27 +184,44 @@ sub makeUrlCompliant {
#-------------------------------------------------------------------
-=head2 new ( [ namespace, languageId ] )
+=head2 new ( [ namespace, language ] )
The constructor for the International function if using it in OO mode.
+=head3 session
+
+The current user's session variable
+
=head3 namespace
Specify a default namespace. Defaults to "WebGUI".
-=head3 languageId
+=head3 language
-Specify a default language. Defaults to user preference.
+Specify a default language. Defaults to user preference or "English".
=cut
sub new {
- my $class = shift;
- my $namespace = shift;
- my $language = shift;
- bless({_namespace=>$namespace,_language=>$language},$class);
+ my ($class, $session, $namespace, $language) = @_;
+ bless( {
+ _session => $session,
+ _namespace => $namespace,
+ _language => $language,
+ },$class);
}
+#-------------------------------------------------------------------
+
+=head2 session ( )
+
+Returns the internally stored session variable
+
+=cut
+
+sub session {
+ return $_[0]->{_session};
+}
1;
diff --git a/lib/WebGUI/LDAPLink.pm b/lib/WebGUI/LDAPLink.pm
index 950502993..5339add6e 100644
--- a/lib/WebGUI/LDAPLink.pm
+++ b/lib/WebGUI/LDAPLink.pm
@@ -134,7 +134,8 @@ sub getErrorMessage {
my $errorCode = $_[0] || $self->{_error};
return "" unless $errorCode;
my $i18nCode = "LDAPLink_".$errorCode;
- return WebGUI::International::get($i18nCode,"AuthLDAP");
+ my $i18n = WebGUI::International->new($self->session,"AuthLDAP");
+ return $i18n->get($i18nCode);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Macro/AdminBar.pm b/lib/WebGUI/Macro/AdminBar.pm
index 2651501d6..9960a3760 100644
--- a/lib/WebGUI/Macro/AdminBar.pm
+++ b/lib/WebGUI/Macro/AdminBar.pm
@@ -51,10 +51,11 @@ sub process {
tie %hash, "Tie::IxHash";
tie %hash2, "Tie::IxHash";
tie %cphash, "Tie::CPHash";
+ my $i18n = WebGUI::International->new($session,'Macro_AdminBar');
$var{'packages.canAdd'} = ($session->user->profileField("uiLevel") >= 7);
- $var{'packages.label'} = WebGUI::International::get(376,'Macro_AdminBar');
- $var{'contentTypes.label'} = WebGUI::International::get(1083,'Macro_AdminBar');
- $var{'clipboard.label'} = WebGUI::International::get(1082,'Macro_AdminBar');
+ $var{'packages.label'} = $i18n->get(376);
+ $var{'contentTypes.label'} = $i18n->get(1083);
+ $var{'clipboard.label'} = $i18n->get(1082);
if ($session->asset) {
foreach my $package (@{$session->asset->getPackageList}) {
my $title = $package->getTitle;
@@ -82,7 +83,7 @@ sub process {
#--admin functions
$var{adminConsole_loop} = WebGUI::AdminConsole->getAdminFunction;
return WebGUI::Asset::Template->new($session,$templateId)->process(\%var);
-# 'http://validator.w3.org/check?uri=referer'=>WebGUI::International::get(399,'Macro_AdminBar'),
+# 'http://validator.w3.org/check?uri=referer'=>$i18n->get(399),
}
diff --git a/lib/WebGUI/Macro/AdminToggle.pm b/lib/WebGUI/Macro/AdminToggle.pm
index b08736aad..9d8ea0354 100644
--- a/lib/WebGUI/Macro/AdminToggle.pm
+++ b/lib/WebGUI/Macro/AdminToggle.pm
@@ -50,8 +50,9 @@ sub process {
if ($session->user->isInGroup(12)) {
my %var;
my ($turnOn,$turnOff,$templateName) = @_;
- $turnOn ||= WebGUI::International::get(516,'Macro_AdminToggle');
- $turnOff ||= WebGUI::International::get(517,'Macro_AdminToggle');
+ my $i18n = WebGUI::International->new($session,'Macro_AdminToggle');
+ $turnOn ||= $i18n->get(516);
+ $turnOff ||= $i18n->get(517);
if ($session->var->isAdminOn) {
$var{'toggle.url'} = $session->url->page('op=switchOffAdmin');
$var{'toggle.text'} = $turnOff;
diff --git a/lib/WebGUI/Macro/AssetProxy.pm b/lib/WebGUI/Macro/AssetProxy.pm
index 9000e394d..62db526d6 100644
--- a/lib/WebGUI/Macro/AssetProxy.pm
+++ b/lib/WebGUI/Macro/AssetProxy.pm
@@ -48,7 +48,8 @@ sub process {
$output .= "AssetProxy:".Time::HiRes::tv_interval($t) if ($session->errorHandler->canShowPerformanceIndicators());
return $output;
} else {
- return WebGUI::International::get('invalid url', 'Macro_AssetProxy');
+ my $i18n = WebGUI::International->new($session, 'Macro_AssetProxy');
+ return $i18n->get('invalid url');
}
}
diff --git a/lib/WebGUI/Macro/EditableToggle.pm b/lib/WebGUI/Macro/EditableToggle.pm
index 53e2cff1d..fdc464ba6 100644
--- a/lib/WebGUI/Macro/EditableToggle.pm
+++ b/lib/WebGUI/Macro/EditableToggle.pm
@@ -53,8 +53,9 @@ sub process {
if (exists $session->asset && $session->asset->canEdit && $session->user->isInGroup(12)) {
my %var;
my @param = @_;
- my $turnOn = $param[0] || WebGUI::International::get(516,'Macro_EditableToggle');
- my $turnOff = $param[1] || WebGUI::International::get(517,'Macro_EditableToggle');
+ my $i18n = WebGUI::International->new($session,'Macro_EditableToggle');
+ my $turnOn = $param[0] || $i18n->get(516);
+ my $turnOff = $param[1] || $i18n->get(517);
if ($session->var->get("adminOn")) {
$var{'toggle.url'} = $session->url->page('op=switchOffAdmin');
$var{'toggle.text'} = $turnOff;
diff --git a/lib/WebGUI/Macro/Execute.pm b/lib/WebGUI/Macro/Execute.pm
index cbf14b8f0..de2d94b6a 100644
--- a/lib/WebGUI/Macro/Execute.pm
+++ b/lib/WebGUI/Macro/Execute.pm
@@ -36,7 +36,8 @@ sub process {
my $session = shift;
my @param = @_;
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /\.conf/) {
- return WebGUI::International::get('execute error', 'Macro_Execute');
+ my $i18n = WebGUI::International->new($session, 'Macro_Execute');
+ return $i18n->get('execute error');
} else {
return `$param[0]`;
}
diff --git a/lib/WebGUI/Macro/FileUrl.pm b/lib/WebGUI/Macro/FileUrl.pm
index c67f7cae5..f39afca66 100644
--- a/lib/WebGUI/Macro/FileUrl.pm
+++ b/lib/WebGUI/Macro/FileUrl.pm
@@ -47,7 +47,8 @@ sub process {
my $storage = WebGUI::Storage->get($asset->get("storageId"));
return $storage->getUrl($asset->get("filename"));
} else {
- return WebGUI::International::get('invalid url', 'Macro_FileUrl');
+ my $i18n = WebGUI::International->new($session, 'Macro_FileUrl');
+ return $i18n->get('invalid url');
}
}
diff --git a/lib/WebGUI/Macro/H_homeLink.pm b/lib/WebGUI/Macro/H_homeLink.pm
index 82ac92370..a817333db 100644
--- a/lib/WebGUI/Macro/H_homeLink.pm
+++ b/lib/WebGUI/Macro/H_homeLink.pm
@@ -51,7 +51,8 @@ sub process {
if ($label ne "") {
$var{'homeLink.text'} = $label;
} else {
- $var{'homeLink.text'} = WebGUI::International::get(47,'Macro_H_homeLink');
+ my $i18n = WebGUI::International->new($session,'Macro_H_homeLink');
+ $var{'homeLink.text'} = $i18n->get(47);
}
if ($templateUrl) {
return WebGUI::Asset::Template->newByUrl($session,$templateUrl)->process(\%var);
diff --git a/lib/WebGUI/Macro/Include.pm b/lib/WebGUI/Macro/Include.pm
index 6fe818cf1..12a8b20aa 100644
--- a/lib/WebGUI/Macro/Include.pm
+++ b/lib/WebGUI/Macro/Include.pm
@@ -39,8 +39,9 @@ sub process {
my $self = shift;
my (@param, $temp, $file);
@param = @_;
+ my $i18n = WebGUI::International->new($session,'Macro_Include');
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /WebGUI.conf/) {
- $temp = WebGUI::International::get('security','Macro_Include');
+ $temp = $i18n->get('security');
} else {
$file = FileHandle->new($param[0],"r");
if ($file) {
@@ -49,7 +50,7 @@ sub process {
}
$file->close;
} else {
- $temp = WebGUI::International::get('not found','Macro_Include');
+ $temp = $i18n->get('not found');
}
}
return $temp;
diff --git a/lib/WebGUI/Macro/International.pm b/lib/WebGUI/Macro/International.pm
index 99a04d8b9..411cf07df 100644
--- a/lib/WebGUI/Macro/International.pm
+++ b/lib/WebGUI/Macro/International.pm
@@ -40,8 +40,9 @@ The namespace to pull the label from.
#-------------------------------------------------------------------
sub process {
- my $self = shift;
- return WebGUI::International::get(shift,shift);
+ my ($self, $session, $key, $namespace) = @_;
+ my $i18n = WebGUI::International->new($session);
+ return $i18n->get($key, $namespace);
}
diff --git a/lib/WebGUI/Macro/L_loginBox.pm b/lib/WebGUI/Macro/L_loginBox.pm
index db0b23e30..f7c8b938f 100644
--- a/lib/WebGUI/Macro/L_loginBox.pm
+++ b/lib/WebGUI/Macro/L_loginBox.pm
@@ -65,13 +65,14 @@ sub process {
my @param = @_;
my $templateId = $param[2] || "PBtmpl0000000000000044";
my %var;
+ my $i18n = WebGUI::International->new($session,'Macro_L_loginBox');
$var{'user.isVisitor'} = ($session->user->profileField("userId") eq "1");
$var{'customText'} = $param[1];
$var{'customText'} =~ s/%(.*?)%/_createURL($session,$1)/ge;
- $var{'hello.label'} = WebGUI::International::get(48,'Macro_L_loginBox');
+ $var{'hello.label'} = $i18n->get(48);
$var{'logout.url'} = $session->url->page("op=auth;method=logout");
$var{'account.display.url'} = $session->url->page('op=auth;method=displayAccount');
- $var{'logout.label'} = WebGUI::International::get(49,'Macro_L_loginBox');
+ $var{'logout.label'} = $i18n->get(49);
my $boxSize = $param[0];
$boxSize = 12 unless ($boxSize);
if (index(lc($session->env->get("HTTP_USER_AGENT")),"msie") < 0) {
@@ -91,24 +92,24 @@ sub process {
name=>"method",
value=>"login"
});
- $var{'username.label'} = WebGUI::International::get(50);
+ $var{'username.label'} = $i18n->get(50, 'WebGUI');
$var{'username.form'} = WebGUI::Form::text({
name=>"username",
size=>$boxSize,
extras=>'class="loginBoxField"'
});
- $var{'password.label'} = WebGUI::International::get(51);
+ $var{'password.label'} = $i18n->get(51, 'WebGUI');
$var{'password.form'} = WebGUI::Form::password({
name=>"identifier",
size=>$boxSize,
extras=>'class="loginBoxField"'
});
$var{'form.login'} = WebGUI::Form::submit({
- value=>WebGUI::International::get(52),
+ value=>$i18n->get(52, 'WebGUI'),
extras=>'class="loginBoxButton"'
});
$var{'account.create.url'} = $session->url->page('op=auth;method=createAccount');
- $var{'account.create.label'} = WebGUI::International::get(407);
+ $var{'account.create.label'} = $i18n->get(407, 'WebGUI');
$var{'form.footer'} = WebGUI::Form::formFooter($session,);
return WebGUI::Asset::Template->new($session,$templateId)->process(\%var);
}
diff --git a/lib/WebGUI/Macro/LastModified.pm b/lib/WebGUI/Macro/LastModified.pm
index e692368af..8be2f73e5 100644
--- a/lib/WebGUI/Macro/LastModified.pm
+++ b/lib/WebGUI/Macro/LastModified.pm
@@ -46,7 +46,8 @@ sub process {
($label, $format) = @_;
$format = '%z' if ($format eq "");
($time) = $session->dbSlave->quickArray("SELECT max(revisionDate) FROM assetData where assetId=".$session->db->quote($session->asset->getId));
- return WebGUI::International::get('never','Macro_LastModified') if $time eq 0;
+ my $i18n = WebGUI::International->new($session,'Macro_LastModified');
+ return $i18n->get('never') if $time eq 0;
return $label$session->datetime->epochToHuman($time,$format) if ($time);
}
diff --git a/lib/WebGUI/Macro/LoginToggle.pm b/lib/WebGUI/Macro/LoginToggle.pm
index 698238ae3..835ad5ce6 100644
--- a/lib/WebGUI/Macro/LoginToggle.pm
+++ b/lib/WebGUI/Macro/LoginToggle.pm
@@ -46,8 +46,9 @@ The ID of a template for custom layout of the link and text.
#-------------------------------------------------------------------
sub process {
my @param = @_;
- my $login = $param[0] || WebGUI::International::get(716,'Macro_LoginToggle');
- my $logout = $param[1] || WebGUI::International::get(717,'Macro_LoginToggle');
+ my $i18n = WebGUI::International->new($session,'Macro_LoginToggle');
+ my $login = $param[0] || $i18n->get(716);
+ my $logout = $param[1] || $i18n->get(717);
my %var;
if ($session->user->profileField("userId") eq '1') {
return $session->url->page("op=auth;method=init") if ($param[0] eq "linkonly");
diff --git a/lib/WebGUI/Macro/RandomAssetProxy.pm b/lib/WebGUI/Macro/RandomAssetProxy.pm
index 42806b2dd..bb794fb47 100644
--- a/lib/WebGUI/Macro/RandomAssetProxy.pm
+++ b/lib/WebGUI/Macro/RandomAssetProxy.pm
@@ -36,6 +36,7 @@ if no asset exists at that url, or if the asset has no children.
sub process {
my $session = shift;
my $url = shift;
+ my $i18n = WebGUI::International->new($session,'Macro_RandomAssetProxy');
my $asset = WebGUI::Asset->newByUrl($session, $url);
if (defined $asset) {
my $children = $asset->getLineage(["children"]);
@@ -47,10 +48,10 @@ sub process {
$randomAsset->toggleToolbar;
return $randomAsset->canView ? $randomAsset->view() : undef;
} else {
- return WebGUI::International::get('childless','Macro_RandomAssetProxy');
+ return $i18n->get('childless');
}
} else {
- return WebGUI::International::get('invalid url','Macro_RandomAssetProxy');
+ return $i18n->get('invalid url');
}
}
diff --git a/lib/WebGUI/Macro/SQL.pm b/lib/WebGUI/Macro/SQL.pm
index ba765cc28..1ef57bb37 100644
--- a/lib/WebGUI/Macro/SQL.pm
+++ b/lib/WebGUI/Macro/SQL.pm
@@ -41,11 +41,12 @@ sub process {
my $session = shift;
my ($output, @data, $rownum, $temp);
my ($statement, $format) = @_;
+ my $i18n = WebGUI::International->new($session,'Macro_SQL');
$format = '^0;' if ($format eq "");
if ($statement =~ /^\s*select/i || $statement =~ /^\s*show/i || $statement =~ /^\s*describe/i) {
my $sth = $session->dbSlave->unconditionalRead($statement);
unless ($sth->errorCode < 1) {
- return sprintf WebGUI::International::get('sql error','Macro_SQL'), $sth->errorMessage;
+ return sprintf $i18n->get('sql error'), $sth->errorMessage;
} else {
while (@data = $sth->array) {
$temp = $format;
@@ -58,7 +59,7 @@ sub process {
return $output;
}
} else {
- return WebGUI::International::get('illegal query','Macro_SQL');
+ return $i18n->get('illegal query');
}
}
diff --git a/lib/WebGUI/Macro/a_account.pm b/lib/WebGUI/Macro/a_account.pm
index 1238aa9a7..453f36815 100644
--- a/lib/WebGUI/Macro/a_account.pm
+++ b/lib/WebGUI/Macro/a_account.pm
@@ -40,11 +40,12 @@ A template to use for formatting the link.
#-------------------------------------------------------------------
sub process {
my $session = shift;
- my %var;
- my @param = @_;
+ my %var;
+ my @param = @_;
return $session->url->page("op=auth;method=init") if ($param[0] eq "linkonly");
- $var{'account.url'} = $session->url->page('op=auth;method=init');
- $var{'account.text'} = $param[0] || WebGUI::International::get(46,'Macro_a_account');
+ my $i18n = WebGUI::International->new($session,'Macro_a_account');
+ $var{'account.url'} = $session->url->page('op=auth;method=init');
+ $var{'account.text'} = $param[0] || $i18n->get(46);
if ($param[1]) {
return WebGUI::Asset::Template->newByUrl($session,$param[1])->process(\%var);
} else {
diff --git a/lib/WebGUI/Macro/r_printable.pm b/lib/WebGUI/Macro/r_printable.pm
index 990b396e3..4049f641d 100644
--- a/lib/WebGUI/Macro/r_printable.pm
+++ b/lib/WebGUI/Macro/r_printable.pm
@@ -68,7 +68,8 @@ sub process {
if ($param[0] ne "") {
$var{'printable.text'} = $param[0];
} else {
- $var{'printable.text'} = WebGUI::International::get(53,'Macro_r_printable');
+ my $i18n = WebGUI::International->new($session,'Macro_r_printable');
+ $var{'printable.text'} = $i18n->get(53);
}
if ($param[2]) {
$temp = WebGUI::Asset::Template->newByUrl($session,$param[2])->process(\%var);
diff --git a/lib/WebGUI/MessageLog.pm b/lib/WebGUI/MessageLog.pm
index 80026ca23..e09863543 100644
--- a/lib/WebGUI/MessageLog.pm
+++ b/lib/WebGUI/MessageLog.pm
@@ -178,8 +178,8 @@ Defaults to 'notice'. Can be 'pending', 'notice', or 'completed'.
=cut
sub addInternationalizedEntry {
- # my ($u, $userId, $url, $groupId, $internationalId, @users, $messageLogId,$sth, $user, %message, %subject, $message, $subject, $namespace, $status);
- # $messageLogId = $self->session->id->generate();
+# my ($u, $userId, $url, $groupId, $internationalId, @users, $messageLogId,$sth, $user, %message, %subject, $message, $subject, $namespace, $status);
+# $messageLogId = $self->session->id->generate();
# $userId = $_[0];
# $groupId = $_[1];
# $url = $_[2];
diff --git a/lib/WebGUI/Operation/ActiveSessions.pm b/lib/WebGUI/Operation/ActiveSessions.pm
index 63089b26b..79b8f876a 100644
--- a/lib/WebGUI/Operation/ActiveSessions.pm
+++ b/lib/WebGUI/Operation/ActiveSessions.pm
@@ -78,13 +78,14 @@ sub www_viewActiveSessions {
$sth->finish;
$p = WebGUI::Paginator->new($session,$session->url->page('op=viewActiveSessions'));
$p->setDataByArrayRef(\@row);
+ my $i18n = WebGUI::International->new($self->session);
$output .= '';
- $output .= '';
+ $output .= '';
$output .= $p->getPage($session->form->process("pn"));
$output .= '
';
$output .= $p->getBarTraditional($session->form->process("pn"));
diff --git a/lib/WebGUI/Operation/Cache.pm b/lib/WebGUI/Operation/Cache.pm
index 37015fb4d..39c9bb2bb 100644
--- a/lib/WebGUI/Operation/Cache.pm
+++ b/lib/WebGUI/Operation/Cache.pm
@@ -50,10 +50,11 @@ sub _submenu {
my $session = shift;
my $workarea = shift;
my $title = shift;
- $title = WebGUI::International::get($title) if ($title);
+ my $i18n = WebGUI::International->new($self->session);
+ $title = $i18n->get($title) if ($title);
my $ac = WebGUI::AdminConsole->new($session,"cache");
if ($session->setting->get("trackPageStatistics")) {
- $ac->addSubmenuItem( $session->url->page('op=manageCache'), WebGUI::International::get('manage cache'));
+ $ac->addSubmenuItem( $session->url->page('op=manageCache'), $i18n->get('manage cache'));
}
return $ac->render($workarea, $title);
}
@@ -97,12 +98,13 @@ sub www_manageCache {
my ($output, $data);
my $cache = WebGUI::Cache->new($session,);
my $flushURL = $session->url->page('op=flushCache');
+ my $i18n = WebGUI::International->new($self->session);
$output .= '';
- $output .= ''.ref($cache).' ';
- $output .= ''.$cache->stats.' ';
+ $output .= ''.ref($cache).' ';
+ $output .= ''.$cache->stats.' ';
$output .= ''.
WebGUI::Form::button({
- value=>WebGUI::International::get("clear cache"),
+ value=>$i18n->get("clear cache"),
extras=>qq{onclick="document.location.href='$flushURL';"},
}).
' ';
diff --git a/lib/WebGUI/Operation/Commerce.pm b/lib/WebGUI/Operation/Commerce.pm
index 707c1fc1e..5bfd66c8e 100644
--- a/lib/WebGUI/Operation/Commerce.pm
+++ b/lib/WebGUI/Operation/Commerce.pm
@@ -28,7 +28,7 @@ use WebGUI::Icon;
#-------------------------------------------------------------------
sub _submenu {
my $session = shift;
- my $i18n = WebGUI::International->new("Commerce");
+ my $i18n = WebGUI::International->new($session, "Commerce");
my $workarea = shift;
my $title = shift;
@@ -104,7 +104,8 @@ sub www_cancelTransaction {
$transaction->cancelTransaction;
}
- $var{message} = WebGUI::International::get('checkout canceled message', 'Commerce');
+ my $i18n = WebGUI::International->new($session, 'Commerce');
+ $var{message} = $i18n->get('checkout canceled message');
return $session->style->userStyle(WebGUI::Asset::Template->new($session->setting->get("commerceCheckoutCanceledTemplateId"))->process(\%var));
}
@@ -126,7 +127,7 @@ sub www_checkoutConfirm {
my ($plugin, $f, %var, $errors, $i18n, $shoppingCart, $normal, $recurring, $shipping, $total);
$errors = shift;
- $i18n = WebGUI::International->new('Commerce');
+ $i18n = WebGUI::International->new($session, 'Commerce');
# If the user isn't logged in yet, let him do so or have him create an account
if ($session->user->profileField("userId") == 1) {
@@ -207,7 +208,7 @@ sub www_checkoutSubmit {
@normal, $currentPurchase, $checkoutError, @resultLoop, %param, $normal, $recurring,
$formError, $shipping, $shippingCost, $shippingDescription);
- $i18n = WebGUI::International->new('Commerce');
+ $i18n = WebGUI::International->new($session, 'Commerce');
# check if user has already logged in
if ($session->user->profileField("userId") == 1) {
@@ -378,7 +379,7 @@ sub www_editCommerceSettings {
$shippingPlugin, @shippingPlugins, %shippingPlugins, @failedShippingPlugins);
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
- $i18n = WebGUI::International->new('Commerce');
+ $i18n = WebGUI::International->new($session, 'Commerce');
tie %tabs, 'Tie::IxHash';
%tabs = (
@@ -543,7 +544,7 @@ sub www_listPendingTransactions {
my ($p, $transactions, $output, $properties, $i18n);
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
- $i18n = WebGUI::International->new("Commerce");
+ $i18n = WebGUI::International->new($session, "Commerce");
$p = WebGUI::Paginator->new($session,$session->url->page('op=listPendingTransactions'));
$p->setDataByArrayRef(WebGUI::Commerce::Transaction->pendingTransactions);
@@ -577,7 +578,7 @@ sub www_listTransactions {
return $session->privilege->insufficient unless ($session->user->isInGroup(3));
- my $i18n = WebGUI::International->new('TransactionLog');
+ my $i18n = WebGUI::International->new($session, 'TransactionLog');
my $transactionOptions = {
'' => $i18n->get('any'),
@@ -673,7 +674,7 @@ sub www_selectPaymentGateway {
_clearPaymentScratch;
- $i18n = WebGUI::International->new('Commerce');
+ $i18n = WebGUI::International->new($session, 'Commerce');
$plugins = WebGUI::Commerce::Payment->getEnabledPlugins;
if (scalar(@$plugins) > 1) {
foreach (@$plugins) {
@@ -718,7 +719,7 @@ sub www_selectShippingMethod {
_clearShippingScratch;
- $i18n = WebGUI::International->new('Commerce');
+ $i18n = WebGUI::International->new($session, 'Commerce');
$plugins = WebGUI::Commerce::Shipping->getEnabledPlugins;
if (scalar(@$plugins) > 1) {
@@ -788,7 +789,7 @@ sub www_viewCart {
my $session = shift;
my ($shoppingCart, $normal, $recurring, %var, $total, $i18n);
- $i18n = WebGUI::International->new('Commerce');
+ $i18n = WebGUI::International->new($session, 'Commerce');
# Put contents of cart in template vars
$shoppingCart = WebGUI::Commerce::ShoppingCart->new;
diff --git a/lib/WebGUI/Operation/DatabaseLink.pm b/lib/WebGUI/Operation/DatabaseLink.pm
index 858fe70b9..8dc49a670 100644
--- a/lib/WebGUI/Operation/DatabaseLink.pm
+++ b/lib/WebGUI/Operation/DatabaseLink.pm
@@ -24,18 +24,19 @@ sub _submenu {
my $session = shift;
my $workarea = shift;
my $title = shift;
- $title = WebGUI::International::get($title) if ($title);
+ my $i18n = WebGUI::International->new($session);
+ $title = $i18n->get($title) if ($title);
my $help = shift;
my $ac = WebGUI::AdminConsole->new($session,"databases");
if ($help) {
$ac->setHelp($help);
}
- $ac->addSubmenuItem($session->url->page('op=editDatabaseLink;dlid=new'), WebGUI::International::get(982));
+ $ac->addSubmenuItem($session->url->page('op=editDatabaseLink;dlid=new'), $i18n->get(982));
if (($session->form->process("op") eq "editDatabaseLink" && $session->form->process("dlid") ne "new") || $session->form->process("op") eq "deleteDatabaseLink") {
- $ac->addSubmenuItem($session->url->page('op=editDatabaseLink;dlid='.$session->form->process("dlid")), WebGUI::International::get(983));
- $ac->addSubmenuItem($session->url->page('op=copyDatabaseLink;dlid='.$session->form->process("dlid")), WebGUI::International::get(984));
- $ac->addSubmenuItem($session->url->page('op=deleteDatabaseLink;dlid='.$session->form->process("dlid")), WebGUI::International::get(985));
- $ac->addSubmenuItem($session->url->page('op=listDatabaseLinks'), WebGUI::International::get(986));
+ $ac->addSubmenuItem($session->url->page('op=editDatabaseLink;dlid='.$session->form->process("dlid")), $i18n->get(983));
+ $ac->addSubmenuItem($session->url->page('op=copyDatabaseLink;dlid='.$session->form->process("dlid")), $i18n->get(984));
+ $ac->addSubmenuItem($session->url->page('op=deleteDatabaseLink;dlid='.$session->form->process("dlid")), $i18n->get(985));
+ $ac->addSubmenuItem($session->url->page('op=listDatabaseLinks'), $i18n->get(986));
}
return $ac->render($workarea, $title);
}
@@ -52,13 +53,14 @@ sub www_copyDatabaseLink {
sub www_deleteDatabaseLink {
my $session = shift;
return $session->privilege->insufficient unless ($session->user->isInGroup(3));
+ my $i18n = WebGUI::International->new($session);
my ($output);
- $output .= WebGUI::International::get(988).'';
+ $output .= $i18n->get(988).'
';
$output .= '
';
+ '">'.$i18n->get(45).'';
return _submenu($output,"987","database link delete");
}
@@ -81,6 +83,7 @@ sub www_editDatabaseLink {
} else {
%db = %{WebGUI::DatabaseLink->new($session,$session->form->process("dlid"))->get};
}
+ my $i18n = WebGUI::International->new($session);
$f = WebGUI::HTMLForm->new($session,
-extras=>'autocomplete="off"'
);
@@ -94,31 +97,31 @@ sub www_editDatabaseLink {
);
$f->readOnly(
-value => $session->form->process("dlid"),
- -label => WebGUI::International::get(991),
- -hoverHelp => WebGUI::International::get('991 description'),
+ -label => $i18n->get(991),
+ -hoverHelp => $i18n->get('991 description'),
);
$f->text(
-name => "title",
- -label => WebGUI::International::get(992),
- -hoverHelp => WebGUI::International::get('992 description'),
+ -label => $i18n->get(992),
+ -hoverHelp => $i18n->get('992 description'),
-value => $db{title},
);
$f->text(
-name => "DSN",
- -label => WebGUI::International::get(993),
- -hoverHelp => WebGUI::International::get('993 description'),
+ -label => $i18n->get(993),
+ -hoverHelp => $i18n->get('993 description'),
-value => $db{DSN},
);
$f->text(
-name => "dbusername",
- -label => WebGUI::International::get(994),
- -hoverHelp => WebGUI::International::get('994 description'),
+ -label => $i18n->get(994),
+ -hoverHelp => $i18n->get('994 description'),
-value => $db{username},
);
$f->password(
-name => "dbidentifier",
- -label => WebGUI::International::get(995),
- -hoverHelp => WebGUI::International::get('995 description'),
+ -label => $i18n->get(995),
+ -hoverHelp => $i18n->get('995 description'),
-value => $db{identifier},
);
$f->submit;
@@ -150,8 +153,9 @@ sub www_listDatabaseLinks {
return $session->privilege->adminOnly() unless($session->user->isInGroup(3));
my $links = WebGUI::DatabaseLinks->getList($session);
my $output = '';
+ my $i18n = WebGUI::International->new($session);
foreach my $id (keys %{$links}) {
- $output .= ''.WebGUI::International::get(1076).' ';
+ $output .= ''.$i18n->get(1076).' ';
$output = ''
.$session->icon->delete('op=deleteDatabaseLink;dlid='.$id)
.$session->icon->edit('op=editDatabaseLink;dlid='.$id)
diff --git a/lib/WebGUI/Operation/FormHelpers.pm b/lib/WebGUI/Operation/FormHelpers.pm
index bfac10f67..9ceb42843 100644
--- a/lib/WebGUI/Operation/FormHelpers.pm
+++ b/lib/WebGUI/Operation/FormHelpers.pm
@@ -49,21 +49,22 @@ sub www_formAssetTree {
sub www_richEditPageTree {
my $session = shift;
+ my $i18n = WebGUI::International->new($session);
my $f = WebGUI::HTMLForm->new($session,-action=>"#",-extras=>'name"linkchooser"');
$f->text(
-name=>"url",
- -label=>WebGUI::International::get(104),
- -hoverHelp=>WebGUI::International::get('104 description'),
+ -label=>$i18n->get(104),
+ -hoverHelp=>$i18n->get('104 description'),
);
$f->selectBox(
-name=>"target",
- -label=>WebGUI::International::get('target'),
- -hoverHelp=>WebGUI::International::get('target description'),
- -options=>{"_self"=>WebGUI::International::get('link in same window'),
- "_blank"=>WebGUI::International::get('link in new window')},
+ -label=>$i18n->get('target'),
+ -hoverHelp=>$i18n->get('target description'),
+ -options=>{"_self"=>$i18n->get('link in same window'),
+ "_blank"=>$i18n->get('link in new window')},
);
$f->button(
- -value=>WebGUI::International::get('done'),
+ -value=>$i18n->get('done'),
-extras=>'onclick="createLink()"'
);
$session->style->setScript($session->config->get("extrasURL")."/tinymce/jscripts/tiny_mce/tiny_mce_popup.js",{type=>"text/javascript"});
@@ -73,7 +74,7 @@ sub www_richEditPageTree {
function createLink() {
if (window.opener) {
if (document.getElementById("url_formId").value == "") {
- alert("'.WebGUI::International::get("link enter alert").'");
+ alert("'.$i18n->get("link enter alert").'");
document.getElementById("url_formId").focus();
}
window.opener.tinyMCE.insertLink("^" + "/" + ";" + document.getElementById("url_formId").value,document.getElementById("target_formId").value);
diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm
index 98d06cca4..a373bcd8f 100644
--- a/lib/WebGUI/Operation/Group.pm
+++ b/lib/WebGUI/Operation/Group.pm
@@ -43,26 +43,27 @@ sub _submenu {
my $session = shift;
my $workarea = shift;
my $title = shift;
- $title = WebGUI::International::get($title) if ($title);
+ my $i18n = WebGUI::International->new($session);
+ $title = $i18n->get($title) if ($title);
my $help = shift;
my $ac = WebGUI::AdminConsole->new($session,"groups");
if ($help) {
$ac->setHelp($help);
}
if ($session->user->isInGroup(3)) {
- $ac->addSubmenuItem($session->url->page('op=editGroup;gid=new'), WebGUI::International::get(90));
+ $ac->addSubmenuItem($session->url->page('op=editGroup;gid=new'), $i18n->get(90));
}
if ($session->user->isInGroup(11)) {
unless ($session->form->process("op") eq "listGroups"
|| $session->form->process("gid") eq "new"
|| $session->form->process("op") eq "deleteGroupConfirm") {
- $ac->addSubmenuItem($session->url->page("op=editGroup;gid=".$session->form->process("gid")), WebGUI::International::get(753));
- $ac->addSubmenuItem($session->url->page("op=manageUsersInGroup;gid=".$session->form->process("gid")), WebGUI::International::get(754));
- $ac->addSubmenuItem($session->url->page("op=manageGroupsInGroup;gid=".$session->form->process("gid")), WebGUI::International::get(807));
- $ac->addSubmenuItem($session->url->page("op=emailGroup;gid=".$session->form->process("gid")), WebGUI::International::get(808));
- $ac->addSubmenuItem($session->url->page("op=deleteGroup;gid=".$session->form->process("gid")), WebGUI::International::get(806));
+ $ac->addSubmenuItem($session->url->page("op=editGroup;gid=".$session->form->process("gid")), $i18n->get(753));
+ $ac->addSubmenuItem($session->url->page("op=manageUsersInGroup;gid=".$session->form->process("gid")), $i18n->get(754));
+ $ac->addSubmenuItem($session->url->page("op=manageGroupsInGroup;gid=".$session->form->process("gid")), $i18n->get(807));
+ $ac->addSubmenuItem($session->url->page("op=emailGroup;gid=".$session->form->process("gid")), $i18n->get(808));
+ $ac->addSubmenuItem($session->url->page("op=deleteGroup;gid=".$session->form->process("gid")), $i18n->get(806));
}
- $ac->addSubmenuItem($session->url->page("op=listGroups"), WebGUI::International::get(756));
+ $ac->addSubmenuItem($session->url->page("op=listGroups"), $i18n->get(756));
}
return $ac->render($workarea, $title);
}
@@ -105,6 +106,7 @@ sub getGroupSearchForm {
$session->scratch->set("groupSearchKeyword",$session->form->process("keyword"));
$session->scratch->set("groupSearchModifier",$session->form->process("modifier"));
my $output = '';
+ my $i18n = WebGUI::International->new($session);
my $f = WebGUI::HTMLForm->new($session,1);
foreach my $key (keys %{$params}) {
$f->hidden(
@@ -122,11 +124,11 @@ sub getGroupSearchForm {
);
$f->selectBox(
-name=>"modifier",
- -value=>($session->scratch->get("groupSearchModifier") || WebGUI::International::get("contains") ),
+ -value=>($session->scratch->get("groupSearchModifier") || $i18n->get("contains") ),
-options=>{
- startsWith=>WebGUI::International::get("starts with"),
- contains=>WebGUI::International::get("contains"),
- endsWith=>WebGUI::International::get("ends with")
+ startsWith=>$i18n->get("starts with"),
+ contains=>$i18n->get("contains"),
+ endsWith=>$i18n->get("ends with")
}
);
$f->text(
@@ -134,7 +136,7 @@ sub getGroupSearchForm {
-value=>$session->scratch->get("groupSearchKeyword"),
-size=>15
);
- $f->submit(value=>WebGUI::International::get(170));
+ $f->submit(value=>$i18n->get(170));
$output .= $f->print;
$output .= '
';
return $output;
@@ -204,12 +206,13 @@ sub www_deleteGroup {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3) || _hasSecondaryPrivilege($session->form->process("gid")));
return $session->privilege->vitalComponent() if (isIn($session->form->process("gid"), qw(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17)));
+ my $i18n = WebGUI::International->new($session);
my ($output);
- $output .= WebGUI::International::get(86).'';
+ $output .= $i18n->get(86).'
';
$output .= '
';
+ .$i18n->get(45).'';
return _submenu($output, '42',"group delete");
}
@@ -268,6 +271,7 @@ sub www_editGroup {
} else {
$g = WebGUI::Group->new($session->form->process("gid"));
}
+ my $i18n = WebGUI::International->new($session);
$f = WebGUI::HTMLForm->new($session);
$f->hidden(
-name => "op",
@@ -278,70 +282,70 @@ sub www_editGroup {
-value => $session->form->process("gid")
);
$f->readOnly(
- -label => WebGUI::International::get(379),
+ -label => $i18n->get(379),
-value => $g->getId,
);
$f->text(
-name => "groupName",
- -label => WebGUI::International::get(84),
- -hoverHelp => WebGUI::International::get('84 description'),
+ -label => $i18n->get(84),
+ -hoverHelp => $i18n->get('84 description'),
-value => $g->name,
);
$f->textarea(
-name => "description",
- -label => WebGUI::International::get(85),
- -hoverHelp => WebGUI::International::get('85 description'),
+ -label => $i18n->get(85),
+ -hoverHelp => $i18n->get('85 description'),
-value => $g->description,
);
$f->interval(
-name=>"expireOffset",
- -label=>WebGUI::International::get(367),
- -hoverHelp=>WebGUI::International::get('367 description'),
+ -label=>$i18n->get(367),
+ -hoverHelp=>$i18n->get('367 description'),
-value=>$g->expireOffset
);
$f->yesNo(
-name=>"expireNotify",
-value=>$g->expireNotify,
- -label=>WebGUI::International::get(865),
- -hoverHelp=>WebGUI::International::get('865 description'),
+ -label=>$i18n->get(865),
+ -hoverHelp=>$i18n->get('865 description'),
);
$f->integer(
-name=>"expireNotifyOffset",
-value=>$g->expireNotifyOffset,
- -label=>WebGUI::International::get(864),
- -hoverHelp=>WebGUI::International::get('864 description'),
+ -label=>$i18n->get(864),
+ -hoverHelp=>$i18n->get('864 description'),
);
$f->textarea(
-name=>"expireNotifyMessage",
-value=>$g->expireNotifyMessage,
- -label=>WebGUI::International::get(866),
- -hoverHelp=>WebGUI::International::get('866 description'),
+ -label=>$i18n->get(866),
+ -hoverHelp=>$i18n->get('866 description'),
);
$f->integer(
-name=>"deleteOffset",
-value=>$g->deleteOffset,
- -label=>WebGUI::International::get(863),
- -hoverHelp=>WebGUI::International::get('863 description'),
+ -label=>$i18n->get(863),
+ -hoverHelp=>$i18n->get('863 description'),
);
if ($session->setting->get("useKarma")) {
$f->integer(
-name=>"karmaThreshold",
- -label=>WebGUI::International::get(538),
- -hoverHelp=>WebGUI::International::get('538 description'),
+ -label=>$i18n->get(538),
+ -hoverHelp=>$i18n->get('538 description'),
-value=>$g->karmaThreshold
);
}
$f->textarea(
-name=>"ipFilter",
-value=>$g->ipFilter,
- -label=>WebGUI::International::get(857),
- -hoverHelp=>WebGUI::International::get('857 description'),
+ -label=>$i18n->get(857),
+ -hoverHelp=>$i18n->get('857 description'),
);
$f->textarea(
-name=>"scratchFilter",
-value=>$g->scratchFilter,
- -label=>WebGUI::International::get(945),
- -hoverHelp=>WebGUI::International::get('945 description'),
+ -label=>$i18n->get(945),
+ -hoverHelp=>$i18n->get('945 description'),
);
if ($session->form->process("gid") eq "3") {
$f->hidden(
@@ -356,14 +360,14 @@ sub www_editGroup {
$f->yesNo(
-name=>"autoAdd",
-value=>$g->autoAdd,
- -label=>WebGUI::International::get(974),
- -hoverHelp=>WebGUI::International::get('974 description'),
+ -label=>$i18n->get(974),
+ -hoverHelp=>$i18n->get('974 description'),
);
$f->yesNo(
-name=>"autoDelete",
-value=>$g->autoDelete,
- -label=>WebGUI::International::get(975),
- -hoverHelp=>WebGUI::International::get('975 description'),
+ -label=>$i18n->get(975),
+ -hoverHelp=>$i18n->get('975 description'),
);
}
$f->databaseLink(
@@ -372,32 +376,32 @@ sub www_editGroup {
$f->textarea(
-name=>"dbQuery",
-value=>$g->dbQuery,
- -label=>WebGUI::International::get(1005),
- -hoverHelp=>WebGUI::International::get('1005 description'),
+ -label=>$i18n->get(1005),
+ -hoverHelp=>$i18n->get('1005 description'),
);
$f->text(
-name=>"ldapGroup",
- -label=>WebGUI::International::get("LDAPLink_ldapGroup","AuthLDAP"),
- -hoverHelp=>WebGUI::International::get("LDAPLink_ldapGroup","AuthLDAP"),
+ -label=>$i18n->get("LDAPLink_ldapGroup","AuthLDAP"),
+ -hoverHelp=>$i18n->get("LDAPLink_ldapGroup","AuthLDAP"),
-value=>$g->ldapGroup
);
$f->text(
-name=>"ldapGroupProperty",
- -label=>WebGUI::International::get("LDAPLink_ldapGroupProperty","AuthLDAP"),
- -hoverHelp=>WebGUI::International::get("LDAPLink_ldapGroupProperty","AuthLDAP"),
+ -label=>$i18n->get("LDAPLink_ldapGroupProperty","AuthLDAP"),
+ -hoverHelp=>$i18n->get("LDAPLink_ldapGroupProperty","AuthLDAP"),
-value=>$g->ldapGroupProperty,
-defaultValue=>"member"
);
$f->text(
-name=>"ldapRecursiveProperty",
- -label=>WebGUI::International::get("LDAPLink_ldapRecursiveProperty","AuthLDAP"),
- -hoverHelp=>WebGUI::International::get("LDAPLink_ldapRecursiveProperty","AuthLDAP"),
+ -label=>$i18n->get("LDAPLink_ldapRecursiveProperty","AuthLDAP"),
+ -hoverHelp=>$i18n->get("LDAPLink_ldapRecursiveProperty","AuthLDAP"),
-value=>$g->ldapRecursiveProperty
);
$f->interval(
-name=>"dbCacheTimeout",
- -label=>WebGUI::International::get(1004),
- -hoverHelp=>WebGUI::International::get('1004 description'),
+ -label=>$i18n->get(1004),
+ -hoverHelp=>$i18n->get('1004 description'),
-value=>$g->dbCacheTimeout
);
$f->submit;
@@ -435,6 +439,7 @@ sub www_editGroupSave {
sub www_editGrouping {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3) || _hasSecondaryPrivilege($session->form->process("gid")));
+ my $i18n = WebGUI::International->new($session);
my $f = WebGUI::HTMLForm->new($session);
$f->hidden(
-name => "op",
@@ -452,24 +457,24 @@ sub www_editGrouping {
my $g = WebGUI::Group->new($session->form->process("gid"));
$f->readOnly(
-value => $u->username,
- -label => WebGUI::International::get(50),
- -hoverHelp => WebGUI::International::get('50 description'),
+ -label => $i18n->get(50),
+ -hoverHelp => $i18n->get('50 description'),
);
$f->readOnly(
-value => $g->name,
- -label => WebGUI::International::get(84),
- -hoverHelp => WebGUI::International::get('84 description'),
+ -label => $i18n->get(84),
+ -hoverHelp => $i18n->get('84 description'),
);
$f->date(
-name => "expireDate",
- -label => WebGUI::International::get(369),
- -hoverHelp => WebGUI::International::get('369 description'),
+ -label => $i18n->get(369),
+ -hoverHelp => $i18n->get('369 description'),
-value => $group->userGroupExpireDate($session->form->process("uid"),$session->form->process("gid")),
);
$f->yesNo(
-name=>"groupAdmin",
- -label=>WebGUI::International::get(977),
- -hoverHelp=>WebGUI::International::get('977 description'),
+ -label=>$i18n->get(977),
+ -hoverHelp=>$i18n->get('977 description'),
-value=>$group->userIsAdmin($session->form->process("uid"),$session->form->process("gid"))
);
$f->submit;
@@ -490,6 +495,7 @@ sub www_emailGroup {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3) || _hasSecondaryPrivilege($session->form->process("gid")));
my ($output,$f);
+ my $i18n = WebGUI::International->new($session);
$f = WebGUI::HTMLForm->new($session);
$f->hidden(
-name => "op",
@@ -502,21 +508,21 @@ sub www_emailGroup {
$f->email(
-name=>"from",
-value=>$session->setting->get("companyEmail"),
- -label=>WebGUI::International::get(811),
- -hoverHelp=>WebGUI::International::get('811 description'),
+ -label=>$i18n->get(811),
+ -hoverHelp=>$i18n->get('811 description'),
);
$f->text(
-name=>"subject",
- -label=>WebGUI::International::get(229),
- -hoverHelp=>WebGUI::International::get('229 description'),
+ -label=>$i18n->get(229),
+ -hoverHelp=>$i18n->get('229 description'),
);
$f->textarea(
-name=>"message",
- -label=>WebGUI::International::get(230),
- -hoverHelp=>WebGUI::International::get('230 description'),
+ -label=>$i18n->get(230),
+ -hoverHelp=>$i18n->get('230 description'),
-rows=>(5+$session->setting->get("textAreaRows")),
);
- $f->submit(WebGUI::International::get(810));
+ $f->submit($i18n->get(810));
$output = $f->print;
return _submenu($output,'809');
}
@@ -534,20 +540,22 @@ sub www_emailGroupSend {
}
}
$sth->finish;
- return _submenu(WebGUI::International::get(812));
+ my $i18n = WebGUI::International->new($session);
+ return _submenu($i18n->get(812));
}
#-------------------------------------------------------------------
sub www_listGroups {
my $session = shift;
+ my $i18n = WebGUI::International->new($session);
if ($session->user->isInGroup(3)) {
my $output = getGroupSearchForm("listGroups");
my ($groupCount) = $session->db->quickArray("select count(*) from groups where isEditable=1");
return _submenu($output) unless ($session->form->process("doit") || $groupCount<250 || $session->form->process("pn") > 1);
$output .= '';
- $output .= ' ';
+ $output .= ' ';
my $p = doGroupSearch("op=listGroups",1);
foreach my $row (@{$p->getPageData}) {
my ($userCount) = $session->db->quickArray("select count(*) from groupings where groupId=".$session->db->quote($row->{groupId}));
@@ -582,9 +590,9 @@ sub www_listGroups {
$p = WebGUI::Paginator->new($session,$session->url->page('op=listGroups'));
$p->setDataByArrayRef(\@row);
$output .= '';
- $output .= ' ';
+ $output .= ' ';
$output .= $p->getPage($session->form->process("pn"));
$output .= '
';
$output .= $p->getBarTraditional($session->form->process("pn"));
@@ -611,10 +619,11 @@ sub www_manageGroupsInGroup {
my $groupsIn = $group->getGroupsIn($session->form->process("gid"),1);
my $groupsFor = $group->getGroupsFor($session->form->process("gid"));
push(@groups, @$groupsIn,@$groupsFor,$session->form->process("gid"));
+ my $i18n = WebGUI::International->new($session);
$f->group(
-name=>"groups",
-excludeGroups=>\@groups,
- -label=>WebGUI::International::get(605),
+ -label=>$i18n->get(605),
-size=>5,
-multiple=>1
);
@@ -629,6 +638,7 @@ sub www_manageGroupsInGroup {
sub www_manageUsersInGroup {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3) || _hasSecondaryPrivilege($session->form->process("gid")));
+ my $i18n = WebGUI::International->new($session);
my $output = WebGUI::Form::formHeader($session,)
.WebGUI::Form::hidden({
name=>"gid",
@@ -640,8 +650,8 @@ sub www_manageUsersInGroup {
});
$output .= '
-
- ';
+
+ ';
my $p = WebGUI::Paginator->new($session,$session->url->page("op=manageUsersInGroup;gid=".$session->form->process("gid")));
$p->setDataByQuery("select users.username,users.userId,groupings.expireDate
from groupings,users where groupings.groupId=".$session->db->quote($session->form->process("gid"))." and groupings.userId=users.userId
@@ -660,7 +670,7 @@ sub www_manageUsersInGroup {
}
$output .= '
'.WebGUI::Form::formFooter($session,);
$output .= $p->getBarTraditional;
- $output .= '
'.WebGUI::International::get(976).' ';
+ $output .= '
'.$i18n->get(976).' ';
$output .= WebGUI::Operation::User::getUserSearchForm("manageUsersInGroup",{gid=>$session->form->process("gid")});
my ($userCount) = $session->db->quickArray("select count(*) from users");
return _submenu($output) unless ($session->form->process("doit") || $userCount < 250 || $session->form->process("pn") > 1);
@@ -685,7 +695,7 @@ sub www_manageUsersInGroup {
$sth->finish;
$f->selectList(
-name=>"users",
- -label=>WebGUI::International::get(976),
+ -label=>$i18n->get(976),
-options=>\%users,
-multiple=>1,
-size=>7
diff --git a/lib/WebGUI/Operation/Help.pm b/lib/WebGUI/Operation/Help.pm
index cc6b0c779..9af3d4f47 100644
--- a/lib/WebGUI/Operation/Help.pm
+++ b/lib/WebGUI/Operation/Help.pm
@@ -93,7 +93,8 @@ sub _getHelpName {
else {
$helpName = 'topicName';
}
- return WebGUI::International::get($helpName,$file);
+ my $i18n = WebGUI::International->new($session);
+ return $i18n->get($helpName,$file);
}
#-------------------------------------------------------------------
@@ -102,26 +103,26 @@ sub www_viewHelp {
return $session->privilege->insufficient() unless ($session->user->isInGroup(7));
my $ac = WebGUI::AdminConsole->new($session,"help");
my $namespace = $session->form->process("namespace") || "WebGUI";
- my $i18n = WebGUI::International->new($namespace);
+ my $i18n = WebGUI::International->new($session, $namespace);
my $help = _get($session->form->process("hid"),$namespace);
foreach my $row (@{$help->{related}}) {
my $relatedHelp = _get($row->{tag},$row->{namespace});
- $ac->addSubmenuItem(_link($row->{tag},$row->{namespace}),WebGUI::International::get($relatedHelp->{title},$row->{namespace}));
+ $ac->addSubmenuItem(_link($row->{tag},$row->{namespace}),$i18n->get($relatedHelp->{title},$row->{namespace}));
}
my %vars;
$vars{body} = $i18n->get($help->{body});
foreach my $row (@{ $help->{fields} }) {
push @{ $vars{fields} },
- { 'title' => WebGUI::International::get($row->{title},$row->{namespace}),
- 'description' => WebGUI::International::get($row->{description},$row->{namespace}), }
+ { 'title' => $i18n->get($row->{title},$row->{namespace}),
+ 'description' => $i18n->get($row->{description},$row->{namespace}), }
}
my $body = WebGUI::Asset::Template->new("PBtmplHelp000000000001")->process(\%vars);
- $ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),WebGUI::International::get(95));
- $ac->addSubmenuItem($session->url->page('op=viewHelpTOC'),WebGUI::International::get('help contents'));
+ $ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),$i18n->get(95, 'WebGUI'));
+ $ac->addSubmenuItem($session->url->page('op=viewHelpTOC'),$i18n->get('help contents', 'WebGUI'));
WebGUI::Macro::process($session,\$body);
return $ac->render(
$body,
- WebGUI::International::get(93).': '.$i18n->get($help->{title})
+ $i18n->get(93, 'WebGUI').': '.$i18n->get($help->{title})
);
}
@@ -129,6 +130,7 @@ sub www_viewHelp {
sub www_viewHelpIndex {
my $session = shift;
return $session->privilege->insufficient() unless ($session->user->isInGroup(7));
+ my $i18n = WebGUI::International->new($session);
my @helpIndex;
my $i;
my @files = _getHelpFilesList();
@@ -137,7 +139,7 @@ sub www_viewHelpIndex {
my $help = _load($namespace);
foreach my $key (keys %{$help}) {
push @helpIndex, [$namespace, $key,
- WebGUI::International::get($help->{$key}{title},$namespace)];
+ $i18n->get($help->{$key}{title},$namespace)];
$i++;
}
}
@@ -155,8 +157,8 @@ sub www_viewHelpIndex {
}
$output .= '
';
my $ac = WebGUI::AdminConsole->new($session,"help");
- $ac->addSubmenuItem($session->url->page('op=viewHelpTOC'),WebGUI::International::get('help contents'));
- return $ac->render($output, join ': ',WebGUI::International::get(93), WebGUI::International::get('help index'));
+ $ac->addSubmenuItem($session->url->page('op=viewHelpTOC'),$i18n->get('help contents'));
+ return $ac->render($output, join ': ',$i18n->get(93), $i18n->get('help index'));
}
#-------------------------------------------------------------------
@@ -184,9 +186,10 @@ sub www_viewHelpTOC {
}
}
$output .= '
';
+ my $i18n = WebGUI::International->new($session);
my $ac = WebGUI::AdminConsole->new($session,"help");
- $ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),WebGUI::International::get(95));
- return $ac->render($output, join ': ',WebGUI::International::get(93), WebGUI::International::get('help toc'));
+ $ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),$i18n->get(95));
+ return $ac->render($output, join ': ',$i18n->get(93), $i18n->get('help toc'));
}
#-------------------------------------------------------------------
@@ -197,13 +200,14 @@ sub www_viewHelpChapter {
my $help = _load($namespace);
my @entries = sort keys %{ $help };
my $output = '';
+ my $i18n = WebGUI::International->new($session);
foreach my $id (@entries) {
- $output .= ''.WebGUI::International::get($help->{$id}{title},$namespace).'
';
+ $output .= ''.$i18n->get($help->{$id}{title},$namespace).'
';
}
my $ac = WebGUI::AdminConsole->new($session,"help");
- $ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),WebGUI::International::get(95));
- $ac->addSubmenuItem($session->url->page('op=viewHelpTOC'),WebGUI::International::get('help contents'));
- return $ac->render($output, join ': ',WebGUI::International::get(93), _getHelpName($namespace));
+ $ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),$i18n->get(95));
+ $ac->addSubmenuItem($session->url->page('op=viewHelpTOC'),$i18n->get('help contents'));
+ return $ac->render($output, join ': ',$i18n->get(93), _getHelpName($namespace));
}
1;
diff --git a/lib/WebGUI/Operation/LDAPLink.pm b/lib/WebGUI/Operation/LDAPLink.pm
index e42972ad8..9fcb87a2f 100644
--- a/lib/WebGUI/Operation/LDAPLink.pm
+++ b/lib/WebGUI/Operation/LDAPLink.pm
@@ -27,9 +27,10 @@ use WebGUI::URL;
#-------------------------------------------------------------------
sub _submenu {
my $session = shift;
- my $workarea = shift;
- my $title = shift;
- $title = WebGUI::International::get($title,"AuthLDAP") if ($title);
+ my $workarea = shift;
+ my $title = shift;
+ my $i18n = WebGUI::International->new($session,"AuthLDAP");
+ $title = $i18n->get($title) if ($title);
my $help = shift;
my $ac = WebGUI::AdminConsole->new($session,"ldapconnections");
if ($help) {
@@ -39,12 +40,12 @@ sub _submenu {
if($session->form->process("returnUrl")) {
$returnUrl = ";returnUrl=".$session->url->escape($session->form->process("returnUrl"));
}
- $ac->addSubmenuItem($session->url->page('op=editLDAPLink;llid=new'.$returnUrl), WebGUI::International::get("LDAPLink_982","AuthLDAP"));
+ $ac->addSubmenuItem($session->url->page('op=editLDAPLink;llid=new'.$returnUrl), $i18n->get("LDAPLink_982"));
if ($session->form->process("op") eq "editLDAPLink" && $session->form->process("llid") ne "new") {
- $ac->addSubmenuItem($session->url->page('op=editLDAPLink;llid='.$session->form->process("llid").$returnUrl), WebGUI::International::get("LDAPLink_983","AuthLDAP"));
- $ac->addSubmenuItem($session->url->page('op=copyLDAPLink;llid='.$session->form->process("llid").$returnUrl), WebGUI::International::get("LDAPLink_984","AuthLDAP"));
- $ac->addSubmenuItem($session->url->page('op=deleteLDAPLink;llid='.$session->form->process("llid")), WebGUI::International::get("LDAPLink_985","AuthLDAP"));
- $ac->addSubmenuItem($session->url->page('op=listLDAPLinks'.$returnUrl), WebGUI::International::get("LDAPLink_986","AuthLDAP"));
+ $ac->addSubmenuItem($session->url->page('op=editLDAPLink;llid='.$session->form->process("llid").$returnUrl), $i18n->get("LDAPLink_983"));
+ $ac->addSubmenuItem($session->url->page('op=copyLDAPLink;llid='.$session->form->process("llid").$returnUrl), $i18n->get("LDAPLink_984"));
+ $ac->addSubmenuItem($session->url->page('op=deleteLDAPLink;llid='.$session->form->process("llid")), $i18n->get("LDAPLink_985"));
+ $ac->addSubmenuItem($session->url->page('op=listLDAPLinks'.$returnUrl), $i18n->get("LDAPLink_986"));
}
return $ac->render($workarea, $title);
}
@@ -80,6 +81,7 @@ sub www_editLDAPLink {
tie %db, 'Tie::CPHash';
%db = $session->db->quickHash("select * from ldapLink where ldapLinkId=".$session->db->quote($session->form->process("llid")));
+ my $i18n = WebGUI::International->new($session,"AuthLDAP");
$f = WebGUI::HTMLForm->new($session, -extras=>'autocomplete="off"' );
$f->hidden(
-name => "op",
@@ -94,89 +96,89 @@ sub www_editLDAPLink {
-value => $session->form->process("returnUrl"),
);
$f->readOnly(
- -label => WebGUI::International::get("LDAPLink_991","AuthLDAP"),
+ -label => $i18n->get("LDAPLink_991"),
-value => $session->form->process("llid"),
);
$f->text(
-name => "ldapLinkName",
- -label => WebGUI::International::get("LDAPLink_992","AuthLDAP"),
- -hoverHelp => WebGUI::International::get("LDAPLink_992 description","AuthLDAP"),
+ -label => $i18n->get("LDAPLink_992"),
+ -hoverHelp => $i18n->get("LDAPLink_992 description"),
-value => $db{ldapLinkName},
);
$f->text(
-name => "ldapUrl",
- -label => WebGUI::International::get("LDAPLink_993","AuthLDAP"),
- -hoverHelp => WebGUI::International::get("LDAPLink_993 description","AuthLDAP"),
+ -label => $i18n->get("LDAPLink_993"),
+ -hoverHelp => $i18n->get("LDAPLink_993 description"),
-value => $db{ldapUrl},
);
$f->text(
-name => "connectDn",
- -label => WebGUI::International::get("LDAPLink_994","AuthLDAP"),
- -hoverHelp => WebGUI::International::get("LDAPLink_994 description","AuthLDAP"),
+ -label => $i18n->get("LDAPLink_994"),
+ -hoverHelp => $i18n->get("LDAPLink_994 description"),
-value => $db{connectDn},
);
$f->password(
-name => "ldapIdentifier",
- -label => WebGUI::International::get("LDAPLink_995","AuthLDAP"),
- -hoverHelp => WebGUI::International::get("LDAPLink_995 description","AuthLDAP"),
+ -label => $i18n->get("LDAPLink_995"),
+ -hoverHelp => $i18n->get("LDAPLink_995 description"),
-value => $db{identifier},
);
$f->text(
-name => "ldapUserRDN",
- -label => WebGUI::International::get(9,'AuthLDAP'),
- -hoverHelp => WebGUI::International::get('9 description','AuthLDAP'),
+ -label => $i18n->get(9),
+ -hoverHelp => $i18n->get('9 description'),
-value => $db{ldapUserRDN},
);
$f->text(
-name => "ldapIdentity",
- -label => WebGUI::International::get(6,'AuthLDAP'),
- -hoverHelp => WebGUI::International::get('6 description','AuthLDAP'),
+ -label => $i18n->get(6),
+ -hoverHelp => $i18n->get('6 description'),
-value => $db{ldapIdentity},
);
$f->text(
-name => "ldapIdentityName",
- -label => WebGUI::International::get(7,'AuthLDAP'),
- -hoverHelp => WebGUI::International::get('7 description','AuthLDAP'),
+ -label => $i18n->get(7),
+ -hoverHelp => $i18n->get('7 description'),
-value => $db{ldapIdentityName},
);
$f->text(
-name => "ldapPasswordName",
- -label => WebGUI::International::get(8,'AuthLDAP'),
- -hoverHelp => WebGUI::International::get('8 description','AuthLDAP'),
+ -label => $i18n->get(8),
+ -hoverHelp => $i18n->get('8 description'),
-value => $db{ldapPasswordName},
);
$f->yesNo(
-name=>"ldapSendWelcomeMessage",
-value=>$db{ldapSendWelcomeMessage},
- -label=>WebGUI::International::get(868,"AuthLDAP"),
- -hoverHelp=>WebGUI::International::get('868 description',"AuthLDAP"),
+ -label=>$i18n->get(868),
+ -hoverHelp=>$i18n->get('868 description'),
);
$f->textarea(
-name=>"ldapWelcomeMessage",
-value=>$db{ldapWelcomeMessage},
- -label=>WebGUI::International::get(869,"AuthLDAP"),
- -hoverHelp=>WebGUI::International::get('869 description',"AuthLDAP"),
+ -label=>$i18n->get(869),
+ -hoverHelp=>$i18n->get('869 description'),
);
$f->template(
-name=>"ldapAccountTemplate",
-value=>$db{ldapAccountTemplate},
-namespace=>"Auth/LDAP/Account",
- -label=>WebGUI::International::get("account template","AuthLDAP"),
- -hoverHelp=>WebGUI::International::get("account template description","AuthLDAP"),
+ -label=>$i18n->get("account template"),
+ -hoverHelp=>$i18n->get("account template description"),
);
$f->template(
-name=>"ldapCreateAccountTemplate",
-value=>$db{ldapCreateAccountTemplate},
-namespace=>"Auth/LDAP/Create",
- -label=>WebGUI::International::get("create account template","AuthLDAP"),
- -hoverHelp=>WebGUI::International::get("create account template description","AuthLDAP"),
+ -label=>$i18n->get("create account template"),
+ -hoverHelp=>$i18n->get("create account template description"),
);
$f->template(
-name=>"ldapLoginTemplate",
-value=>$db{ldapLoginTemplate},
-namespace=>"Auth/LDAP/Login",
- -label=>WebGUI::International::get("login template","AuthLDAP"),
- -hoverHelp=>WebGUI::International::get("login template description","AuthLDAP"),
+ -label=>$i18n->get("login template"),
+ -hoverHelp=>$i18n->get("login template description"),
);
$f->submit;
@@ -215,25 +217,26 @@ sub www_listLDAPLinks {
my $session = shift;
return $session->privilege->adminOnly() unless($session->user->isInGroup(3));
my ($output, $p, $sth, $data, @row, $i);
+ my $i18n = WebGUI::International->new($session,"AuthLDAP");
my $returnUrl = "";
if($session->form->process("returnUrl")) {
$returnUrl = ";returnUrl=".$session->url->escape($session->form->process("returnUrl"));
}
$sth = $session->db->read("select * from ldapLink order by ldapLinkName");
- $row[$i] = ' '.WebGUI::International::get("LDAPLink_1076","AuthLDAP").' '.WebGUI::International::get("LDAPLink_1077","AuthLDAP").' ';
+ $row[$i] = ' '.$i18n->get("LDAPLink_1076").' '.$i18n->get("LDAPLink_1077").' ';
$i++;
while ($data = $sth->hashRef) {
$row[$i] = ''
- .$session->icon->delete('op=deleteLDAPLink;llid='.$data->{ldapLinkId},$session->url->page(),WebGUI::International::get("LDAPLink_988","AuthLDAP"))
+ .$session->icon->delete('op=deleteLDAPLink;llid='.$data->{ldapLinkId},$session->url->page(),$i18n->get("LDAPLink_988"))
.$session->icon->edit('op=editLDAPLink;llid='.$data->{ldapLinkId}.$returnUrl)
.$session->icon->copy('op=copyLDAPLink;llid='.$data->{ldapLinkId}.$returnUrl)
.' ';
$row[$i] .= ''.$data->{ldapLinkName}.' ';
my $ldapLink = WebGUI::LDAPLink->new($session,$data->{ldapLinkId});
- my $status = WebGUI::International::get("LDAPLink_1078","AuthLDAP");
+ my $status = $i18n->get("LDAPLink_1078");
if($ldapLink->bind) {
- $status = WebGUI::International::get("LDAPLink_1079","AuthLDAP");
+ $status = $i18n->get("LDAPLink_1079");
}else{
$session->errorHandler->warn($ldapLink->getErrorMessage());
}
diff --git a/lib/WebGUI/Operation/LoginHistory.pm b/lib/WebGUI/Operation/LoginHistory.pm
index 12386f327..66a55d154 100644
--- a/lib/WebGUI/Operation/LoginHistory.pm
+++ b/lib/WebGUI/Operation/LoginHistory.pm
@@ -41,10 +41,11 @@ sub www_viewLoginHistory {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
my ($output, $p, @row, $i, $sth, %data);
+ my $i18n = WebGUI::International->new($session);
tie %data, 'Tie::CPHash';
$sth = $session->db->read("select * from users,userLoginLog where users.userId=userLoginLog.userId order by userLoginLog.timeStamp desc");
while (%data = $sth->hash) {
- $data{username} = WebGUI::International::get('unknown user') if ($data{userId} eq "0");
+ $data{username} = $i18n->get('unknown user') if ($data{userId} eq "0");
$row[$i] = ''.$data{username}.' ('.$data{userId}.') ';
$row[$i] .= ''.$data{status}.' ';
$row[$i] .= ''$session->datetime->epochToHuman($data{timeStamp},"%H:%n%p %M/%D/%y").' ';
@@ -56,11 +57,11 @@ sub www_viewLoginHistory {
$p = WebGUI::Paginator->new($session,$session->url->page('op=viewLoginHistory'));
$p->setDataByArrayRef(\@row);
$output .= '';
- $output .= '';
+ $output .= '';
$output .= $p->getPage($session->form->process("pn"));
$output .= '
';
$output .= $p->getBar($session->form->process("pn"));
diff --git a/lib/WebGUI/Operation/MessageLog.pm b/lib/WebGUI/Operation/MessageLog.pm
index 3ac2e2fa6..bdc3a893a 100644
--- a/lib/WebGUI/Operation/MessageLog.pm
+++ b/lib/WebGUI/Operation/MessageLog.pm
@@ -45,7 +45,8 @@ returns a hashref with internationalized values for message status.
sub _status {
my $session = shift;
- return {"notice"=>WebGUI::International::get(551),"pending"=>WebGUI::International::get(552),"completed"=>WebGUI::International::get(350)};
+ my $i18n = WebGUI::International->new($session);
+ return {"notice"=>$i18n->get(551),"pending"=>$i18n->get(552),"completed"=>$i18n->get(350)};
}
#-------------------------------------------------------------------
@@ -60,14 +61,15 @@ sub www_viewMessageLog {
my $session = shift;
my (@msg, $vars);
return $session->privilege->insufficient() unless ($session->user->isInGroup(2,$session->user->profileField("userId")));
- $vars->{displayTitle} = ''.WebGUI::International::get(159).' ';
+ my $i18n = WebGUI::International->new($session);
+ $vars->{displayTitle} = ''.$i18n->get(159).' ';
my $p = WebGUI::Paginator->new($session,$session->url->page('op=viewMessageLog'));
my $query = "select messageLogId,subject,url,dateOfEntry,status from messageLog where userId=".$session->db->quote($session->user->profileField("userId"))." order by dateOfEntry desc";
$p->setDataByQuery($query);
- $vars->{'message.subject.label'} = WebGUI::International::get(351);
- $vars->{'message.status.label'} = WebGUI::International::get(553);
- $vars->{'message.dateOfEntry.label'} = WebGUI::International::get(352);
+ $vars->{'message.subject.label'} = $i18n->get(351);
+ $vars->{'message.status.label'} = $i18n->get(553);
+ $vars->{'message.dateOfEntry.label'} = $i18n->get(352);
my $messages = $p->getPageData;
foreach my $message (@$messages) {
@@ -80,7 +82,7 @@ sub www_viewMessageLog {
push(@msg,$hash);
}
$vars->{'message.loop'} = \@msg;
- $vars->{'message.noresults'} = WebGUI::International::get(353) unless (scalar(@$messages) > 0);
+ $vars->{'message.noresults'} = $i18n->get(353) unless (scalar(@$messages) > 0);
$vars->{'message.firstPage'} = $p->getFirstPageLink;
$vars->{'message.lastPage'} = $p->getLastPageLink;
@@ -105,7 +107,8 @@ sub www_viewMessageLogMessage {
my $session = shift;
my ($data, $vars);
return $session->privilege->insufficient() unless ($session->user->isInGroup(2,$session->user->profileField("userId")));
- $vars->{displayTitle} = ''.WebGUI::International::get(159).' ';
+ my $i18n = WebGUI::International->new($session);
+ $vars->{displayTitle} = ''.$i18n->get(159).' ';
$data = $session->db->quickHashRef("select * from messageLog where messageLogId=".$session->db->quote($session->form->process("mlog"))." and userId=".$session->db->quote($session->user->profileField("userId")));
@@ -115,7 +118,7 @@ sub www_viewMessageLogMessage {
my $status = _status->{$data->{status}};
if ($data->{url} ne "" && $data->{status} eq 'pending'){
$status = ''.$status.' ';
- $vars->{'message.takeAction'} = ''.WebGUI::International::get(554).' '
+ $vars->{'message.takeAction'} = ''.$i18n->get(554).' '
}
$vars->{'message.status'} = $status;
diff --git a/lib/WebGUI/Operation/ProductManager.pm b/lib/WebGUI/Operation/ProductManager.pm
index cb3d78627..484f50001 100755
--- a/lib/WebGUI/Operation/ProductManager.pm
+++ b/lib/WebGUI/Operation/ProductManager.pm
@@ -19,7 +19,7 @@ use WebGUI::Grouping;
#-------------------------------------------------------------------
sub _submenu {
my $session = shift;
- my $i18n = WebGUI::International->new("ProductManager");
+ my $i18n = WebGUI::International->new($session, "ProductManager");
my $workarea = shift;
my $title = shift;
@@ -83,7 +83,7 @@ sub www_editProduct {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new('ProductManager');
+ $i18n = WebGUI::International->new($session, 'ProductManager');
$productId = $session->form->process("productId");
unless ($productId eq 'new') {
@@ -159,7 +159,7 @@ sub www_editProductSave {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new('ProductManager');
+ $i18n = WebGUI::International->new($session, 'ProductManager');
push(@error, $i18n->get('edit product title error')) unless $session->form->process("title");
push(@error, $i18n->get('edit product price error')) unless ($session->form->process("price") && $session->form->process("price") =~ /^\d+(\.\d+)?$/);
@@ -191,7 +191,7 @@ sub www_editProductParameter {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new('ProductManager');
+ $i18n = WebGUI::International->new($session, 'ProductManager');
$parameterId = $session->form->process("parameterId");
$productId = $session->form->process("productId");
@@ -238,7 +238,7 @@ sub www_editProductParameterSave {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new('ProductManager');
+ $i18n = WebGUI::International->new($session, 'ProductManager');
$parameterId = $session->form->process("parameterId");
@@ -277,7 +277,7 @@ sub www_editProductParameterOption {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new('ProductManager');
+ $i18n = WebGUI::International->new($session, 'ProductManager');
$optionId = $session->form->process("optionId");
unless ($optionId eq 'new') {
@@ -341,7 +341,7 @@ sub www_editProductParameterOptionSave {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new('ProductManager');
+ $i18n = WebGUI::International->new($session, 'ProductManager');
push (@error, $i18n->get('edit option value error')) unless ($session->form->process("value"));
push (@error, $i18n->get('edit option parameterId error')) unless ($session->form->process("parameterId"));
@@ -368,7 +368,7 @@ sub www_editProductVariant {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new("ProductManager");
+ $i18n = WebGUI::International->new($session, "ProductManager");
$variantId = $session->form->process("variantId");
$variant = WebGUI::Product->getByVariantId($variantId)->getVariant($variantId);
@@ -434,7 +434,7 @@ sub www_editSkuTemplate {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new("ProductManager");
+ $i18n = WebGUI::International->new($session, "ProductManager");
$productId = $session->form->process("productId");
$product = WebGUI::Product->new($productId);
@@ -488,7 +488,7 @@ sub www_listProducts {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new('ProductManager');
+ $i18n = WebGUI::International->new($session, 'ProductManager');
$session->scratch->set('managingProduct', '-delete-');
@@ -516,7 +516,7 @@ sub www_listProductVariants {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new("ProductManager");
+ $i18n = WebGUI::International->new($session, "ProductManager");
$productId = $session->form->process("productId") || $session->scratch->get('managingProduct');
@@ -598,7 +598,7 @@ sub www_manageProduct {
return $session->privilege->insufficient unless ($session->user->isInGroup(14));
- $i18n = WebGUI::International->new("ProductManager");
+ $i18n = WebGUI::International->new($session, "ProductManager");
$productId = $session->form->process("productId") || $session->scratch->get('managingProduct');
return WebGUI::Operation::execute('listProducts') if ($productId eq 'new' || !$productId);
diff --git a/lib/WebGUI/Operation/Profile.pm b/lib/WebGUI/Operation/Profile.pm
index f90b3bb35..d458d1271 100644
--- a/lib/WebGUI/Operation/Profile.pm
+++ b/lib/WebGUI/Operation/Profile.pm
@@ -79,6 +79,7 @@ sub validateProfileData {
my %data = ();
my $error = "";
my $warning = "";
+ my $i18n = WebGUI::International->new($session);
foreach my $field (@{WebGUI::ProfileField->getEditableFields}) {
my $fieldValue = $field->formProcess;
if (ref $fieldValue eq "ARRAY") {
@@ -87,9 +88,9 @@ sub validateProfileData {
$data{$field->getId} = $fieldValue;
}
if ($field->isRequired && !$data{$field->getId}) {
- $error .= ''.$field->getLabel.' '.WebGUI::International::get(451).' ';
+ $error .= ''.$field->getLabel.' '.$i18n->get(451).' ';
} elsif ($field->getId eq "email" && isDuplicateEmail($data{$field->getId})) {
- $warning .= ''.WebGUI::International::get(1072).' ';
+ $warning .= ''.$i18n->get(1072).' ';
}
}
return (\%data, $error, $warning);
@@ -99,8 +100,9 @@ sub validateProfileData {
sub www_editProfile {
my $session = shift;
return WebGUI::Operation::Auth::www_auth("init") if($session->user->profileField("userId") eq '1');
+ my $i18n = WebGUI::International->new($session);
my $vars = {};
- $vars->{displayTitle} .= ''.WebGUI::International::get(338).' ';
+ $vars->{displayTitle} .= ''.$i18n->get(338).' ';
$vars->{'profile.message'} = $_[0] if($_[0]);
$vars->{'profile.form.header'} = "\n\n".WebGUI::Form::formHeader($session,{});
$vars->{'profile.form.footer'} = WebGUI::Form::formFooter($session,);
@@ -154,12 +156,13 @@ sub www_editProfileSave {
sub www_viewProfile {
my $session = shift;
my $u = WebGUI::User->new($session->form->process("uid"));
+ my $i18n = WebGUI::International->new($session);
my $vars = {};
- $vars->{displayTitle} = ''.WebGUI::International::get(347).' '.$u->username.' ';
+ $vars->{displayTitle} = ''.$i18n->get(347).' '.$u->username.' ';
return $session->privilege->notMember() if($u->username eq "");
- return $session->style->userStyle($vars->{displayTitle}.WebGUI::International::get(862)) if($u->profileField("publicProfile") < 1 && ($session->user->profileField("userId") ne $session->form->process("uid") || $session->user->isInGroup(3)));
+ return $session->style->userStyle($vars->{displayTitle}.$i18n->get(862)) if($u->profileField("publicProfile") < 1 && ($session->user->profileField("userId") ne $session->form->process("uid") || $session->user->isInGroup(3)));
return $session->privilege->insufficient() if(!$session->user->isInGroup(2));
my @array = ();
diff --git a/lib/WebGUI/Operation/ProfileSettings.pm b/lib/WebGUI/Operation/ProfileSettings.pm
index b41bb93dd..ba89e2965 100644
--- a/lib/WebGUI/Operation/ProfileSettings.pm
+++ b/lib/WebGUI/Operation/ProfileSettings.pm
@@ -30,22 +30,23 @@ sub _submenu {
my $title = shift;
my $help = shift;
my $namespace = shift;
- $title = WebGUI::International::get($title,$namespace) if ($title);
+ my $i18n = WebGUI::International->new($session,"WebGUIProfile");
+ $title = $i18n->get($title,$namespace) if ($title);
my $ac = WebGUI::AdminConsole->new($session,"userProfiling");
if ($help) {
$ac->setHelp($help,"WebGUIProfile");
}
- $ac->addSubmenuItem($session->url->page("op=editProfileCategory;cid=new"), WebGUI::International::get(490,"WebGUIProfile"));
- $ac->addSubmenuItem($session->url->page("op=editProfileField;fid=new"), WebGUI::International::get(491,"WebGUIProfile"));
+ $ac->addSubmenuItem($session->url->page("op=editProfileCategory;cid=new"), $i18n->get(490));
+ $ac->addSubmenuItem($session->url->page("op=editProfileField;fid=new"), $i18n->get(491));
if ((($session->form->process("op") eq "editProfileField" && $session->form->process("fid") ne "new") || $session->form->process("op") eq "deleteProfileField") && $session->form->process("cid") eq "") {
- $ac->addSubmenuItem($session->url->page('op=editProfileField;fid='.$session->form->process("fid")), WebGUI::International::get(787,"WebGUIProfile"));
- $ac->addSubmenuItem($session->url->page('op=deleteProfileField;fid='.$session->form->process("fid")), WebGUI::International::get(788,"WebGUIProfile"));
+ $ac->addSubmenuItem($session->url->page('op=editProfileField;fid='.$session->form->process("fid")), $i18n->get(787));
+ $ac->addSubmenuItem($session->url->page('op=deleteProfileField;fid='.$session->form->process("fid")), $i18n->get(788));
}
if ((($session->form->process("op") eq "editProfileCategory" && $session->form->process("cid") ne "new") || $session->form->process("op") eq "deleteProfileCategory") && $session->form->process("fid") eq "") {
- $ac->addSubmenuItem($session->url->page('op=editProfileCategory;cid='.$session->form->process("cid")), WebGUI::International::get(789,"WebGUIProfile"));
- $ac->addSubmenuItem($session->url->page('op=deleteProfileCategory;cid='.$session->form->process("cid")), WebGUI::International::get(790,"WebGUIProfile"));
+ $ac->addSubmenuItem($session->url->page('op=editProfileCategory;cid='.$session->form->process("cid")), $i18n->get(789));
+ $ac->addSubmenuItem($session->url->page('op=deleteProfileCategory;cid='.$session->form->process("cid")), $i18n->get(790));
}
- $ac->addSubmenuItem($session->url->page("op=editProfileSettings"), WebGUI::International::get(492,"WebGUIProfile"));
+ $ac->addSubmenuItem($session->url->page("op=editProfileSettings"), $i18n->get(492));
return $ac->render($workarea, $title);
}
@@ -74,6 +75,7 @@ sub www_editProfileCategory {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
my $data = {};
+ my $i18n = WebGUI::International->new($session,"WebGUIProfile");
my $f = WebGUI::HTMLForm->new($session);
$f->hidden(
-name => "op",
@@ -86,7 +88,7 @@ sub www_editProfileCategory {
);
$f->readOnly(
-name => $session->form->process("cid"),
- -label => WebGUI::International::get(469,"WebGUIProfile"),
+ -label => $i18n->get(469),
);
$data = WebGUI::ProfileCategory->new($session->form->process("cid"))->get;
} else {
@@ -97,21 +99,21 @@ sub www_editProfileCategory {
}
$f->text(
-name => "label",
- -label => WebGUI::International::get(470,"WebGUIProfile"),
- -hoverHelp => WebGUI::International::get('470 description',"WebGUIProfile"),
+ -label => $i18n->get(470),
+ -hoverHelp => $i18n->get('470 description'),
-value => $data->{label},
);
$f->yesNo(
-name=>"visible",
- -label=>WebGUI::International::get(473,"WebGUIProfile"),
- -hoverHelp=>WebGUI::International::get('473 description',"WebGUIProfile"),
+ -label=>$i18n->get(473),
+ -hoverHelp=>$i18n->get('473 description'),
-value=>$data->{visible}
);
$f->yesNo(
-name=>"editable",
-value=>$data->{editable},
- -label=>WebGUI::International::get(897,"WebGUIProfile"),
- -hoverHelp=>WebGUI::International::get('897 description',"WebGUIProfile"),
+ -label=>$i18n->get(897),
+ -hoverHelp=>$i18n->get('897 description'),
);
$f->submit;
return _submenu($f->print,'468','user profile category add/edit','WebGUIProfile');
@@ -139,6 +141,7 @@ sub www_editProfileCategorySave {
sub www_editProfileField {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
+ my $i18n = WebGUI::International->new($session,"WebGUIProfile");
my $f = WebGUI::HTMLForm->new($session);
$f->hidden(
-name => "op",
@@ -152,8 +155,8 @@ sub www_editProfileField {
);
$f->readOnly(
-value => $session->form->process("fid"),
- -label => WebGUI::International::get(475,"WebGUIProfile"),
- -hoverHelp => WebGUI::International::get('475 description',"WebGUIProfile"),
+ -label => $i18n->get(475),
+ -hoverHelp => $i18n->get('475 description'),
);
$data = WebGUI::ProfileField->new($session->form->process("fid"))->get;
} else {
@@ -163,38 +166,38 @@ sub www_editProfileField {
);
$f->text(
-name => "fid",
- -label => WebGUI::International::get(475,"WebGUIProfile"),
- -hoverHelp => WebGUI::International::get('475 description',"WebGUIProfile"),
+ -label => $i18n->get(475),
+ -hoverHelp => $i18n->get('475 description'),
);
}
$f->text(
-name => "label",
- -label => WebGUI::International::get(472,"WebGUIProfile"),
- -hoverHelp => WebGUI::International::get('472 description',"WebGUIProfile"),
+ -label => $i18n->get(472),
+ -hoverHelp => $i18n->get('472 description'),
-value => $data->{label},
);
$f->yesNo(
-name=>"visible",
- -label=>WebGUI::International::get(473,"WebGUIProfile"),
- -hoverHelp=>WebGUI::International::get('473 description',"WebGUIProfile"),
+ -label=>$i18n->get(473),
+ -hoverHelp=>$i18n->get('473 description'),
-value=>$data->{visible}
);
$f->yesNo(
-name=>"editable",
-value=>$data->{editable},
- -label=>WebGUI::International::get(897,"WebGUIProfile"),
- -hoverHelp=>WebGUI::International::get('897 description',"WebGUIProfile"),
+ -label=>$i18n->get(897),
+ -hoverHelp=>$i18n->get('897 description'),
);
$f->yesNo(
-name=>"required",
- -label=>WebGUI::International::get(474,"WebGUIProfile"),
- -hoverHelp=>WebGUI::International::get('474 description',"WebGUIProfile"),
+ -label=>$i18n->get(474),
+ -hoverHelp=>$i18n->get('474 description'),
-value=>$data->{required}
);
my $fieldType = WebGUI::Form::FieldType->new(
-name=>"fieldType",
- -label=>WebGUI::International::get(486,"WebGUIProfile"),
- -hoverHelp=>WebGUI::International::get('486 description',"WebGUIProfile"),
+ -label=>$i18n->get(486),
+ -hoverHelp=>$i18n->get('486 description'),
-value=>ucfirst $data->{fieldType},
-defaultValue=>"Text",
);
@@ -211,14 +214,14 @@ sub www_editProfileField {
$f->raw($fieldType->toHtmlWithWrapper());
$f->textarea(
-name => "possibleValues",
- -label => WebGUI::International::get(487,"WebGUIProfile"),
- -hoverHelp => WebGUI::International::get('487 description',"WebGUIProfile"),
+ -label => $i18n->get(487),
+ -hoverHelp => $i18n->get('487 description'),
-value => $data->{possibleValues},
);
$f->textarea(
-name => "dataDefault",
- -label => WebGUI::International::get(488,"WebGUIProfile"),
- -hoverHelp => WebGUI::International::get('488 description',"WebGUIProfile"),
+ -label => $i18n->get(488),
+ -hoverHelp => $i18n->get('488 description'),
-value => $data->{dataDefault},
);
my %hash;
@@ -228,8 +231,8 @@ sub www_editProfileField {
$f->selectBox(
-name=>"profileCategoryId",
-options=>\%hash,
- -label=>WebGUI::International::get(489,"WebGUIProfile"),
- -hoverHelp=>WebGUI::International::get('489 description',"WebGUIProfile"),
+ -label=>$i18n->get(489),
+ -hoverHelp=>$i18n->get('489 description'),
-value=>$data->{profileCategoryId}
);
$f->submit;
@@ -265,9 +268,10 @@ sub www_editProfileFieldSave {
sub www_editProfileSettings {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
+ my $i18n = WebGUI::International->new($session,"WebGUIProfile");
my $output = "";
foreach my $category (@{WebGUI::ProfileCategory->getCategories}) {
- $output .= $session->icon->delete('op=deleteProfileCategoryConfirm;cid='.$category->getId,'',WebGUI::International::get(466,"WebGUIProfile"));
+ $output .= $session->icon->delete('op=deleteProfileCategoryConfirm;cid='.$category->getId,'',$i18n->get(466));
$output .= $session->icon->edit('op=editProfileCategory;cid='.$category->getId);
$output .= $session->icon->moveUp('op=moveProfileCategoryUp;cid='.$category->getId);
$output .= $session->icon->moveDown('op=moveProfileCategoryDown;cid='.$category->getId);
@@ -275,7 +279,7 @@ sub www_editProfileSettings {
foreach my $field (@{$category->getFields}) {
next if $field->getId =~ /contentPositions/;
$output .= ' ';
- $output .= $session->icon->delete('op=deleteProfileFieldConfirm;fid='.$field->getId,'',WebGUI::International::get(467,"WebGUIProfile"));
+ $output .= $session->icon->delete('op=deleteProfileFieldConfirm;fid='.$field->getId,'',$i18n->get(467));
$output .= $session->icon->edit('op=editProfileField;fid='.$field->getId);
$output .= $session->icon->moveUp('op=moveProfileFieldUp;fid='.$field->getId);
$output .= $session->icon->moveDown('op=moveProfileFieldDown;fid='.$field->getId);
diff --git a/lib/WebGUI/Operation/Replacements.pm b/lib/WebGUI/Operation/Replacements.pm
index 4dff7702e..18cc28054 100644
--- a/lib/WebGUI/Operation/Replacements.pm
+++ b/lib/WebGUI/Operation/Replacements.pm
@@ -25,14 +25,15 @@ sub _submenu {
my $session = shift;
my $workarea = shift;
my $title = shift;
- $title = WebGUI::International::get($title) if ($title);
+ my $i18n = WebGUI::International->new($session);
+ $title = $i18n->get($title) if ($title);
my $help = shift;
my $ac = WebGUI::AdminConsole->new($session,"contentFilters");
if ($help) {
$ac->setHelp($help);
}
- $ac->addSubmenuItem($session->url->page("op=editReplacement;replacementId=new"), WebGUI::International::get(1047));
- $ac->addSubmenuItem($session->url->page("op=listReplacements"), WebGUI::International::get("content filters"));
+ $ac->addSubmenuItem($session->url->page("op=editReplacement;replacementId=new"), $i18n->get(1047));
+ $ac->addSubmenuItem($session->url->page("op=listReplacements"), $i18n->get("content filters"));
return $ac->render($workarea, $title);
}
@@ -50,6 +51,7 @@ sub www_editReplacement {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
my $data = $session->db->getRow("replacements","replacementId",$session->form->process("replacementId"));
+ my $i18n = WebGUI::International->new($session);
my $f = WebGUI::HTMLForm->new($session);
$f->hidden(
-name=>"op",
@@ -60,18 +62,18 @@ sub www_editReplacement {
-value=>$session->form->process("replacementId")
);
$f->readOnly(
- -label=>WebGUI::International::get(1049),
+ -label=>$i18n->get(1049),
-value=>$session->form->process("replacementId")
);
$f->text(
-name=>"searchFor",
- -label=>WebGUI::International::get(1050),
- -hoverHelp=>WebGUI::International::get('1050 description'),
+ -label=>$i18n->get(1050),
+ -hoverHelp=>$i18n->get('1050 description'),
-value=>$data->{searchFor}
);
$f->textarea(
- -label=>WebGUI::International::get(1051),
- -hoverHelp=>WebGUI::International::get('1051 description'),
+ -label=>$i18n->get(1051),
+ -hoverHelp=>$i18n->get('1051 description'),
-name=>"replaceWith",
-value=>$data->{replaceWith}
);
@@ -95,8 +97,9 @@ sub www_editReplacementSave {
sub www_listReplacements {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
+ my $i18n = WebGUI::International->new($session);
my $output = '';
- $output .= ' ';
+ $output .= ' ';
my $sth = $session->db->read("select replacementId,searchFor,replaceWith from replacements order by searchFor");
while (my $data = $sth->hashRef) {
$output .= ''.$session->icon->delete("op=deleteReplacement;replacementId=".$data->{replacementId})
diff --git a/lib/WebGUI/Operation/Settings.pm b/lib/WebGUI/Operation/Settings.pm
index 7d9c5fb56..db73ef781 100644
--- a/lib/WebGUI/Operation/Settings.pm
+++ b/lib/WebGUI/Operation/Settings.pm
@@ -29,7 +29,7 @@ use WebGUI::URL;
sub www_editSettings {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
- my $i18n = WebGUI::International->new("WebGUI");
+ my $i18n = WebGUI::International->new($session, "WebGUI");
my %tabs;
tie %tabs, 'Tie::IxHash';
%tabs = (
@@ -109,7 +109,7 @@ sub www_editSettings {
);
$tabform->getTab("content")->yesNo(
-name=>"autoCommit",
- -label=>WebGUI::International::get("enable autocommit of asset versioning","Asset"),
+ -label=>$i18n->get("enable autocommit of asset versioning","Asset"),
-value=>$session->setting->get("autoCommit")
);
$tabform->getTab("content")->yesNo(
diff --git a/lib/WebGUI/Operation/Shared.pm b/lib/WebGUI/Operation/Shared.pm
index a209b7850..503a205ce 100644
--- a/lib/WebGUI/Operation/Shared.pm
+++ b/lib/WebGUI/Operation/Shared.pm
@@ -26,46 +26,47 @@ our @EXPORT = qw(&menuWrapper);
#-------------------------------------------------------------------
sub accountOptions {
my $session = shift;
+ my $i18n = WebGUI::International->new($session);
my @array;
if ($session->user->isInGroup(12)) {
my %hash;
if ($session->var->get("adminOn")) {
- $hash{'options.display'} .= ''.WebGUI::International::get(12).' ';
+ $hash{'options.display'} .= ''.$i18n->get(12).' ';
} else {
- $hash{'options.display'} .= ''.WebGUI::International::get(63).' ';
+ $hash{'options.display'} .= ''.$i18n->get(63).' ';
}
push(@array,\%hash);
}
unless ($session->form->process("op") eq "displayAccount"){
my %hash;
- $hash{'options.display'} = ''.WebGUI::International::get(342).' ';
+ $hash{'options.display'} = ''.$i18n->get(342).' ';
push(@array,\%hash);
}
unless ($session->form->process("op") eq "editProfile"){
my %hash;
- $hash{'options.display'} = ''.WebGUI::International::get(341).' ';
+ $hash{'options.display'} = ''.$i18n->get(341).' ';
push(@array,\%hash);
}
unless ($session->form->process("op") eq "viewProfile"){
my %hash;
- $hash{'options.display'} = ''.WebGUI::International::get(343).' ';
+ $hash{'options.display'} = ''.$i18n->get(343).' ';
push(@array,\%hash);
}
unless ($session->form->process("op") eq "viewMessageLog"){
my %hash;
- $hash{'options.display'} = ''.WebGUI::International::get(354).' ';
+ $hash{'options.display'} = ''.$i18n->get(354).' ';
push(@array,\%hash);
}
unless ($session->form->process("op") eq "redeemSubscriptionCode") {
- push(@array, {'options.display' => ''.WebGUI::International::get('redeem code', 'Subscription').' '});
+ push(@array, {'options.display' => ''.$i18n->get('redeem code', 'Subscription').' '});
}
my %logout;
- $logout{'options.display'} = ''.WebGUI::International::get(64).' ';
+ $logout{'options.display'} = ''.$i18n->get(64).' ';
push(@array,\%logout);
if ($session->setting->get("selfDeactivation") && !$session->user->isInGroup(3)){
my %hash;
- $hash{'options.display'} = ''.WebGUI::International::get(65).' ';
+ $hash{'options.display'} = ''.$i18n->get(65).' ';
push(@array,\%hash);
}
return \@array;
@@ -75,6 +76,7 @@ our @EXPORT = qw(&menuWrapper);
sub menuWrapper {
my $session = shift;
my ($output, $key);
+ my $i18n = WebGUI::International->new($session);
$session{page}{useAdminStyle} = 1;
$output = '';
return $output;
}
@@ -95,9 +97,10 @@ sub secureEval {
my $code = shift;
# Handle WebGUI function calls
+ my $i18n = WebGUI::International->new($session);
my %trusted = (
- 'WebGUI::International::get' => sub {WebGUI::International::get(@_)},
- 'WebGUI::International::getLanguages' => sub { WebGUI::International::getLanguages(@_) },
+ 'WebGUI::International::get' => sub {$i18n->get(@_)},
+ 'WebGUI::International::getLanguages' => sub { $i18n->getLanguages(@_) },
'$session->datetime->epochToHuman' => sub { $session->datetime->epochToHuman(@_) },
'WebGUI::Icon::getToolbarOptions' => sub { WebGUI::Icon::getToolbarOptions(@_) },
);
diff --git a/lib/WebGUI/Operation/Statistics.pm b/lib/WebGUI/Operation/Statistics.pm
index 86e6aff8d..22fac3ea2 100644
--- a/lib/WebGUI/Operation/Statistics.pm
+++ b/lib/WebGUI/Operation/Statistics.pm
@@ -24,10 +24,11 @@ sub _submenu {
my $session = shift;
my $workarea = shift;
my $title = shift;
- $title = WebGUI::International::get($title) if ($title);
+ my $i18n = WebGUI::International->new($session);
+ $title = $i18n->get($title) if ($title);
my $ac = WebGUI::AdminConsole->new($session,"statistics");
if ($session->setting->get("trackPageStatistics")) {
- $ac->addSubmenuItem( $session->url->page('op=viewStatistics'), WebGUI::International::get(144));
+ $ac->addSubmenuItem( $session->url->page('op=viewStatistics'), $i18n->get(144));
}
return $ac->render($workarea, $title);
}
@@ -38,6 +39,7 @@ sub www_viewStatistics {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
my ($output, $data);
+ my $i18n = WebGUI::International->new($session);
my $url = "http://www.plainblack.com/downloads/latest-version.txt";
my $cache = WebGUI::Cache->new($session,$url,"URL");
my $version = $cache->get;
@@ -46,25 +48,25 @@ sub www_viewStatistics {
}
chomp $version;
$output .= '';
- $output .= ''.$WebGUI::VERSION.'-'.$WebGUI::STATUS.' ';
+ $output .= ''.$WebGUI::VERSION.'-'.$WebGUI::STATUS.' ';
if ($version ne $WebGUI::VERSION) {
my @rev = split(/\./,$version);
$version = ''.$version.' ';
}
- $output .= ''.$version.' ';
+ $output .= ''.$version.' ';
($data) = $session->db->quickArray("select count(*) from asset where state='published'");
- $output .= ''.$data.' ';
+ $output .= ''.$data.' ';
($data) = $session->db->quickArray("select count(distinct assetId) from assetData where isPackage=1");
- $output .= ''.$data.' ';
+ $output .= ''.$data.' ';
($data) = $session->db->quickArray("select count(*) from template");
- $output .= ''.$data.' ';
+ $output .= ''.$data.' ';
($data) = $session->db->quickArray("select count(*) from userSession");
- $output .= ''.$data.' ';
+ $output .= ''.$data.' ';
($data) = $session->db->quickArray("select count(*) from users");
- $output .= ''.$data.' ';
+ $output .= ''.$data.' ';
($data) = $session->db->quickArray("select count(*) from groups");
- $output .= ''.$data.' ';
+ $output .= ''.$data.' ';
$output .= '
';
return _submenu($output);
}
diff --git a/lib/WebGUI/Operation/Subscription.pm b/lib/WebGUI/Operation/Subscription.pm
index 558a12577..e8b88e24c 100644
--- a/lib/WebGUI/Operation/Subscription.pm
+++ b/lib/WebGUI/Operation/Subscription.pm
@@ -34,7 +34,7 @@ sub _generateCode {
#-------------------------------------------------------------------
sub _submenu {
my $session = shift;
- my $i18n = WebGUI::International->new("Subscription");
+ my $i18n = WebGUI::International->new($session, "Subscription");
my $workarea = shift;
my $title = shift;
@@ -59,7 +59,7 @@ sub www_createSubscriptionCodeBatch {
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
$error = shift;
- my $i18n = WebGUI::International->new("Subscription");
+ my $i18n = WebGUI::International->new($session, "Subscription");
$errorMessage = $i18n->get('create batch error').'' if ($error);
@@ -117,7 +117,7 @@ sub www_createSubscriptionCodeBatchSave {
@error, $creationEpoch);
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
- my $i18n = WebGUI::International->new("Subscription");
+ my $i18n = WebGUI::International->new($session, "Subscription");
$numberOfCodes = $session->form->process("noc");
$description = $session->form->process("description");
@@ -193,7 +193,7 @@ sub www_editSubscription {
my ($properties, $subscriptionId, $durationInterval, $durationUnits, $f);
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
- my $i18n = WebGUI::International->new("Subscription");
+ my $i18n = WebGUI::International->new($session, "Subscription");
unless ($session->form->process("sid") eq 'new') {
$properties = WebGUI::Subscription->new($session->form->process("sid"))->get;
@@ -282,7 +282,7 @@ sub www_listSubscriptionCodeBatches {
my ($p, $batches, $output);
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
- my $i18n = WebGUI::International->new("Subscription");
+ my $i18n = WebGUI::International->new($session, "Subscription");
$p = WebGUI::Paginator->new($session,$session->url->page('op=listSubscriptionCodeBatches'));
$p->setDataByQuery("select * from subscriptionCodeBatch");
@@ -312,7 +312,7 @@ sub www_listSubscriptionCodes {
my ($p, $codes, $output, $where, $ops, $delete);
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
- my $i18n = WebGUI::International->new("Subscription");
+ my $i18n = WebGUI::International->new($session, "Subscription");
my $dcStart = $session->form->date('dcStart');
my $dcStop = $session->datetime->addToTime($session->form->date('dcStop'),23,59);
@@ -394,7 +394,7 @@ sub www_listSubscriptions {
my ($p, $subscriptions, $output);
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
- my $i18n = WebGUI::International->new("Subscription");
+ my $i18n = WebGUI::International->new($session, "Subscription");
$p = WebGUI::Paginator->new($session,$session->url->page('op=listSubscriptions'));
$p->setDataByQuery('select subscriptionId, name from subscription where deleted != 1');
@@ -429,7 +429,7 @@ sub www_purchaseSubscription {
sub www_redeemSubscriptionCode {
my $session = shift;
my (%codeProperties, @subscriptions, %var, $f);
- my $i18n = WebGUI::International->new("Subscription");
+ my $i18n = WebGUI::International->new($session, "Subscription");
if ($session->form->process("code")) {
%codeProperties = $session->db->quickHash("select * from subscriptionCode as t1, subscriptionCodeBatch as t2 where ".
diff --git a/lib/WebGUI/Operation/TransactionLog.pm b/lib/WebGUI/Operation/TransactionLog.pm
index fbcbe524f..11a4f9951 100644
--- a/lib/WebGUI/Operation/TransactionLog.pm
+++ b/lib/WebGUI/Operation/TransactionLog.pm
@@ -70,7 +70,7 @@ sub www_cancelRecurringTransaction {
my $session = shift;
my ($transaction, $error, $message);
- my $i18n = WebGUI::International->new("TransactionLog");
+ my $i18n = WebGUI::International->new($session, "TransactionLog");
$transaction = WebGUI::Commerce::Transaction->new($session->form->process("tid"));
if ($transaction->isRecurring) {
diff --git a/lib/WebGUI/Operation/User.pm b/lib/WebGUI/Operation/User.pm
index 23e6d00e6..4582e66b2 100644
--- a/lib/WebGUI/Operation/User.pm
+++ b/lib/WebGUI/Operation/User.pm
@@ -67,26 +67,27 @@ sub _submenu {
my $session = shift;
my $workarea = shift;
my $title = shift;
- $title = WebGUI::International::get($title) if ($title);
+ my $i18n = WebGUI::International->new($session);
+ $title = $i18n->get($title) if ($title);
my $help = shift;
my $ac = WebGUI::AdminConsole->new($session,"users");
if ($help) {
$ac->setHelp($help);
}
if ($session->user->isInGroup(11)) {
- $ac->addSubmenuItem($session->url->page("op=editUser;uid=new"), WebGUI::International::get(169));
+ $ac->addSubmenuItem($session->url->page("op=editUser;uid=new"), $i18n->get(169));
}
if ($session->user->isInGroup(3)) {
unless ($session->form->process("op") eq "listUsers"
|| $session->form->process("op") eq "deleteUserConfirm") {
- $ac->addSubmenuItem($session->url->page("op=editUser;uid=".$session->form->process("uid")), WebGUI::International::get(457));
- $ac->addSubmenuItem($session->url->page('op=becomeUser;uid='.$session->form->process("uid")), WebGUI::International::get(751));
- $ac->addSubmenuItem($session->url->page('op=deleteUser;uid='.$session->form->process("uid")), WebGUI::International::get(750));
+ $ac->addSubmenuItem($session->url->page("op=editUser;uid=".$session->form->process("uid")), $i18n->get(457));
+ $ac->addSubmenuItem($session->url->page('op=becomeUser;uid='.$session->form->process("uid")), $i18n->get(751));
+ $ac->addSubmenuItem($session->url->page('op=deleteUser;uid='.$session->form->process("uid")), $i18n->get(750));
if ($session->setting->get("useKarma")) {
- $ac->addSubmenuItem($session->url->page("op=editUserKarma;uid=".$session->form->process("uid")), WebGUI::International::get(555));
+ $ac->addSubmenuItem($session->url->page("op=editUserKarma;uid=".$session->form->process("uid")), $i18n->get(555));
}
}
- $ac->addSubmenuItem($session->url->page("op=listUsers"), WebGUI::International::get(456));
+ $ac->addSubmenuItem($session->url->page("op=listUsers"), $i18n->get(456));
}
return $ac->render($workarea, $title);
}
@@ -170,6 +171,7 @@ sub getUserSearchForm {
$session->scratch->set("userSearchKeyword",$session->form->process("keyword"));
$session->scratch->set("userSearchStatus",$session->form->process("status"));
$session->scratch->set("userSearchModifier",$session->form->process("modifier"));
+ my $i18n = WebGUI::International->new($session);
my $output = ''
.WebGUI::Form::formHeader($session,)
.WebGUI::Form::hidden($session,
@@ -190,9 +192,9 @@ sub getUserSearchForm {
-name=>"modifier",
-value=>($session->scratch->get("userSearchModifier") || "contains"),
-options=>{
- startsWith=>WebGUI::International::get("starts with"),
- contains=>WebGUI::International::get("contains"),
- endsWith=>WebGUI::International::get("ends with")
+ startsWith=>$i18n->get("starts with"),
+ contains=>$i18n->get("contains"),
+ endsWith=>$i18n->get("ends with")
}
)
.WebGUI::Form::text($session,
@@ -204,13 +206,13 @@ sub getUserSearchForm {
-name => "status",
-value => ($session->scratch->get("userSearchStatus") || "users.status like '%'"),
-options=> {
- "" => WebGUI::International::get(821),
- Active => WebGUI::International::get(817),
- Deactivated => WebGUI::International::get(818),
- Selfdestructed => WebGUI::International::get(819)
+ "" => $i18n->get(821),
+ Active => $i18n->get(817),
+ Deactivated => $i18n->get(818),
+ Selfdestructed => $i18n->get(819)
}
)
- .WebGUI::Form::submit($session,value=>WebGUI::International::get(170))
+ .WebGUI::Form::submit($session,value=>$i18n->get(170))
.WebGUI::Form::formFooter($session,);
$output .= '
';
return $output;
@@ -247,14 +249,15 @@ sub www_deleteUser {
my $session = shift;
my ($output);
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
+ my $i18n = WebGUI::International->new($session);
if ($session->form->process("uid") eq '1' || $session->form->process("uid") eq '3') {
return _submenu($session->privilege->vitalComponent());
} else {
- $output .= WebGUI::International::get(167).'';
+ $output .= $i18n->get(167).'
';
$output .= '
';
+ $i18n->get(45).'';
return _submenu($output,'42',"user delete");
}
}
@@ -287,7 +290,7 @@ sub www_editUser {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(11));
my $error = shift;
- my $i18n = WebGUI::International->new("WebGUI");
+ my $i18n = WebGUI::International->new($session, "WebGUI");
my %tabs;
tie %tabs, 'Tie::IxHash';
%tabs = (
@@ -399,6 +402,7 @@ sub www_editUserSave {
$isSecondary = ($session->user->isInGroup(11) && $session->form->process("uid") eq "new");
}
return $session->privilege->adminOnly() unless ($isAdmin || $isSecondary);
+ my $i18n = WebGUI::International->new($session);
my ($uid) = $session->db->quickArray("select userId from users where username=".$session->db->quote($session->form->process("username")));
my $error;
if (($uid eq $session->form->process("uid") || $uid eq "") && $session->form->process("username") ne '') {
@@ -420,10 +424,10 @@ sub www_editUserSave {
@groups = $session->form->group("groupsToDelete");
$u->deleteFromGroups(\@groups);
} else {
- $error = ''.WebGUI::International::get(77).' '.$session->form->process("username").'Too or '.$session->form->process("username").'02 ';
+ $error = ''.$i18n->get(77).' '.$session->form->process("username").'Too or '.$session->form->process("username").'02 ';
}
if ($isSecondary) {
- return _submenu(WebGUI::International::get(978));
+ return _submenu($i18n->get(978));
} else {
return www_editUser($error);
}
@@ -434,6 +438,7 @@ sub www_editUserKarma {
my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3));
my ($output, $f, $a, %user, %data, $method, $values, $category, $label, $default, $previousCategory);
+ my $i18n = WebGUI::International->new($session);
$f = WebGUI::HTMLForm->new($session);
$f->hidden(
-name => "op",
@@ -445,13 +450,13 @@ sub www_editUserKarma {
);
$f->integer(
-name => "amount",
- -label => WebGUI::International::get(556),
- -hoverHelp => WebGUI::International::get('556 description'),
+ -label => $i18n->get(556),
+ -hoverHelp => $i18n->get('556 description'),
);
$f->text(
-name => "description",
- -label => WebGUI::International::get(557),
- -hoverHelp => WebGUI::International::get('557 description'),
+ -label => $i18n->get(557),
+ -hoverHelp => $i18n->get('557 description'),
);
$f->submit;
$output .= $f->print;
@@ -479,24 +484,25 @@ sub www_listUsers {
return $session->privilege->adminOnly();
}
my %status;
+ my $i18n = WebGUI::International->new($session);
my $output = getUserSearchForm("listUsers");
my ($userCount) = $session->db->quickArray("select count(*) from users");
return _submenu($output) unless ($session->form->process("doit") || $userCount<250 || $session->form->process("pn") > 1);
tie %status, 'Tie::IxHash';
%status = (
- Active => WebGUI::International::get(817),
- Deactivated => WebGUI::International::get(818),
- Selfdestructed => WebGUI::International::get(819)
+ Active => $i18n->get(817),
+ Deactivated => $i18n->get(818),
+ Selfdestructed => $i18n->get(819)
);
$output .= '';
$output .= '
-
-
-
-
-
-
-
+
+
+
+
+
+
+
';
my $p = doUserSearch("listUsers",1);
foreach my $data (@{$p->getPageData}) {
diff --git a/lib/WebGUI/Operation/WebGUI.pm b/lib/WebGUI/Operation/WebGUI.pm
index 35e446582..9fddc74d6 100644
--- a/lib/WebGUI/Operation/WebGUI.pm
+++ b/lib/WebGUI/Operation/WebGUI.pm
@@ -59,7 +59,7 @@ password and email address, as well as some other WebGUI settings.
sub www_setup {
my $session = shift;
return "" unless ($session->setting->get("specialState") eq "init");
- my $i18n = WebGUI::International->new("WebGUI");
+ my $i18n = WebGUI::International->new($session, "WebGUI");
my $output = '
diff --git a/lib/WebGUI/Paginator.pm b/lib/WebGUI/Paginator.pm
index 32f580539..ea979b5d5 100644
--- a/lib/WebGUI/Paginator.pm
+++ b/lib/WebGUI/Paginator.pm
@@ -216,7 +216,8 @@ Returns a link to the first page's data.
sub getFirstPageLink {
my ($text, $pn);
$pn = $_[0]->getPageNumber;
- $text = '|<'.WebGUI::International::get(404);
+ my $i18n = WebGUI::International->new($self->session);
+ $text = '|<'.$i18n->get(404);
if ($pn > 1) {
return 'session->url->append($_[0]->{_url},($_[0]->{_formVar}.'='.$_[0]->getNumberOfPages))
@@ -260,7 +262,8 @@ Returns a link to the next page's data.
sub getNextPageLink {
my ($text, $pn);
$pn = $_[0]->getPageNumber;
- $text = WebGUI::International::get(92).'»';
+ my $i18n = WebGUI::International->new($self->session);
+ $text = $i18n->get(92).'»';
if ($pn < $_[0]->getNumberOfPages) {
return ' '.$text.' ';
} else {
@@ -397,7 +400,8 @@ Returns a link to the previous page's data.
sub getPreviousPageLink {
my ($text, $pn);
$pn = $_[0]->getPageNumber;
- $text = '«'.WebGUI::International::get(91);
+ my $i18n = WebGUI::International->new($self->session);
+ $text = '«'.$i18n->get(91);
if ($pn > 1) {
return ''.$text.' ';
} else {
diff --git a/lib/WebGUI/Session/Privilege.pm b/lib/WebGUI/Session/Privilege.pm
index 5d620a0eb..cd37a84ad 100644
--- a/lib/WebGUI/Session/Privilege.pm
+++ b/lib/WebGUI/Session/Privilege.pm
@@ -56,10 +56,11 @@ Returns a message stating that this functionality can only be used by administra
sub adminOnly {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session);
$self->session->http->setStatus("401", "Admin Only");
my ($output, $sth, @data);
- $output = ''.WebGUI::International::get(35).' ';
- $output .= WebGUI::International::get(36);
+ $output = ''.$i18n->get(35).' ';
+ $output .= $i18n->get(36);
return $self->session->style->userStyle($output);
}
@@ -74,10 +75,11 @@ Returns a message stating that the user does not have the required privileges to
sub insufficient {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session);
$self->session->http->setStatus("401", "Insufficient Privileges");
my ($output);
- $output = ''.WebGUI::International::get(37).' ';
- $output .= WebGUI::International::get(38);
+ $output = ''.$i18n->get(37).' ';
+ $output .= $i18n->get(38);
$output .= '';
return $self->session->style->userStyle($output);
}
@@ -116,8 +118,9 @@ sub noAccess {
if ($self->session->user->profileField("userId") eq '1') {
return WebGUI::Operation::Auth::www_auth("init");
} else {
- my $output = '
'.WebGUI::International::get(37).' ';
- $output .= WebGUI::International::get(39);
+ my $i18n = WebGUI::International->new($self->session);
+ my $output = ''.$i18n->get(37).' ';
+ $output .= $i18n->get(39);
$output .= '';
return $self->session->style->userStyle($output);
}
@@ -133,10 +136,11 @@ Returns a message stating that the user they requested information about is no l
sub notMember {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session);
$self->session->http->setStatus("400", "Not A Member");
my ($output);
- $output = '
'.WebGUI::International::get(345).' ';
- $output .= WebGUI::International::get(346);
+ $output = ''.$i18n->get(345).' ';
+ $output .= $i18n->get(346);
$output .= '';
return $self->session->style->userStyle($output);
}
@@ -165,10 +169,11 @@ Returns a message stating that the user made a request to delete something that
sub vitalComponent {
my $self = shift;
+ my $i18n = WebGUI::International->new($self->session);
$self->session->http->setStatus("403", "Vital Component");
my ($output);
- $output = '
'.WebGUI::International::get(40).' ';
- $output .= WebGUI::International::get(41);
+ $output = ''.$i18n->get(40).' ';
+ $output .= $i18n->get(41);
$output .= '';
return $self->session->style->userStyle($output);
}
diff --git a/lib/WebGUI/Session/Url.pm b/lib/WebGUI/Session/Url.pm
index 46e075b40..849ac7223 100644
--- a/lib/WebGUI/Session/Url.pm
+++ b/lib/WebGUI/Session/Url.pm
@@ -227,7 +227,8 @@ The string to make compliant. This is usually a page title or a filename.
sub makeCompliant {
my $self = shift;
my $url = shift;
- return WebGUI::International::makeUrlCompliant($url);
+ my $i18n = WebGUI::International->new($self->session);
+ return $i18n->makeUrlCompliant($url);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/TabForm.pm b/lib/WebGUI/TabForm.pm
index fc752d976..d7aada134 100644
--- a/lib/WebGUI/TabForm.pm
+++ b/lib/WebGUI/TabForm.pm
@@ -201,8 +201,9 @@ sub new {
$tabs{$key}{label} = $startingTabs->{$key}->{label};
$tabs{$key}{uiLevel} = $startingTabs->{$key}->{uiLevel};
}
+ my $i18n = WebGU::International::get($session);
my $cancel = WebGUI::Form::button({
- value=>WebGUI::International::get('cancel'),
+ value=>$i18n->get('cancel'),
extras=>q|onclick="history.go(-1);"|
});
bless { _uiLevelOverride=>$uiLevelOverride, _cancel=>$cancel, _submit=>WebGUI::Form::submit($self->session,), _form=>WebGUI::Form::formHeader(), _hidden=>"", _tab=>\%tabs, _css=>$css }, $class;
diff --git a/lib/WebGUI/i18n/English/Asset_Matrix.pm b/lib/WebGUI/i18n/English/Asset_Matrix.pm
index d0cce6cbf..4949b07ef 100644
--- a/lib/WebGUI/i18n/English/Asset_Matrix.pm
+++ b/lib/WebGUI/i18n/English/Asset_Matrix.pm
@@ -676,7 +676,7 @@ our $I18N = {
'categories description' => {
message => q|Specify one category per line here to define the categories for this matrix. Categories are used to subdivide fields and also represent the things users can rate each listing on.|,
- lastUpdated => 1135271460,
+ lastUpdated => 1136503559,
},
'categories subtext' => {
@@ -843,19 +843,19 @@ our $I18N = {
lastUpdated => 1133758944,
},
- 'name' => {
- message => q|Name|,
- lastUpdated => 1133758944,
+ 'field name' => {
+ message => q|Field Name|,
+ lastUpdated => 1136499280,
},
- 'label' => {
- message => q|Label|,
- lastUpdated => 1133758944,
+ 'field label' => {
+ message => q|Field Label|,
+ lastUpdated => 1136499282,
},
- 'type' => {
- message => q|Type|,
- lastUpdated => 1133758944,
+ 'field type' => {
+ message => q|Field Type|,
+ lastUpdated => 1136499283,
},
'default value' => {
@@ -1052,6 +1052,66 @@ our $I18N = {
message => q|Matrix Specific Fields|
},
+ 'field add/edit help title' => {
+ lastUpdated => 1136488382,
+ message => q|Matrix Field, Add/Edit|
+ },
+
+ 'field add/edit help body' => {
+ lastUpdated => 1135279558,
+ message => q|In this form, you may add a field to the Matrix. This will define a new feature or performance criterion that will be used to rate all products in the Matrix. This is very similar to adding fields to a DataForm Asset.|
+ },
+
+ 'field name description' => {
+ lastUpdated => 1135279558,
+ message => q|The name of the field that you are creating. It is case sensitive and must be unique.|
+ },
+
+ 'field label description' => {
+ lastUpdated => 1135279558,
+ message => q|The name of the field that you are creating. It is case sensitive and must be unique.|
+ },
+
+ 'field type description' => {
+ lastUpdated => 1135279558,
+ message => q|
The type of field you are creating. Please select the type from the following options in the drop-down list.
+
+ Good Bad
+ Defines availability of a feature, has it, doesn't have it, limited functionality, free add on, etc.
+ Text
+ A single line of text, like a short description or title.
+ TextaArea
+ Multiple lines of text.
+ URL
+ A URL.
+ Combo
+ A combination Text box and drop down list.
+ |
+ },
+
+ 'field description' => {
+ lastUpdated => 1135279558,
+ message => q|Field Description|
+ },
+
+ 'field description description' => {
+ lastUpdated => 1135279558,
+ message => q|Please give a general description of the field.|
+ },
+
+ 'default value description' => {
+ translatorsNote => q|Please do not translate the GoodBad field values, as described below|,
+ lastUpdated => 1135279558,
+ message => q|Enter in a default value for the field that will be used if the user leaves the field blank.
+ For the GoodBad field, the possible values are "No", "Yes", "Free Add On", "Costs Extra", "Limited". While the displayed labels are internationalized, these values are not.
+ For the Combo field, you may only enter in 1 value, but the user will be allowed to select any value entered in by other users. In other words, the drop-down list will contain all values entered in by users who enter unique data into this field.|
+ },
+
+ 'category description' => {
+ lastUpdated => 1136503500,
+ message => q|Select the category which this field falls into.|
+ },
+
};
1;
diff --git a/lib/WebGUI/i18n/English/Automated_Information.pm b/lib/WebGUI/i18n/English/Automated_Information.pm
index 18e691107..6eb01228b 100644
--- a/lib/WebGUI/i18n/English/Automated_Information.pm
+++ b/lib/WebGUI/i18n/English/Automated_Information.pm
@@ -5,6 +5,7 @@ package WebGUI::i18n::English::Automated_Information;
use WebGUI::Session;
use WebGUI::International;
+my $i18n = WebGUI::International->new($session, 'Macros');
##Get list of all macros by namespace/module name
my $dir = join '/', $self->session->config->getWebguiRoot,"lib","WebGUI","Macro";
@@ -17,7 +18,7 @@ closedir(DIR);
##Build list of enabled macros, by namespace by reversing session hash:
my %macros = reverse %{ $self->session->config->get("macros") };
-$macro_table =
+my $macro_table =
join "\n",
map { join '', '
', $_, ' ',
($macros{$_} ? ('^', $macros{$_}, '();') : ' '),
@@ -27,9 +28,9 @@ $macro_table =
$macro_table =
join("\n",
'',
- '',WebGUI::International::get('macro name', 'Macros'),
+ ' ',$i18n->get('macro name'),
' ',
- WebGUI::International::get('macro shortcut', 'Macros'),
+ $i18n->get('macro shortcut'),
' ',$macro_table,'
');
our $I18N = {