[LON-CAPA-cvs] cvs: loncom /interface groupsort.pm /localize/localize de.pm

bisitz bisitz@source.lon-capa.org
Fri, 13 Mar 2009 15:39:44 -0000


bisitz		Fri Mar 13 15:39:44 2009 EDT

  Modified files:              
    /loncom/localize/localize	de.pm 
    /loncom/interface	groupsort.pm 
  Log:
  Optimizations and corrections for import of resources from bookmarks:
  - Now correct button name in bookmark environment
  - Display informal message if no resources to import from bookmarks
  - Only display (header of) content table if content exists
  
  
  
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.254 loncom/localize/localize/de.pm:1.255
--- loncom/localize/localize/de.pm:1.254	Fri Mar 13 15:12:08 2009
+++ loncom/localize/localize/de.pm	Fri Mar 13 15:39:38 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.254 2009/03/13 15:12:08 bisitz Exp $
+# $Id: de.pm,v 1.255 2009/03/13 15:39:38 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11777,6 +11777,9 @@
    'Import Resources from Bookmarks'
 => 'Ressourcen aus Lesezeichen importieren',
 
+   'There are no resources in your bookmarks to import.'
+=> 'Es gibt keine Ressourcen in Ihren Lesezeichen, die importiert werden können.',
+
    'Import Checked'
 => 'Auswahl importieren',
 
Index: loncom/interface/groupsort.pm
diff -u loncom/interface/groupsort.pm:1.64 loncom/interface/groupsort.pm:1.65
--- loncom/interface/groupsort.pm:1.64	Fri Mar 13 11:45:27 2009
+++ loncom/interface/groupsort.pm	Fri Mar 13 15:39:43 2009
@@ -2,7 +2,7 @@
 # The LON-CAPA group sort handler
 # Allows for sorting prior to import into RAT.
 #
-# $Id: groupsort.pm,v 1.64 2009/03/13 11:45:27 bisitz Exp $
+# $Id: groupsort.pm,v 1.65 2009/03/13 15:39:43 bisitz Exp $
 # 
 # Copyright Michigan State University Board of Trustees
 #
@@ -347,10 +347,14 @@
 
         $r->print(&Apache::loncommon::inhibit_menu_check('input'));
         # ---
-    
-        if ($env{'form.recover'}) {
+
+        my $buttontext = $lt{'re'};
+        if ($env{'form.bookmarks'}) {
+            $buttontext = $lt{'ip'}
+        }
+        if ($env{'form.recover'} || $env{'form.bookmarks'}) {
 	    $r->print(<<END);
-<input type="button" name="alter" value="$lt{'re'}"
+<input type="button" name="alter" value="$buttontext"
  onClick="finish_import()" />&nbsp;
 <input type="button" name="alter" value="$lt{'ca'}" onClick="self.close()" />
 END
@@ -372,17 +376,26 @@
 <br />
 END
         }
-        $r->print(&Apache::loncommon::start_data_table()
-                 .&Apache::loncommon::start_data_table_header_row());
-	if (($env{'form.readfile'}) || ($env{'form.bookmarks'})) { 
-	    $r->print("<th>$lt{'in'}</th>\n");
-	} else { 
-	    $r->print('<th colspan="2">'.$lt{'co'}.'</th>'."\n"); 
-	}
-	$r->print('<th colspan="2">'.$lt{'ti'}.'</th>'."\n");
-	$r->print("<th>$lt{'pa'}</th>");
-        $r->print(&Apache::loncommon::end_data_table_header_row()
-                 ."\n");
+
+        # Only display header if content exists
+        if ($clen > 0) {
+            $r->print(&Apache::loncommon::start_data_table()
+                     .&Apache::loncommon::start_data_table_header_row());
+            if (($env{'form.readfile'}) || ($env{'form.bookmarks'})) { 
+                $r->print("<th>$lt{'in'}</th>\n");
+            } else { 
+                $r->print('<th colspan="2">'.$lt{'co'}.'</th>'."\n"); 
+            }
+            $r->print('<th colspan="2">'.$lt{'ti'}.'</th>'."\n");
+            $r->print("<th>$lt{'pa'}</th>");
+            $r->print(&Apache::loncommon::end_data_table_header_row()."\n");
+        } else {
+            $r->print('<p class="LC_info">');
+            if ($env{'form.bookmarks'}) {
+                $r->print(&mt('There are no resources in your bookmarks to import.'));
+            }
+            $r->print('</p>');
+        }
     } else {
 	$r->print(&Apache::loncommon::start_page(undef,$js,
 						 {'only_body' => 1}));
@@ -428,8 +441,10 @@
 	} 
     }
     if (($clen > 1) || ($env{'form.readfile'}) || ($env{'form.bookmarks'})) {
-        $r->print(&Apache::loncommon::end_data_table()
-                 ."</form>");
+        if ($clen > 0) {
+            $r->print(&Apache::loncommon::end_data_table());
+        }
+        $r->print('</form>');
     } else {
 	$r->print(<<END);
 <script type="text/javascript">