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

raeburn raeburn at source.lon-capa.org
Wed Oct 31 21:01:14 EDT 2012


raeburn		Thu Nov  1 01:01:14 2012 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - file input element for Load Map moved to fieldset,
    display toggled by clicking icon/link.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.501 loncom/interface/londocs.pm:1.502
--- loncom/interface/londocs.pm:1.501	Wed Oct 31 12:54:13 2012
+++ loncom/interface/londocs.pm	Thu Nov  1 01:01:13 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.501 2012/10/31 12:54:13 raeburn Exp $
+# $Id: londocs.pm,v 1.502 2012/11/01 01:01:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3536,6 +3536,7 @@
                 'srch' => 'Search',
                 'impo' => 'Import',
 		'lnks' => 'Import from Stored Links',
+                'impm' => 'Import from Assembled Map',
                 'selm' => 'Select Map',
                 'load' => 'Load Map',
                 'reco' => 'Recover Deleted Documents',
@@ -3635,26 +3636,30 @@
         </form>
 FUFORM
 
-	my $simpleeditdefaultform=(<<SEDFFORM);
-	<form action="/adm/coursedocs" method="post" name="simpleeditdefault">
+	my $importpubform=(<<SEDFFORM);
+        <a class="LC_menubuttons_link" href="javascript:toggleMap();">
+        $lt{'impm'}</a>$help{'Load_Map'}
+	<form action="/adm/coursedocs" method="post" name="mapimportform">
+        <fieldset id="importmapform" style="display: none;" />
+        <legend>$lt{'impm'}</legend>
 	<input type="hidden" name="active" value="bb" />
+        $lt{'copm'}<br />
+        <span class="LC_nobreak">
+        <input type="text" name="importmap" size="40" value="" 
+        onfocus="this.blur();openbrowser('mapimportform','importmap','sequence,page','');" />
+         <a href="javascript:openbrowser('mapimportform','importmap','sequence,page','');">$lt{'selm'}</a><br />
+        <input type="submit" name="loadmap" value="$lt{'load'}" />
+        </fieldset>
+        </form>
+
 SEDFFORM
-	my @simpleeditdefaultforma = ( 
+	my @importpubforma = (
 	{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/src.png" alt="'.$lt{srch}.'"  onclick="javascript:groupsearch()" />' => "$uploadtag<a class='LC_menubuttons_link' href='javascript:groupsearch()'>$lt{'srch'}</a>" },
 	{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{impo}.'"  onclick="javascript:groupimport();"/>' => "<a class='LC_menubuttons_link' href='javascript:groupimport();'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" },
 	{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/wishlist.png" alt="'.$lt{lnks}.'" onclick="javascript:open_StoredLinks_Import();" />' => "<a class='LC_menubuttons_link' href='javascript:open_StoredLinks_Import();'>$lt{'lnks'}</a>" },
+        { '<img class="LC_noBorder LC_middle" src="/res/adm/pages/sequence.png" alt="'.$lt{impm}.'" onclick="javascript:toggleMap();" />' => $importpubform }
 	);
-	$simpleeditdefaultform .= &create_form_ul(&create_list_elements(@simpleeditdefaultforma));
-	$simpleeditdefaultform .=(<<SEDFFORM);
-	<hr id="bb_hrule" style="width:0px;text-align:left;margin-left:0" />
-	$lt{'copm'}<br />
-	<input type="text" size="40" name="importmap" /><br />
-	<span class="LC_nobreak" style="float:left"><input type="button"
-	onclick="javascript:openbrowser('simpleeditdefault','importmap','sequence,page','')"
-	value="$lt{'selm'}" /> <input type="submit" name="loadmap" value="$lt{'load'}" />
-	$help{'Load_Map'}</span>
-	</form>
-SEDFFORM
+	$importpubform = &create_form_ul(&create_list_elements(@importpubforma));
 
       my $extresourcesform=(<<ERFORM);
       <a class="LC_menubuttons_link" href="javascript:toggleUpload('ext');">$lt{'extr'}</a>$help{'Adding_External_Resource'}
@@ -3920,7 +3925,7 @@
 
 my %orderhash = (
                 'aa' => ['Import Content',$fileuploadform],
-                'bb' => ['Published Content',$simpleeditdefaultform],
+                'bb' => ['Published Content',$importpubform],
                 'cc' => ['Grading Resources',$gradingform],
                 );
 unless ($env{'form.pagepath'}) {
@@ -4562,10 +4567,22 @@
         }
         document.getElementById('upload'+blocks[i]+'form').style.display=disp;
     }
-    resize_scrollbox('contentscroll','1','0');
+    resize_scrollbox('contentscroll','1','1');
+    return;
+}
+
+function toggleMap() {
+    var disp = 'none';
+    var curr = document.getElementById('importmapform').style.display;
+    if (curr == 'none') {
+        disp='block';
+    }
+    document.getElementById('importmapform').style.display=disp;
+    resize_scrollbox('contentscroll','1','1');
     return;
 }
 
+
 function extUrlPreview(caller) {
     if (document.getElementById(caller)) {
         var url = document.getElementById(caller).value;




More information about the LON-CAPA-cvs mailing list