Friend Manager settings, i18n, save form.
This commit is contained in:
parent
229ae88881
commit
2af14e6bf6
3 changed files with 45 additions and 20 deletions
|
|
@ -59,24 +59,26 @@ sub editSettingsForm {
|
|||
my $f = WebGUI::HTMLForm->new($session);
|
||||
|
||||
$f->group(
|
||||
name => "groupIdAdminFriends",
|
||||
value => $session->setting->get('groupIdAdminFriends'),
|
||||
label => $i18n->get("setting groupIdAdminFriends label"),
|
||||
hoverHelp => $i18n->get("setting groupIdAdminFriends hoverHelp")
|
||||
name => "groupIdAdminFriends",
|
||||
value => $session->setting->get('groupIdAdminFriends'),
|
||||
label => $i18n->get("setting groupIdAdminFriends label"),
|
||||
hoverHelp => $i18n->get("setting groupIdAdminFriends hoverHelp"),
|
||||
);
|
||||
$f->group(
|
||||
name => "groupsToManageFriends",
|
||||
value => $session->setting->get('groupsToManageFriends'),
|
||||
name => "groupsToManageFriends",
|
||||
value => $session->setting->get('groupsToManageFriends'),
|
||||
multiple => 1,
|
||||
label => $i18n->get("groupsToManageFriends label"),
|
||||
hoverHelp => $i18n->get("groupsToManageFriends hoverHelp")
|
||||
size => 5,
|
||||
label => $i18n->get("groupsToManageFriends label"),
|
||||
hoverHelp => $i18n->get("groupsToManageFriends hoverHelp"),
|
||||
defaultValue => [2,3],
|
||||
);
|
||||
$f->template(
|
||||
name => "friendManagerViewTemplateId",
|
||||
value => $self->session->setting->get("friendManagerViewTemplateId"),
|
||||
namespace => "Account/FriendManager/View",
|
||||
label => $i18n->get("view template label"),
|
||||
hoverHelp => $i18n->get("view template hoverHelp")
|
||||
name => "friendManagerViewTemplateId",
|
||||
value => $self->session->setting->get("friendManagerViewTemplateId"),
|
||||
namespace => "Account/FriendManager/View",
|
||||
label => $i18n->get("view template label"),
|
||||
hoverHelp => $i18n->get("view template hoverHelp"),
|
||||
);
|
||||
|
||||
return $f->printRowsOnly;
|
||||
|
|
@ -96,7 +98,10 @@ sub editSettingsFormSave {
|
|||
my $setting = $session->setting;
|
||||
my $form = $session->form;
|
||||
|
||||
$setting->set("moduleViewTemplateId", $form->process("moduleViewTemplateId","template"));
|
||||
$setting->set("moduleViewTemplateId", $form->process("moduleViewTemplateId", "template"));
|
||||
my $groupsToManageFriends = $form->process("groupsToManageFriends", "group");
|
||||
$setting->set("groupsToManageFriends", $groupsToManageFriends);
|
||||
$setting->set("groupIdAdminFriends", $form->process("groupIdAdminFriends", "group"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package WebGUI::i18n::English::FriendManager;
|
||||
package WebGUI::i18n::English::Account_FriendManager;
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
|
||||
'settings groupIdAdminFriends label' => {
|
||||
'setting groupIdAdminFriends label' => {
|
||||
message => q{Friends Manager},
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'settings groupIdAdminFriends hoverHelp' => {
|
||||
'setting groupIdAdminFriends hoverHelp' => {
|
||||
message => q{Group to manage friends, to assign people to one another and to view the interface for managing friends.},
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use strict;
|
|||
use Pod::Usage;
|
||||
use Getopt::Long;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::ProfileField;
|
||||
use WebGUI::Utility;
|
||||
|
||||
# Get parameters here, including $help
|
||||
GetOptions(
|
||||
|
|
@ -31,7 +31,8 @@ pod2usage( msg => "Must specify a config file!" ) unless $configFile;
|
|||
|
||||
my $session = start( $webguiRoot, $configFile );
|
||||
|
||||
installFriendManagerGroup($session);
|
||||
installFriendManagerSettings($session);
|
||||
installFriendManagerConfig($session);
|
||||
|
||||
# Do your work here
|
||||
finish($session);
|
||||
|
|
@ -39,9 +40,28 @@ finish($session);
|
|||
#----------------------------------------------------------------------------
|
||||
# Your sub here
|
||||
|
||||
sub installFriendManagerGroup {
|
||||
sub installFriendManagerSettings {
|
||||
my $session = shift;
|
||||
$session->setting->add('groupIdAdminFriends', 3);
|
||||
$session->setting->add('friendManagerViewTemplate', '');
|
||||
$session->setting->add('groupsToManageFriends', '2');
|
||||
}
|
||||
|
||||
sub installFriendManagerConfig {
|
||||
my $session = shift;
|
||||
my $config = $session->config;
|
||||
my $account = $config->get('account');
|
||||
my @classes = map { $_->{className} } @{ $account };
|
||||
return if isIn('WebGUI::Account::FriendManager', @classes);
|
||||
print "Installing FriendManager\n";
|
||||
push @{ $account },
|
||||
{
|
||||
identifier => 'friendManager',
|
||||
title => '^International(title,Account_FriendManager);',
|
||||
className => 'WebGUI::Account::FriendManager',
|
||||
}
|
||||
;
|
||||
$config->set('account', $account);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue