[LON-CAPA-cvs] cvs: loncom /publisher lonpubdir.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Thu, 02 Dec 2004 19:45:39 -0000
This is a MIME encoded message
--raeburn1102016739
Content-Type: text/plain
raeburn Thu Dec 2 14:45:39 2004 EDT
Modified files:
/loncom/publisher lonpubdir.pm
Log:
Fixing a number of small errors. Some compaction to conserve screen area. Removed some unneeded javascript functions - getcurrseed(), getproblemtype().
--raeburn1102016739
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20041202144539.txt"
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.67 loncom/publisher/lonpubdir.pm:1.68
--- loncom/publisher/lonpubdir.pm:1.67 Thu Dec 2 13:38:37 2004
+++ loncom/publisher/lonpubdir.pm Thu Dec 2 14:45:39 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.67 2004/12/02 18:38:37 raeburn Exp $
+# $Id: lonpubdir.pm,v 1.68 2004/12/02 19:45:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -193,19 +193,19 @@
$r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
my $pagetitle;
- my $formaction='/priv/'.$uname.'/'.$thisdisfn.'/';
+ my $formaction='/priv/'.$uname.$thisdisfn.'/';
$formaction=~s/\/+/\//g;
$pagetitle .= &Apache::loncommon::help_open_menu('','','','',3,'Authoring').
- '<font face="Arial, Helvetica, sans-serif"><b>Construction Space</b>:</font> '.
+ '<font face="Arial, Helvetica, sans-serif" size="+1"><b>Construction Space</b>:</font> '.
'<form name="dirs" method="post" action="'.$formaction.
- '" target="_parent">'.
- &Apache::lonhtmlcommon::crumbs($uname.'/'.$thisdisfn.'/','_top','/priv','','+1').
+ '" target="_parent"><tt><b>'.
+ &Apache::lonhtmlcommon::crumbs($uname.$thisdisfn.'/','_top','/priv','','+1',1)."</b></tt><br />".
&Apache::lonhtmlcommon::select_recent('construct','recent',
'this.form.action=this.form.recent.value;this.form.submit()').
'</form>';
&Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction);
if ($ENV{'environment.remote'} eq 'off') {
- $ENV{'request.noversionuri'}=$currdir;
+ $ENV{'request.noversionuri'}=$currdir.'/';
$r->print(&Apache::loncommon::bodytag('Construction Space',undef,undef,undef,undef,undef,$pagetitle));
} else {
$r->print($pagetitle);
@@ -214,7 +214,7 @@
<script>
// Store directory location for menu bar to find
-parent.lastknownpriv='/~$uname/$thisdisfn/';
+parent.lastknownpriv='/~$uname$thisdisfn/';
// Confirmation dialogues
@@ -278,7 +278,7 @@
if (theform.diraction.options[theform.diraction.selectedIndex].value == "editcat") {
top.location=theform.filename.value+'default.meta'
}
- if (theform.diraction.options[theform.diraction.selectedIndex].value == "print") {
+ if (theform.diraction.options[theform.diraction.selectedIndex].value == "printdir") {
theform.action = '/adm/printout'
theform.postdata.value = theform.filename.value
theform.submit()
@@ -303,17 +303,18 @@
}
}
if (activity == 'obsolete') {
- alert("Mark as obsolete - still to be implemented")
+ var pubform = document.pubresource
+ pubform.filename.value = theform.filename.value
+ alert("You will be taken to the publication page.\\nCheck the 'Obsolete' checkbox at the bottom of the page, and click 'Finalize Publication'.")
+ pubform.submit()
}
if (activity == 'print') {
- document.printresource.postdata = theform.filename.value
- document.printresource.curseed = getcurseed()
- document.printresource.problemtype = getproblemtype()
+ document.printresource.postdata.value = theform.filename.value
document.printresource.submit()
}
if (activity == 'retrieve') {
- retrieveres.filename.value = theform.filename.value
- retrieveres.submit()
+ document.retrieveres.filename.value = theform.filename.value
+ document.retrieveres.submit()
}
return
}
@@ -327,34 +328,6 @@
document.moveresource.action.value = activity
document.moveresource.submit();
}
-
- function getcurseed() {
- if (parent.document.lonhomework
- &&
- parent.document.lonhomework.rndseed
- &&
- parent.document.lonhomework.rndseed.value) {
- return parent.document.lonhomework.rndseed.value;
- }
- return 0;
- }
-
- function getproblemtype() {
- if (parent.document.lonhomework) {
- var optionelement;
- var valueIndex=0;
- for (var optionIndex=0;
- optionIndex < parent.document.lonhomework.problemtype.options.length;
- optionIndex++)
- {
- optionElement=parent.document.lonhomework.problemtype.options[optionIndex];
- if (optionElement.selected) {
- return optionElement.value;
- }
- }
- }
- return 0;
- }
</script>
ENDPUBDIRSCRIPT
$r->print($pubdirscript);
@@ -370,9 +343,9 @@
$r->print(<<END);
<table cellspacing="4" cellpadding="4" width="100%">
<tr>
- <td bgcolor="#DDDDDD" align="middle"><b>Actions for current directory</b></td>
- <td bgcolor="#DDDDDD" align="middle"><b>Upload a new document</b></td>
- <td bgcolor="#DDDDDD" align="middle"><b>Create a new directory or LON-CAPA document</b></td>
+ <td bgcolor="#DDDDDD" align="middle"><font face="Arial, Helvetica, sans-serif" size="-1"><b>Actions for current directory</b></font></td>
+ <td bgcolor="#DDDDDD" align="middle"><font face="Arial, Helvetica, sans-serif" size="-1"><b>Upload a new document</b></font></td>
+ <td bgcolor="#DDDDDD" align="middle"><font face="Arial, Helvetica, sans-serif" size="-1"><b>Create a new directory or LON-CAPA document</b></font></td>
</tr>
<tr>
<td bgcolor="#ccddaa" valign="top" align="center">
@@ -393,8 +366,6 @@
</form>
<form name="printdir" method="post" action="/adm/printout" target="_parent">
<input type="hidden" name="postdata" value="" />
- <input type="hidden" name="curseed" value="0" />
- <input type="hidden" name="problemtype" value="0" />
</form>
</td>
<td bgcolor="#ccddaa" valign="top" align="center">
@@ -424,8 +395,6 @@
</td>
</tr>
</table>
- <br />
- <br />
END
}
@@ -448,8 +417,6 @@
</form>
<form name="printresource" action="/adm/printout" target="_parent" method="post">
<input type="hidden" name="postdata" value="" />
- <input type="hidden" name="curseed" value="" />
- <input type="hidden" name="problemtype" value="" />
</form>
<form name="retrieveres" action="/adm/retrieve" target="_parent" method="post">
<input type="hidden" name="filename" value="" />
@@ -534,8 +501,6 @@
'<input type="hidden" name="filename" value="'.$dirpath.'/'.$dirname.'/" />'.
'<input type="hidden" name="pubrec" value="" />'.
'<input type="hidden" name="forcerepub" value="" />'.
- '<input type="hidden" name="curseed" value="0" />'.
- '<input type="hidden" name="problemtype" value="0" />'.
'<input type="hidden" name="postdata" value="" />'.
'</form>';
$$numdir ++;
@@ -649,20 +614,16 @@
<form name="resselect_'.$$numres.'" action="">
<select name="reschoice" onChange="SetResChoice(this.form)">
<option>'.&mt('Select action').
+'<option value="copy"/>'.&mt('Copy');
+ if ($pubstatus eq 'obsolete' || $pubstatus eq 'unpublished') {
+ $$pub_select .=
'<option value="rename"/>'.&mt('Rename').
'<option value="move"/>'.&mt('Move').
-'<option value="copy"/>'.&mt('Copy').
-'<option value="publish"/>'.$publish_button;
- if ($pubstatus eq 'obsolete' || $pubstatus eq 'unpublished') {
- $$pub_select .= '
-<option value="delete"/>'.&mt('Delete');
+'<option value="delete"/>'.&mt('Delete');
} else {
$$pub_select .= '
<option value="obsolete"/>'.&mt('Mark obsolete');
}
- $$pub_select .= '
-<option value="print"/>'.&mt('Print');
-
# check for versions
my $versions = &check_for_versions($r,'/'.$filename,$udom,$uname);
if ($versions > 0) {
@@ -670,9 +631,11 @@
<option value="retrieve"/>'.&mt('Retrieve old version');
}
$$pub_select .= '
-</select>
+<option value="publish"/>'.$publish_button.
+'<option value="print"/>'.&mt('Print').
+'</select>
<input type="hidden" name="filename" value="/~'.
- $uname.'/'.$thisdisfn.'/'.$filename.'"></form>';
+ $uname.$thisdisfn.'/'.$filename.'"></form>';
$$numres ++;
}
--raeburn1102016739--