--- loncom/interface/londocs.pm 2003/04/30 21:09:12 1.52 +++ loncom/interface/londocs.pm 2003/07/18 14:31:43 1.68 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.52 2003/04/30 21:09:12 www Exp $ +# $Id: londocs.pm,v 1.68 2003/07/18 14:31:43 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -179,6 +179,20 @@ sub editor { # Store the changed version &storemap($coursenum,$coursedom,$folder.'.sequence'); } +# Loading a complete map + if (($ENV{'form.importmap'}) && ($ENV{'form.loadmap'})) { + foreach +(&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$ENV{'form.importmap'}))) { + my $idx=$#Apache::lonratedt::resources; + $idx++; + $Apache::lonratedt::resources[$idx]=$_; + $Apache::lonratedt::order + [$#Apache::lonratedt::order+1]=$idx; + } + +# Store the changed version + &storemap($coursenum,$coursedom,$folder.'.sequence'); + } } # ---------------------------------------------------------------- End commands # ---------------------------------------------------------------- Print screen @@ -218,16 +232,18 @@ sub entryline { # Edit commands if ($allowed) { $line.=(< -
+ + - -
+ UP
+
+ DOWN
- -Remove +
+ +Remove -Rename +Rename END } # Figure out what kind of a resource this is @@ -359,12 +375,22 @@ sub handler { # --------------------------------------------- Initialize help topics for this foreach ('Adding_Course_Doc','Main_Course_Documents', 'Adding_External_Resource','Navigate_Content', - 'Adding_Folders','Docs_Overview', - 'Creating_From_Template','Supplemental', + 'Adding_Folders','Docs_Overview', 'Load_Map', + 'Supplemental', 'Score_Upload_Form', 'Importing_LON-CAPA_Resource','Uploading_From_Harddrive') { $help{$_}=&Apache::loncommon::help_open_topic('Docs_'.$_); } - + # Composite help files + $help{'Syllabus'} = &Apache::loncommon::help_open_topic( + 'Docs_About_Syllabus,Docs_Editing_Templated_Pages'); + $help{'Simple Page'} = &Apache::loncommon::help_open_topic( + 'Docs_About_Simple_Page,Docs_Editing_Templated_Pages'); + $help{'Bulletin Board'} = &Apache::loncommon::help_open_topic( + 'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages'); + $help{'My Personal Info'} = &Apache::loncommon::help_open_topic( + 'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages'); + $help{'Caching'} = &Apache::loncommon::help_open_topic('Caching'); + if ($ENV{'form.verify'}) { my $loaderror=&Apache::lonnet::overloaderror($r); @@ -549,6 +575,15 @@ function makenewext(targetname) { window.open('/adm/rat/extpickframe.html'); } +function makeexamupload() { + var title=prompt('Listed Title for the Uploaded Score'); + if (title) { + this.document.forms.newexamupload.importdetail.value= + title+'=/res/lib/templates/examupload.problem'; + this.document.forms.newexamupload.submit(); + } +} + function makesmppage() { var title=prompt('Listed Title for the Page'); if (title) { @@ -558,6 +593,15 @@ function makesmppage() { } } +function makesmpproblem() { + var title=prompt('Listed Title for the Problem'); + if (title) { + this.document.forms.newsmpproblem.importdetail.value= + title+'=/res/lib/templates/simpleproblem.problem'; + this.document.forms.newsmpproblem.submit(); + } +} + function makebulboard() { var title=prompt('Listed Title for the Bulletin Board'); if (title) { @@ -585,6 +629,14 @@ function changename(folder,index,oldtitl this.document.forms.renameform.submit(); } } + +function removeres(folder,index,oldtitle) { + if ((oldtitle=='NO RESOURCE') || (confirm('Remove "'+oldtitle+'"?'))) { + this.document.forms.renameform.cmd.value='del_'+index; + this.document.forms.renameform.folder.value=folder; + this.document.forms.renameform.submit(); + } +} ENDNEWSCRIPT @@ -633,7 +685,8 @@ ENDCOURSEVERIFY ''. '
'. '

Changes will become active for your current session after , or the next time you log in.

'); +$ENV{'request.role'}.'" value="1" />, or the next time you log in.'. +$help{'Caching'}.''); } my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. '.sequence'; @@ -647,80 +700,127 @@ $ENV{'request.role'}.'" value="1" /> File:
- +
-Title:
+Title:
- $help{'Uploading_From_Harddrive'}
+ + $help{'Uploading_From_Harddrive'} + +
+ + + -$help{'Importing_LON-CAPA_Resource'}
- - +

+


+
+
+value="Select Map"> +$help{'Load_Map'} +

+ $help{'Adding_Folders'} +value="New Folder" />$help{'Adding_Folders'} +
+ $help{'Adding_External_Resource'} +
+ - $help{'Creating_From_Template'} + $help{'Syllabus'} +
+
+ $help{'Navigate_Content'} +
+ $help{'Creating_From_Template'} +onClick="javascript:makesmppage();" /> $help{'Simple Page'} + +
+
+ + + + +$help{'Simple Problem'} + +
+
+ + + + + +$help{'Score_Upload_Form'} +
+ -$help{'Creating_From_Template'} +$help{'Bulletin Board'} +
+
+ -$help{'Creating_From_Template'} +$help{'My Personal Info'} +
+ ENDFORM @@ -747,55 +847,77 @@ ENDFORM
- +
Comment:
+ - $help{'Uploading_From_Harddrive'} + $help{'Uploading_From_Harddrive'} +
+
+ + $help{'Importing_LON-CAPA_Resource'} +

+


+ + +

+ $help{'Adding_Folders'} +
+ $help{'Adding_External_Resource'} +
+ -$help{'Creating_From_Template'} +$help{'Syllabus'} +
+
+ -$help{'Creating_From_Template'} +$help{'My Personal Info'} +
+ ENDSUPFORM