[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonsimplepage.pm lontemplate.pm

www www@source.lon-capa.org
Tue, 03 May 2011 21:38:40 -0000


www		Tue May  3 21:38:40 2011 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonsimplepage.pm lontemplate.pm 
  Log:
  "Content" does not need to show up in print 
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1002 loncom/interface/loncommon.pm:1.1003
--- loncom/interface/loncommon.pm:1.1002	Tue Mar  1 14:06:39 2011
+++ loncom/interface/loncommon.pm	Tue May  3 21:38:40 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1002 2011/03/01 14:06:39 droeschl Exp $
+# $Id: loncommon.pm,v 1.1003 2011/05/03 21:38:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -436,6 +436,25 @@
 ENDSTDBRW
 }
 
+sub resourcebrowser_javascript {
+   unless ($env{'request.course.id'}) { return ''; }
+   return (<<'ENDSTDBRW');
+<script type="text/javascript" language="Javascript">
+// <![CDATA[
+    var reseditbrowser;
+    function openresbrowser(formname,uname,udom,clicker,roleflag,ignorefilter,courseadvonly) {
+        var url = '/adm/pickresource?';
+        var title = 'Resource_Browser';
+        var options = 'scrollbars=1,resizable=1,menubar=0';
+        options += ',width=700,height=600';
+        stdeditbrowser = open(url,title,options,'1');
+        stdeditbrowser.focus();
+    }
+// ]]>
+</script>
+ENDSTDBRW
+}
+
 sub selectstudent_link {
    my ($form,$unameele,$udomele,$courseadvonly,$clickerid)=@_;
    my $callargs = "'".&Apache::lonhtmlcommon::entity_encode($form)."','".
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.97 loncom/interface/lonsimplepage.pm:1.98
--- loncom/interface/lonsimplepage.pm:1.97	Wed Oct 27 01:00:38 2010
+++ loncom/interface/lonsimplepage.pm	Tue May  3 21:38:40 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.97 2010/10/27 01:00:38 raeburn Exp $
+# $Id: lonsimplepage.pm,v 1.98 2011/05/03 21:38:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -113,7 +113,7 @@
 # --------------------------------------------------------- The syllabus fields
     my %syllabusfields=&Apache::lonlocal::texthash(
        'aaa_title'         => 'Page Title',
-       'bbb_content'       => 'Content',
+       'bbb_content'       => ($target eq 'tex'?'':'Content'),
        'ccc_webreferences' => 'Web References');
     if ($group ne '') {
         $syllabusfields{'abb_links'} = &mt('Available Group Tools');
Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.44 loncom/interface/lontemplate.pm:1.45
--- loncom/interface/lontemplate.pm:1.44	Tue Apr 27 02:44:57 2010
+++ loncom/interface/lontemplate.pm	Tue May  3 21:38:40 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "Template" Functions to generate html output
 #
-# $Id: lontemplate.pm,v 1.44 2010/04/27 02:44:57 faziophi Exp $
+# $Id: lontemplate.pm,v 1.45 2011/05/03 21:38:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -176,8 +176,12 @@
 					&Apache::lontemplate::print_end_template($r);
 				} else {
 				    my $safeinit;
-                    $r->print(&Apache::lonxml::xmlparse($r,'tex','<h3>'.$fields{$field}.'</h3>'));
-                    $r->print(&Apache::lonxml::xmlparse($r,'tex',$message));
+                                    if ($fields{$field}=~/\w/) {
+                                       $r->print(&Apache::lonxml::xmlparse($r,'tex','<h3>'.$fields{$field}.'</h3>'));
+                                    } else {
+                                       $r->print(&Apache::lonxml::xmlparse($r,'tex','<br />'));
+                                    }
+                                    $r->print(&Apache::lonxml::xmlparse($r,'tex',$message));
 				}
 				push(@html_ids,$field);
 			}