adding last bits of functionality for dashboard. Help and i18n are left.
This commit is contained in:
parent
f2c8d4eed5
commit
6d5710db27
6 changed files with 31 additions and 22 deletions
|
|
@ -70,7 +70,7 @@ sub definition {
|
|||
fieldName=>{fieldType=>'text',defaultValue=>'',label=>$fieldName},
|
||||
fieldLabel=>{fieldType=>'text',defaultValue=>'',label=>'Label for This Field.'},
|
||||
fieldDescription=>{fieldType=>'HTMLArea',defaultValue=>'',label=>'Hover Help (Description) for this Field.'},
|
||||
fieldType=>{fieldType=>'fieldType',defaultValue=>'',label=>'Type of Field'},
|
||||
fieldType=>{fieldType=>'fieldType',defaultValue=>'',label=>'Type of Field',types=>['text','textarea','checkList','selectList']},
|
||||
# overrideForm=>{fieldType=>'yesNo',defaultValue=>0},
|
||||
# overrideValue=>{fieldType=>'yesNo',defaultValue=>0},
|
||||
possibleValues=>{fieldType=>'textarea',defaultValue=>'',label=>'Possible values for this Field. Only applies to selectList and checkList.'},
|
||||
|
|
|
|||
|
|
@ -351,13 +351,9 @@ sub getExtraHeadTags {
|
|||
#-------------------------------------------------------------------
|
||||
sub getFieldsList {
|
||||
my $self = shift;
|
||||
my $output = '<a href="'.$self->getUrl('func=add;class=WebGUI::Asset::Field'.$self->_isUserPref('url')).'" class="formLink">Add '.$self->_isUserPref('name').'</a><br /><br />';
|
||||
my $output = '<a href="'.$self->getUrl('func=add;class=WebGUI::Asset::Field').'" class="formLink">Add Preference Field</a><br /><br />';
|
||||
my @fielden;
|
||||
if ($self->_isUserPref) {
|
||||
@fielden = $self->getUserPrefs;
|
||||
} else {
|
||||
@fielden = $self->getOverrides;
|
||||
}
|
||||
@fielden = $self->getUserPrefs;
|
||||
return $output unless scalar @fielden > 0;
|
||||
$output .= '<table cellspacing="0" cellpadding="3" border="1">';
|
||||
$output .= '<tr class="tableHeader"><td>fieldName</td><td>Edit/Delete</td></tr>';
|
||||
|
|
@ -673,13 +669,7 @@ sub www_getUserPrefsForm {
|
|||
foreach my $field (@fielden) {
|
||||
my $fieldType = $field->get("fieldType") || "text";
|
||||
my $options;
|
||||
# Add a "Select..." option on top of a select list to prevent from
|
||||
# saving the value on top of the list when no choice is made.
|
||||
if($fieldType eq "selectList") {
|
||||
$options = {"", WebGUI::International::get("Select","Asset")};
|
||||
}
|
||||
$f->dynamicField(
|
||||
name=>$field->getId,
|
||||
my $params = {name=>$field->getId,
|
||||
label=>$field->get("fieldName"),
|
||||
uiLevel=>5,
|
||||
value=>$field->getUserPref($field->getId),
|
||||
|
|
@ -687,7 +677,12 @@ sub www_getUserPrefsForm {
|
|||
possibleValues=>$field->get("possibleValues"),
|
||||
options=>$options,
|
||||
fieldType=>$fieldType
|
||||
);
|
||||
};
|
||||
if ($fieldType eq 'Textarea') {
|
||||
$params->{rows} = 4;
|
||||
$params->{columns} = 20;
|
||||
}
|
||||
$f->dynamicField(%$params);
|
||||
}
|
||||
$f->submit;
|
||||
return $f->print;
|
||||
|
|
@ -698,7 +693,7 @@ sub www_manageUserPrefs {
|
|||
my $self = shift;
|
||||
return WebGUI::Privilege::insufficient() unless $self->canEdit;
|
||||
my $output = $self->getFieldsList;
|
||||
return $self->_submenu($output,$self->_isUserPref('titleHeader'));
|
||||
return $self->_submenu($output,"Manage Preferences");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -401,6 +401,7 @@ sub definition {
|
|||
},
|
||||
collaborationTemplateId =>{
|
||||
fieldType=>"template",
|
||||
namespace=>'Collaboration',
|
||||
defaultValue=>'PBtmpl0000000000000026'
|
||||
},
|
||||
karmaPerPost =>{
|
||||
|
|
|
|||
|
|
@ -157,6 +157,13 @@ sub view {
|
|||
my @hidden = split("\n",$self->get("assetsToHide"));
|
||||
foreach my $child (@{$children}) {
|
||||
push(@hidden,$child->get('shortcutToAssetId')) if ref $child eq 'WebGUI::Asset::Shortcut';
|
||||
#the following loop will initially place just-shortcutted assets.
|
||||
for (my $i = 0; $i < scalar(@positions); $i++) {
|
||||
next unless isIn($child->get('shortcutToAssetId'),@hidden);
|
||||
my $newChildId = $child->getId;
|
||||
my $oldChildId = $child->get('shortcutToAssetId');
|
||||
$positions[$i] =~ s/${oldChildId}/${newChildId}/g;
|
||||
}
|
||||
}
|
||||
my $i = 1;
|
||||
my $templateAsset = WebGUI::Asset->newByDynamicClass($templateId) || WebGUI::Asset->getImportNode;
|
||||
|
|
|
|||
|
|
@ -211,7 +211,9 @@ sub www_copyList {
|
|||
|
||||
sub www_createShortcut () {
|
||||
my $self = shift;
|
||||
my $child = $self->addChild({
|
||||
my $isOnDashboard = ref $self->getParent == 'WebGUI::Asset::Wobject::Dashboard';
|
||||
my $target = $isOnDashboard ? $self->getParent : $self;
|
||||
my $child = $target->addChild({
|
||||
className=>'WebGUI::Asset::Shortcut',
|
||||
shortcutToAssetId=>$self->getId,
|
||||
title=>$self->getTitle,
|
||||
|
|
@ -225,10 +227,14 @@ sub www_createShortcut () {
|
|||
groupIdView=>$self->get("groupIdView"),
|
||||
url=>$self->get("title"),
|
||||
templateId=>'PBtmpl0000000000000140'
|
||||
});
|
||||
$child->cut;
|
||||
return $self->getContainer->www_manageAssets if ($session{form}{proceed} eq "manageAssets");
|
||||
return $self->getContainer->www_view;
|
||||
});
|
||||
if ($isOnDashboard) {
|
||||
return $target->www_view;
|
||||
} else {
|
||||
$child->cut;
|
||||
return $self->getContainer->www_manageAssets if ($session{form}{proceed} eq "manageAssets");
|
||||
return $self->getContainer->www_view;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ sub getValueFromPost {
|
|||
|
||||
=head2 toHtml ( )
|
||||
|
||||
Renders a question selector asking the user where they want to go.
|
||||
Renders a fieldType selector.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue