new i18n api requiring $session
This commit is contained in:
parent
877bf082a0
commit
01d95a265e
141 changed files with 2266 additions and 1745 deletions
|
|
@ -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 .= '<table border="1" cellpadding="5" cellspacing="0" align="center">';
|
||||
$output .= '<tr class="tableHeader"><td>'.WebGUI::International::get(428).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(435).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(432).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(430).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(431).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(436).'</td></tr>';
|
||||
$output .= '<tr class="tableHeader"><td>'.$i18n->get(428).'</td>';
|
||||
$output .= '<td>'.$i18n->get(435).'</td>';
|
||||
$output .= '<td>'.$i18n->get(432).'</td>';
|
||||
$output .= '<td>'.$i18n->get(430).'</td>';
|
||||
$output .= '<td>'.$i18n->get(431).'</td>';
|
||||
$output .= '<td>'.$i18n->get(436).'</td></tr>';
|
||||
$output .= $p->getPage($session->form->process("pn"));
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional($session->form->process("pn"));
|
||||
|
|
|
|||
|
|
@ -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 .= '<table>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get('cache type').':</td><td class="tableData">'.ref($cache).'</td></tr>';
|
||||
$output .= '<tr><td align="right" valign="top" class="tableHeader">'.WebGUI::International::get('cache statistics').':</td><td class="tableData"><pre>'.$cache->stats.'</pre></td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get('cache type').':</td><td class="tableData">'.ref($cache).'</td></tr>';
|
||||
$output .= '<tr><td align="right" valign="top" class="tableHeader">'.$i18n->get('cache statistics').':</td><td class="tableData"><pre>'.$cache->stats.'</pre></td></tr>';
|
||||
$output .= '<tr><td align="right" valign="top" class="tableHeader"> </td><td class="tableData">'.
|
||||
WebGUI::Form::button({
|
||||
value=>WebGUI::International::get("clear cache"),
|
||||
value=>$i18n->get("clear cache"),
|
||||
extras=>qq{onclick="document.location.href='$flushURL';"},
|
||||
}).
|
||||
'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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).'<p>';
|
||||
$output .= $i18n->get(988).'<p>';
|
||||
$output .= '<p><div align="center"><a href="'.
|
||||
$session->url->page('op=deleteDatabaseLinkConfirm;dlid='.$session->form->process("dlid"))
|
||||
.'">'.WebGUI::International::get(44).'</a>';
|
||||
.'">'.$i18n->get(44).'</a>';
|
||||
$output .= ' <a href="'.$session->url->page('op=listDatabaseLinks').
|
||||
'">'.WebGUI::International::get(45).'</a></div>';
|
||||
'">'.$i18n->get(45).'</a></div>';
|
||||
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 = '<table border="1" cellpadding="3" cellspacing="0" align="center">';
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
foreach my $id (keys %{$links}) {
|
||||
$output .= '<tr><td valign="top" class="tableData"></td><td valign="top" class="tableData">'.WebGUI::International::get(1076).'</td></tr>';
|
||||
$output .= '<tr><td valign="top" class="tableData"></td><td valign="top" class="tableData">'.$i18n->get(1076).'</td></tr>';
|
||||
$output = '<tr><td valign="top" class="tableData">'
|
||||
.$session->icon->delete('op=deleteDatabaseLink;dlid='.$id)
|
||||
.$session->icon->edit('op=editDatabaseLink;dlid='.$id)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 = '<div align="center">';
|
||||
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 .= '</div>';
|
||||
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).'<p>';
|
||||
$output .= $i18n->get(86).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session->url->page('op=deleteGroupConfirm;gid='.$session->form->process("gid")).
|
||||
'">'.WebGUI::International::get(44).'</a>';
|
||||
'">'.$i18n->get(44).'</a>';
|
||||
$output .= ' <a href="'.$session->url->page('op=listGroups').'">'
|
||||
.WebGUI::International::get(45).'</a></div>';
|
||||
.$i18n->get(45).'</a></div>';
|
||||
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 .= '<table border="1" cellpadding="5" cellspacing="0" align="center">';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(84).'</td><td class="tableHeader">'
|
||||
.WebGUI::International::get(85).'</td><td class="tableHeader">'
|
||||
.WebGUI::International::get(748).'</td></tr>';
|
||||
$output .= '<tr><td class="tableHeader">'.$i18n->get(84).'</td><td class="tableHeader">'
|
||||
.$i18n->get(85).'</td><td class="tableHeader">'
|
||||
.$i18n->get(748).'</td></tr>';
|
||||
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 .= '<table border="1" cellpadding="5" cellspacing="0" align="center">';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(84).'</td><td class="tableHeader">'
|
||||
.WebGUI::International::get(85).'</td><td class="tableHeader">'
|
||||
.WebGUI::International::get(748).'</td></tr>';
|
||||
$output .= '<tr><td class="tableHeader">'.$i18n->get(84).'</td><td class="tableHeader">'
|
||||
.$i18n->get(85).'</td><td class="tableHeader">'
|
||||
.$i18n->get(748).'</td></tr>';
|
||||
$output .= $p->getPage($session->form->process("pn"));
|
||||
$output .= '</table>';
|
||||
$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 .= '<table border="1" cellpadding="2" cellspacing="0"><tr><td class="tableHeader"><input type="image" src="'
|
||||
.WebGUI::Icon::_getBaseURL().'delete.gif" border="0"></td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(50).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(369).'</td></tr>';
|
||||
<td class="tableHeader">'.$i18n->get(50).'</td>
|
||||
<td class="tableHeader">'.$i18n->get(369).'</td></tr>';
|
||||
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 .= '</table>'.WebGUI::Form::formFooter($session,);
|
||||
$output .= $p->getBarTraditional;
|
||||
$output .= '<p><h1>'.WebGUI::International::get(976).'</h1>';
|
||||
$output .= '<p><h1>'.$i18n->get(976).'</h1>';
|
||||
$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
|
||||
|
|
|
|||
|
|
@ -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 .= '</td></tr></table>';
|
||||
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 .= '</td></tr></table>';
|
||||
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 .= '<p><a href="'._link($id,$namespace).'">'.WebGUI::International::get($help->{$id}{title},$namespace).'</a></p>';
|
||||
$output .= '<p><a href="'._link($id,$namespace).'">'.$i18n->get($help->{$id}{title},$namespace).'</a></p>';
|
||||
}
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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] = '<tr><td valign="top" class="tableData"> </td><td valign="top" class="tableData">'.WebGUI::International::get("LDAPLink_1076","AuthLDAP").'</td><td>'.WebGUI::International::get("LDAPLink_1077","AuthLDAP").'</td></tr>';
|
||||
$row[$i] = '<tr><td valign="top" class="tableData"> </td><td valign="top" class="tableData">'.$i18n->get("LDAPLink_1076").'</td><td>'.$i18n->get("LDAPLink_1077").'</td></tr>';
|
||||
$i++;
|
||||
while ($data = $sth->hashRef) {
|
||||
$row[$i] = '<tr><td valign="top" class="tableData">'
|
||||
.$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)
|
||||
.'</td>';
|
||||
$row[$i] .= '<td valign="top" class="tableData">'.$data->{ldapLinkName}.'</td>';
|
||||
|
||||
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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>';
|
||||
$row[$i] .= '<td>'.$data{status}.'</td>';
|
||||
$row[$i] .= '<td>'$session->datetime->epochToHuman($data{timeStamp},"%H:%n%p %M/%D/%y").'</td>';
|
||||
|
|
@ -56,11 +57,11 @@ sub www_viewLoginHistory {
|
|||
$p = WebGUI::Paginator->new($session,$session->url->page('op=viewLoginHistory'));
|
||||
$p->setDataByArrayRef(\@row);
|
||||
$output .= '<table border="1" cellpadding="5" cellspacing="0" align="center">';
|
||||
$output .= '<tr class="tableHeader"><td>'.WebGUI::International::get(428).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(434).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(429).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(431).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(433).'</td></tr>';
|
||||
$output .= '<tr class="tableHeader"><td>'.$i18n->get(428).'</td>';
|
||||
$output .= '<td>'.$i18n->get(434).'</td>';
|
||||
$output .= '<td>'.$i18n->get(429).'</td>';
|
||||
$output .= '<td>'.$i18n->get(431).'</td>';
|
||||
$output .= '<td>'.$i18n->get(433).'</td></tr>';
|
||||
$output .= $p->getPage($session->form->process("pn"));
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBar($session->form->process("pn"));
|
||||
|
|
|
|||
|
|
@ -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} = '<h1>'.WebGUI::International::get(159).'</h1>';
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
$vars->{displayTitle} = '<h1>'.$i18n->get(159).'</h1>';
|
||||
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} = '<h1>'.WebGUI::International::get(159).'</h1>';
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
$vars->{displayTitle} = '<h1>'.$i18n->get(159).'</h1>';
|
||||
|
||||
$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 = '<a href="'.$session->url->append($data->{url},'mlog='.$data->{messageLogId}).'">'.$status.'</a>';
|
||||
$vars->{'message.takeAction'} = '<a href="'.$session->url->append($data->{url},'mlog='.$data->{messageLogId}).'">'.WebGUI::International::get(554).'</a>'
|
||||
$vars->{'message.takeAction'} = '<a href="'.$session->url->append($data->{url},'mlog='.$data->{messageLogId}).'">'.$i18n->get(554).'</a>'
|
||||
}
|
||||
$vars->{'message.status'} = $status;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 .= '<li>'.$field->getLabel.' '.WebGUI::International::get(451).'</li>';
|
||||
$error .= '<li>'.$field->getLabel.' '.$i18n->get(451).'</li>';
|
||||
} elsif ($field->getId eq "email" && isDuplicateEmail($data{$field->getId})) {
|
||||
$warning .= '<li>'.WebGUI::International::get(1072).'</li>';
|
||||
$warning .= '<li>'.$i18n->get(1072).'</li>';
|
||||
}
|
||||
}
|
||||
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} .= '<h1>'.WebGUI::International::get(338).'</h1>';
|
||||
$vars->{displayTitle} .= '<h1>'.$i18n->get(338).'</h1>';
|
||||
$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} = '<h1>'.WebGUI::International::get(347).' '.$u->username.'</h1>';
|
||||
$vars->{displayTitle} = '<h1>'.$i18n->get(347).' '.$u->username.'</h1>';
|
||||
|
||||
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 = ();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 = '<table>';
|
||||
$output .= '<tr><td></td><td class="tableHeader">'.WebGUI::International::get(1050).'</td><td class="tableHeader">'.WebGUI::International::get(1051).'</td></tr>';
|
||||
$output .= '<tr><td></td><td class="tableHeader">'.$i18n->get(1050).'</td><td class="tableHeader">'.$i18n->get(1051).'</td></tr>';
|
||||
my $sth = $session->db->read("select replacementId,searchFor,replaceWith from replacements order by searchFor");
|
||||
while (my $data = $sth->hashRef) {
|
||||
$output .= '<tr><td>'.$session->icon->delete("op=deleteReplacement;replacementId=".$data->{replacementId})
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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'} .= '<a href="'.$session->url->page('op=switchOffAdmin').'">'.WebGUI::International::get(12).'</a>';
|
||||
$hash{'options.display'} .= '<a href="'.$session->url->page('op=switchOffAdmin').'">'.$i18n->get(12).'</a>';
|
||||
} else {
|
||||
$hash{'options.display'} .= '<a href="'.$session->url->page('op=switchOnAdmin').'">'.WebGUI::International::get(63).'</a>';
|
||||
$hash{'options.display'} .= '<a href="'.$session->url->page('op=switchOnAdmin').'">'.$i18n->get(63).'</a>';
|
||||
}
|
||||
push(@array,\%hash);
|
||||
}
|
||||
unless ($session->form->process("op") eq "displayAccount"){
|
||||
my %hash;
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=auth;method=init').'">'.WebGUI::International::get(342).'</a>';
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=auth;method=init').'">'.$i18n->get(342).'</a>';
|
||||
push(@array,\%hash);
|
||||
}
|
||||
unless ($session->form->process("op") eq "editProfile"){
|
||||
my %hash;
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=editProfile').'">'.WebGUI::International::get(341).'</a>';
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=editProfile').'">'.$i18n->get(341).'</a>';
|
||||
push(@array,\%hash);
|
||||
}
|
||||
unless ($session->form->process("op") eq "viewProfile"){
|
||||
my %hash;
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=viewProfile;uid='.$session->user->profileField("userId")).'">'.WebGUI::International::get(343).'</a>';
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=viewProfile;uid='.$session->user->profileField("userId")).'">'.$i18n->get(343).'</a>';
|
||||
push(@array,\%hash);
|
||||
}
|
||||
unless ($session->form->process("op") eq "viewMessageLog"){
|
||||
my %hash;
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=viewMessageLog').'">'.WebGUI::International::get(354).'</a>';
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=viewMessageLog').'">'.$i18n->get(354).'</a>';
|
||||
push(@array,\%hash);
|
||||
}
|
||||
unless ($session->form->process("op") eq "redeemSubscriptionCode") {
|
||||
push(@array, {'options.display' => '<a href="'.$session->url->page('op=redeemSubscriptionCode').'">'.WebGUI::International::get('redeem code', 'Subscription').'</a>'});
|
||||
push(@array, {'options.display' => '<a href="'.$session->url->page('op=redeemSubscriptionCode').'">'.$i18n->get('redeem code', 'Subscription').'</a>'});
|
||||
}
|
||||
|
||||
my %logout;
|
||||
$logout{'options.display'} = '<a href="'.$session->url->page('op=auth;method=logout').'">'.WebGUI::International::get(64).'</a>';
|
||||
$logout{'options.display'} = '<a href="'.$session->url->page('op=auth;method=logout').'">'.$i18n->get(64).'</a>';
|
||||
push(@array,\%logout);
|
||||
if ($session->setting->get("selfDeactivation") && !$session->user->isInGroup(3)){
|
||||
my %hash;
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=auth;method=deactivateAccount').'">'.WebGUI::International::get(65).'</a>';
|
||||
$hash{'options.display'} = '<a href="'.$session->url->page('op=auth;method=deactivateAccount').'">'.$i18n->get(65).'</a>';
|
||||
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 = '<table width="100%" border="0" cellpadding="5" cellspacing="0">
|
||||
<tr><td width="70%" class="tableData" valign="top">';
|
||||
|
|
@ -83,7 +85,7 @@ sub menuWrapper {
|
|||
foreach $key (keys %{$_[1]}) {
|
||||
$output .= '<li><a href="'.$key.'">'.$_[1]->{$key}.'</a></li>';
|
||||
}
|
||||
$output .= '<li><a href="'.$session->url->page().'">'.WebGUI::International::get(493).'</a></li>';
|
||||
$output .= '<li><a href="'.$session->url->page().'">'.$i18n->get(493).'</a></li>';
|
||||
$output .= '</td></tr></table>';
|
||||
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(@_) },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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 .= '<table>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(145).':</td><td class="tableData">'.$WebGUI::VERSION.'-'.$WebGUI::STATUS.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get(145).':</td><td class="tableData">'.$WebGUI::VERSION.'-'.$WebGUI::STATUS.'</td></tr>';
|
||||
if ($version ne $WebGUI::VERSION) {
|
||||
my @rev = split(/\./,$version);
|
||||
|
||||
$version = '<a href="http://files.plainblack.com/downloads/'.$rev[0].'.x.x/webgui-'.$version.'.tar.gz">'.$version.'</a>';
|
||||
}
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(349).':</td><td class="tableData">'.$version.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get(349).':</td><td class="tableData">'.$version.'</td></tr>';
|
||||
($data) = $session->db->quickArray("select count(*) from asset where state='published'");
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(147).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get(147).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
($data) = $session->db->quickArray("select count(distinct assetId) from assetData where isPackage=1");
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(794).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get(794).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
($data) = $session->db->quickArray("select count(*) from template");
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(792).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get(792).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
($data) = $session->db->quickArray("select count(*) from userSession");
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(146).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get(146).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
($data) = $session->db->quickArray("select count(*) from users");
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(149).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get(149).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
($data) = $session->db->quickArray("select count(*) from groups");
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(89).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.$i18n->get(89).':</td><td class="tableData">'.$data.'</td></tr>';
|
||||
$output .= '</table>';
|
||||
return _submenu($output);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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').'<ul><li>'.join('</li><li>', @{$error}).'</li></ul>' 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 ".
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 = '<div align="center">'
|
||||
.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 .= '</div>';
|
||||
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).'<p>';
|
||||
$output .= $i18n->get(167).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session->url->page('op=deleteUserConfirm;uid='.$session->form->process("uid")).
|
||||
'">'.WebGUI::International::get(44).'</a>';
|
||||
'">'.$i18n->get(44).'</a>';
|
||||
$output .= ' <a href="'.$session->url->page('op=listUsers').'">'.
|
||||
WebGUI::International::get(45).'</a></div>';
|
||||
$i18n->get(45).'</a></div>';
|
||||
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 = '<ul><li>'.WebGUI::International::get(77).' '.$session->form->process("username").'Too or '.$session->form->process("username").'02</li></ul>';
|
||||
$error = '<ul><li>'.$i18n->get(77).' '.$session->form->process("username").'Too or '.$session->form->process("username").'02</li></ul>';
|
||||
}
|
||||
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 .= '<table border="1" cellpadding="5" cellspacing="0" align="center">';
|
||||
$output .= '<tr>
|
||||
<td class="tableHeader">'.WebGUI::International::get(816).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(50).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(56).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(453).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(454).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(429).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(434).'</td>
|
||||
<td class="tableHeader">'.$i18n->get(816).'</td>
|
||||
<td class="tableHeader">'.$i18n->get(50).'</td>
|
||||
<td class="tableHeader">'.$i18n->get(56).'</td>
|
||||
<td class="tableHeader">'.$i18n->get(453).'</td>
|
||||
<td class="tableHeader">'.$i18n->get(454).'</td>
|
||||
<td class="tableHeader">'.$i18n->get(429).'</td>
|
||||
<td class="tableHeader">'.$i18n->get(434).'</td>
|
||||
</tr>';
|
||||
my $p = doUserSearch("listUsers",1);
|
||||
foreach my $data (@{$p->getPageData}) {
|
||||
|
|
|
|||
|
|
@ -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 = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue