- Internationalized a bunch of stuff that was previously uninternationalized.

- Fixed a bug in the survey that caused users to not be able to submit
   survey's.
- added context menu to nav toolbar
- added a switch to disable content locking on alternate criteria shortcuts.
This commit is contained in:
JT Smith 2005-05-03 22:01:07 +00:00
parent d8a6eb332c
commit b631cbb2f4
9 changed files with 147 additions and 25 deletions

View file

@ -833,9 +833,10 @@ sub getAssetManagerControl {
$title =~ s/\'/\\\'/g;
push(@dataArray,"['".$ancestor->getId."','".$ancestor->getUrl."','".$title."']\n");
}
my $i18n = WebGUI::International->new("Asset");
$output .= join(",",@dataArray);
$output .= "];\n";
$output .= "var columnHeadings = ['Rank','Title','Type','Last Updated','Size'];\n";
$output .= "var columnHeadings = ['".$i18n->get("rank")."','".$i18n->get("99")."','".$i18n->get("type")."','".$i18n->get("last updated")."','".$i18n->get("size")."'];\n";
$output .= "/*rank, title, type, lastUpdate, size, url, assetId, icon */\nvar assets = [\n";
@dataArray = ();
foreach my $child (@{$children}) {
@ -848,18 +849,16 @@ sub getAssetManagerControl {
}
$output .= join(",",@dataArray);
$output .= "];\n var labels = new Array();\n";
$output .= "labels['edit'] = 'Edit';\n";
$output .= "labels['cut'] = 'Cut';\n";
$output .= "labels['copy'] = 'Copy';\n";
$output .= "labels['move'] = 'Move';\n";
$output .= "labels['view'] = 'View';\n";
$output .= "labels['delete'] = 'Delete';\n";
$output .= "labels['restore'] = 'Restore';\n";
$output .= "labels['shortcut'] = 'Create Shortcut';\n";
$output .= "labels['purge'] = 'Purge';\n";
$output .= "labels['go'] = 'Manage';\n";
$output .= "labels['properties'] = 'Properties';\n";
$output .= "labels['editTree'] = 'Edit Branch';\n";
$output .= "labels['edit'] = '".$i18n->get("edit")."';\n";
$output .= "labels['cut'] = '".$i18n->get("cut")."';\n";
$output .= "labels['copy'] = '".$i18n->get("copy")."';\n";
$output .= "labels['view'] = '".$i18n->get("view")."';\n";
$output .= "labels['delete'] = '".$i18n->get("delete")."';\n";
$output .= "labels['restore'] = '".$i18n->get("restore")."';\n";
$output .= "labels['shortcut'] = '".$i18n->get("create shortcut")."';\n";
$output .= "labels['purge'] = '".$i18n->get("purge")."';\n";
$output .= "labels['go'] = '".$i18n->get("manage")."';\n";
$output .= "labels['editTree'] = '".$i18n->get("edit branch")."';\n";
$output .= "var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail);\n";
$output .= "manager.assetType='".$controlType."';\n" if (defined $controlType);
$output .= "manager.disableDisplay(0);\n" if (defined $removeRank);
@ -1662,12 +1661,13 @@ sub getToolbar {
WebGUI::Style::setLink($session{config}{extrasURL}.'/contextMenu/contextMenu.css', {rel=>"stylesheet",type=>"text/css"});
WebGUI::Style::setScript($session{config}{extrasURL}.'/contextMenu/contextMenu.js', {type=>"text/javascript"});
#return '<img src="'.$self->getIcon(1).'" border="0" title="'.$self->getName.'" alt="'.$self->getName.'" align="absmiddle">'.$toolbar;
my $i18n = WebGUI::International->new("Asset");
return '<script type="text/javascript">
var contextMenu = new contextMenu_create("'.$self->getIcon(1).'","'.$self->getId.'","'.$self->getName.'");
contextMenu.addLink("'.$self->getUrl("func=promote").'","Promote");
contextMenu.addLink("'.$self->getUrl("func=demote").'","Demote");
contextMenu.addLink("'.$self->getUrl("func=manageAssets").'","Manage");
contextMenu.addLink("'.$self->getUrl.'","View");
contextMenu.addLink("'.$self->getUrl("func=promote").'","'.$i18n->get("promote").'");
contextMenu.addLink("'.$self->getUrl("func=demote").'","'.$i18n->get("demote").'");
contextMenu.addLink("'.$self->getUrl("func=manageAssets").'","'.$i18n->get("manage").'");
contextMenu.addLink("'.$self->getUrl.'","'.$i18n->get("view").'");
contextMenu.draw();
</script>'.$toolbar;
}

View file

@ -57,6 +57,10 @@ sub definition {
fieldType=>"yesNo",
defaultValue=>0,
},
disableContentLock=>{
fieldType=>"yesNo",
defaultValue=>0
},
resolveMultiples=>{
fieldType=>"selectList",
defaultValue=>"mostRecent",
@ -137,6 +141,11 @@ sub getEditForm {
this.form.proxyCriteria.disabled=true;
}"|
);
$tabform->getTab("properties")->yesNo(
-name=>"disableContentLock",
-value=>$self->getValue("disableContentLock"),
-label=>WebGUI::International::get("disable content lock","Asset_Shortcut")
);
if ($self->getValue("shortcutByCriteria") == 0) {
$self->{_disabled} = 'disabled=true';
}
@ -229,7 +238,7 @@ sub getShortcutByCriteria {
my $scratchId;
if ($assetId) {
$scratchId = "Shortcut_" . $assetId;
if($session{scratch}{$scratchId}) {
if($session{scratch}{$scratchId} && !$self->getValue("disableContentLock")) {
return $session{scratch}{$scratchId} unless ($session{var}{adminOn});
}
}

View file

@ -286,7 +286,14 @@ sub getToolbar {
$returnUrl = "&proceed=goBackToPage&returnUrl=".WebGUI::URL::escape($session{asset}->getUrl);
}
my $toolbar = editIcon('func=edit'.$returnUrl,$self->get("url"));
return '<img src="'.$self->getIcon(1).'" border="0" title="'.$self->getName.'" alt="'.$self->getName.'" align="absmiddle">'.$toolbar;
my $i18n = WebGUI::International->new("Asset");
return '<script type="text/javascript">
var contextMenu = new contextMenu_create("'.$self->getIcon(1).'","'.$self->getId.'","'.$self->getName.'");
contextMenu.addLink("'.$self->getUrl("func=copy").'","'.$i18n->get("copy").'");
contextMenu.addLink("'.$self->getUrl("func=manageAssets").'","'.$i18n->get("manage").'");
contextMenu.addLink("'.$self->getUrl.'","'.$i18n->get("view").'");
contextMenu.draw();
</script>'.$toolbar;
}
return $self->SUPER::getToolbar();
}

View file

@ -589,7 +589,7 @@ sub view {
$var->{question_loop} = $self->getQuestionsLoop($var->{'response.Id'});
}
}
$var->{'form.header'} = WebGUI::Form::formHeader({-action=>$self->getUrl})
$var->{'form.header'} = WebGUI::Form::formHeader({action=>$self->getUrl})
.WebGUI::Form::hidden({
name=>'func',
value=>'respond'
@ -990,7 +990,7 @@ sub www_viewGradebook {
$var->{title} = WebGUI::International::get(71,'Asset_Survey');
my $p = WebGUI::Paginator->new($self->getUrl('func=viewGradebook'));
$p->setDataByQuery("select userId,username,ipAddress,Survey_responseId,startDate,endDate from Survey_response
where isComplete=1 and Survey_id=".quote($self->get("Survey_id"))." order by username,ipAddress,startDate");
where Survey_id=".quote($self->get("Survey_id"))." order by username,ipAddress,startDate");
my $users = $p->getPageData;
($var->{'question.count'}) = WebGUI::SQL->quickArray("select count(*) from Survey_question where Survey_id=".quote($self->get("Survey_id")));
if ($var->{'question.count'} > $self->get("questionsPerResponse")) {

View file

@ -1142,7 +1142,7 @@ Returns an HTML area. An HTML area is different than a standard text area in tha
The name field for this form element.
=head3 richEditorId
=head3 richEditId
An asset Id of a rich editor to display for this field.

View file

@ -23,7 +23,7 @@ sub process {
my @param = WebGUI::Macro::getParams(shift);
return WebGUI::URL::page("op=auth&method=init") if ($param[0] eq "linkonly");
$var{'account.url'} = WebGUI::URL::page('op=auth&method=init');
$var{'account.text'} = $param[0] || WebGUI::International::get(46.'Macro_a_account');
$var{'account.text'} = $param[0] || WebGUI::International::get(46,'Macro_a_account');
if ($param[1]) {
return WebGUI::Asset::Template->newByUrl($param[1])->process(\%var);
} else {

View file

@ -1,7 +1,102 @@
package WebGUI::i18n::English::Asset;
our $I18N = {
'rank' => {
message => q|Rank|,
lastUpdated => 0,
context => q|Column heading in asset manager.|
},
'type' => {
message => q|Type|,
lastUpdated => 0,
context => q|Column heading in asset manager.|
},
'size' => {
message => q|Size|,
lastUpdated => 0,
context => q|Column heading in asset manager.|
},
'last updated' => {
message => q|Last Updated|,
lastUpdated => 0,
context => q|Column heading in asset manager.|
},
'purge' => {
message => q|Purge|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'restore' => {
message => q|Restore|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'promote' => {
message => q|Promote|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'demote' => {
message => q|Demote|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'cut' => {
message => q|Cut|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'copy' => {
message => q|Copy|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'create shortcut' => {
message => q|Create Shortcut|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'view' => {
message => q|View|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'delete' => {
message => q|Delete|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'manage' => {
message => q|Manage|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'edit branch' => {
message => q|Edit Branch|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'edit' => {
message => q|Edit|,
lastUpdated => 0,
context => q|Used in asset context menus.|
},
'change' => {
message => q|Change recursively?|,
lastUpdated => 1099344172,

View file

@ -2,6 +2,12 @@ package WebGUI::i18n::English::Asset_Shortcut;
our $I18N = {
'disable content lock' => {
message => q|Disable content lock?|,
lastUpdated => 0,
context=> q|asset property|
},
'85' => {
message => q|Description|,
lastUpdated => 1031514049
@ -79,6 +85,9 @@ Set to "yes" to use the display title setting of the shortcut instead of the ori
Set to "yes" to use the template of the shortcut of the original template of the asset.
<p>
<b>Disable content lock?</b><br />
By default if you proxy by alternate criteria the shortcut will lock on to a particular piece of content and show you only that piece of content until the end of your session. However, in some circumstances you may wish for this content to rotate. You can do that by disabling the content lock.
<b>Shortcut by alternate criteria?</b><br>
Set to "yes" to enable selecting a asset based upon custom criteria. Metadata must be enabled for this option to function properly.
<p>