[LON-CAPA-cvs] cvs: loncom /interface londocs.pm

www lon-capa-cvs@mail.lon-capa.org
Tue, 04 Feb 2003 18:23:21 -0000


This is a MIME encoded message

--www1044383001
Content-Type: text/plain

www		Tue Feb  4 13:23:21 2003 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Added contextual help - pretty blue now :-)
  
  
--www1044383001
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20030204132321.txt"

Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.46 loncom/interface/londocs.pm:1.47
--- loncom/interface/londocs.pm:1.46	Thu Jan 23 14:00:06 2003
+++ loncom/interface/londocs.pm	Tue Feb  4 13:23:21 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.46 2003/01/23 19:00:06 www Exp $
+# $Id: londocs.pm,v 1.47 2003/02/04 18:23:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -47,6 +47,10 @@
 
 my $hadchanges;
 
+# Available help topics
+
+my %help=();
+
 # Mapread read maps into lonratedt::global arrays 
 # @order and @resources, determines status
 # sets @order - pointer to resources in right order
@@ -341,7 +345,15 @@
     $r->send_http_header;
     return OK if $r->header_only;
 
-  
+# --------------------------------------------- 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',
+           'Importing_LON-CAPA_Resource','Uploading_From_Harddrive') {
+      $help{$_}=&Apache::loncommon::help_open_topic('Docs_'.$_);
+  }
+
   if ($ENV{'form.verify'}) {
  
    my $loaderror=&Apache::lonnet::overloaderror($r);
@@ -569,6 +581,8 @@
             &Apache::loncommon::bodytag('Course Documents','',$events));
   unless ($showdoc) {
     if ($allowed) {
+       $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
+		     'Editing the Table of Contents for your Course'));
        $r->print(<<ENDCOURSEVERIFY);
 <form name="renameform" method="post" action="/adm/coursedocs">
 <input type="hidden" name="title" />
@@ -588,7 +602,8 @@
 # --------------------------------------------------------- Standard documents
     $r->print('<table border=2 cellspacing=4 cellpadding=4>');
     if (($standard) && ($allowed) && (!$forcesupplement)) {
-       $r->print('<tr><td bgcolor="#BBBBBB"><h2>Main Course Documents</h2>');
+       $r->print('<tr><td bgcolor="#BBBBBB"><h2>Main Course Documents'.
+  ($allowed?' '.$help{'Main_Course_Documents'}:'').'</h2>');
        my $folder=$ENV{'form.folder'};
        unless ($folder=~/^default/) { $folder='default'; }
        $hadchanges=0;
@@ -600,6 +615,7 @@
        }
        my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
                      '.sequence';
+
        $r->print(<<ENDFORM);
 <table cellspacing=4 cellpadding=4><tr>
 <th bgcolor="#DDDDDD">Upload a new main course document</th>
@@ -617,7 +633,7 @@
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type="hidden" name="cmd" value="upload_default">
 <input type="submit" value="Upload Document">
-</form>
+ $help{'Uploading_From_Harddrive'}</form>
 </td>
 <td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="simpleeditdefault">
@@ -625,7 +641,7 @@
 "javascript:document.forms.simpleedit.folder.value='$folder';groupsearch()" value="Search">
 <input type=button onClick=
 "javascript:document.forms.simpleedit.folder.value='$folder';groupimport();" value="Import">
-</form>
+$help{'Importing_LON-CAPA_Resource'}</form>
 </td><td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="newfolder">
 <input type="hidden" name="folder" value="$folder">
@@ -633,35 +649,36 @@
 <input type=hidden name="importdetail" value="">
 <input name="newfolder" type="button"
 onClick="javascript:makenewfolder(this.form,'$folderseq');"
-value="New Folder" />
+value="New Folder" /> $help{'Adding_Folders'}
 </form>
 <form action="/adm/coursedocs" method="post" name="newext">
 <input type="hidden" name="folder" value="$folder">
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type=hidden name="importdetail" value="">
 <input name="newext" type="button" onClick="javascript:makenewext('newext');"
-value="External Resource" />
+value="External Resource" /> $help{'Adding_External_Resource'}
 </form>
 <form action="/adm/coursedocs" method="post" name="newsyl">
 <input type="hidden" name="folder" value="$folder">
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type=hidden name="importdetail" 
 value="Syllabus=/public/$coursedom/$coursenum/syllabus">
-<input name="newsyl" type="submit" value="Syllabus" />
-</form>
+<input name="newsyl" type="submit" value="Syllabus" /> 
+ $help{'Creating_From_Template'}</form>
 <form action="/adm/coursedocs" method="post" name="newnav">
 <input type="hidden" name="folder" value="$folder">
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type=hidden name="importdetail" 
 value="Navigate Content=/adm/navmaps">
 <input name="newnav" type="submit" value="Navigate Content" />
+$help{'Navigate_Content'}
 </form>
 <form action="/adm/coursedocs" method="post" name="newsmppg">
 <input type="hidden" name="folder" value="$folder">
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type=hidden name="importdetail" value="">
 <input name="newsmppg" type="button" value="Simple Page"
-onClick="javascript:makesmppage();" />
+onClick="javascript:makesmppage();" /> $help{'Creating_From_Template'}
 </form>
 <form action="/adm/coursedocs" method="post" name="newbul">
 <input type="hidden" name="folder" value="$folder">
@@ -669,14 +686,14 @@
 <input type=hidden name="importdetail" value="">
 <input name="newbulletin" type="button" value="Bulletin Board"
 onClick="javascript:makebulboard();" />
-</form>
+$help{'Creating_From_Template'}</form>
 <form action="/adm/coursedocs" method="post" name="newaboutme">
 <input type="hidden" name="folder" value="$folder">
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type=hidden name="importdetail" 
 value="$plainname=/adm/$udom/$uname/aboutme">
 <input name="newaboutme" type="submit" value="My Personal Info" />
-</form>
+$help{'Creating_From_Template'}</form>
 </td></tr>
 </table>
 ENDFORM
@@ -685,7 +702,8 @@
 # ----------------------------------------------------- Supplemental documents
     if (!$forcestandard) {
        $r->print(
-  '<tr><td bgcolor="#BBBBBB"><h2>Supplemental Course Documents</h2>');
+  '<tr><td bgcolor="#BBBBBB"><h2>Supplemental Course Documents'.
+  ($allowed?' '.$help{'Supplemental'}:'').'</h2>');
        my $folder=$ENV{'form.folder'};
        unless ($folder=~/supplemental/) { $folder='supplemental'; }
        &editor($r,$coursenum,$coursedom,$folder,$allowed);
@@ -710,7 +728,7 @@
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type="hidden" name="cmd" value="upload_supplemental">
 <input type="submit" value="Upload Document">
-</form>
+ $help{'Uploading_From_Harddrive'}</form>
 </td>
 <td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="simpleeditsupplement">
@@ -718,7 +736,7 @@
 <input type=button onClick=
 "javascript:document.forms.simpleedit.folder.value='$folder';groupsearch()" value="Search">
 <input type=button onClick=
-"javascript:document.forms.simpleedit.folder.value='$folder';groupimport();" value="Import">
+"javascript:document.forms.simpleedit.folder.value='$folder';groupimport();" value="Import">$help{'Importing_LON-CAPA_Resource'}
 </form>
 </td><td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" name="supnewfolder">
@@ -727,7 +745,7 @@
 <input type=hidden name="importdetail" value="">
 <input name="newfolder" type="button"
 onClick="javascript:makenewfolder(this.form,'$folderseq');"
-value="New Folder" />
+value="New Folder" /> $help{'Adding_Folders'}
 </form>
 <form action="/adm/coursedocs" method="post" name="supnewext">
 <input type="hidden" name="folder" value="$folder">
@@ -735,7 +753,7 @@
 <input type=hidden name="importdetail" value="">
 <input name="newext" type="button" 
 onClick="javascript:makenewext('supnewext');"
-value="External Resource" />
+value="External Resource" /> $help{'Adding_External_Resource'}
 </form>
 <form action="/adm/coursedocs" method="post" name="supnewsyl">
 <input type="hidden" name="folder" value="$folder">
@@ -743,14 +761,14 @@
 <input type=hidden name="importdetail" 
 value="Syllabus=/public/$coursedom/$coursenum/syllabus">
 <input name="newsyl" type="submit" value="Syllabus" />
-</form>
+$help{'Creating_From_Template'}</form>
 <form action="/adm/coursedocs" method="post" name="subnewaboutme">
 <input type="hidden" name="folder" value="$folder">
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
 <input type=hidden name="importdetail" 
 value="$plainname=/adm/$udom/$uname/aboutme">
 <input name="newaboutme" type="submit" value="My Personal Info" />
-</form>
+$help{'Creating_From_Template'}</form>
 </td></tr>
 </table></td></tr>
 ENDSUPFORM

--www1044383001--