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

ehlerst ehlerst@source.lon-capa.org
Tue, 16 Dec 2008 10:41:02 -0000


ehlerst		Tue Dec 16 10:41:02 2008 EDT

  Modified files:              
    /loncom/interface	lontemplate.pm loncommon.pm 
  Log:
  upgraded the function start_ContentBox in lontemplate.pm with new input parameters to decide wether the public view or edit view is enabled.
  inserted new styles for edit view in loncommon.pm.
  
  
Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.8 loncom/interface/lontemplate.pm:1.9
--- loncom/interface/lontemplate.pm:1.8	Wed Dec 10 15:58:36 2008
+++ loncom/interface/lontemplate.pm	Tue Dec 16 10:41:02 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "Template" Functions to generate html output
 #
-# $Id: lontemplate.pm,v 1.8 2008/12/10 15:58:36 ehlerst Exp $
+# $Id: lontemplate.pm,v 1.9 2008/12/16 10:41:02 ehlerst Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -88,8 +88,12 @@
 }
 
 sub start_ContentBox{
-	my ($r) = @_;
-	$r->print('<div class="ContentBox">');
+	my ($r,$allowed) = @_;
+	if($allowed){
+		$r->print('<div class="ContentBoxTemplate">');
+	}else{
+		$r->print('<div class="ContentBox">');
+	}
 }
 
 sub end_ContentBox{
@@ -107,8 +111,12 @@
 
 sub print_template
 {	
-	my ($r,$topic,$content) = @_;
-	$r->print('<div class="ContentBoxSpecial">');
+	my ($r,$topic,$content, $allowed) = @_;
+	if($allowed){
+		$r->print('<div class="ContentBoxSpecialTemplate">');
+	}else{
+		$r->print('<div class="ContentBoxSpecial">');
+	}
 	$r->print('<h4 class="hcell">'.$topic.'</h4>');
 	$r->print('<blockquote>'.$content.'</blockquote>');
 	$r->print('</div>');
@@ -117,7 +125,7 @@
 sub print_editbox_template
 {
 	my ($r,$content,$field) = @_;
-	$r->print('<br /><textarea cols="53" rows="6" name="'.$field.'">'.
+	$r->print('<br /><textarea cols="80" rows="6" name="'.$field.'">'.
                            &HTML::Entities::encode($content,'"&<>').
            '</textarea><input type="submit" name="storesyl" value="'.
                            &mt('Save All').'" />');
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.718 loncom/interface/loncommon.pm:1.719
--- loncom/interface/loncommon.pm:1.718	Mon Dec 15 16:37:44 2008
+++ loncom/interface/loncommon.pm	Tue Dec 16 10:41:02 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.718 2008/12/15 16:37:44 raeburn Exp $
+# $Id: loncommon.pm,v 1.719 2008/12/16 10:41:02 ehlerst Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5702,6 +5702,21 @@
 	width: 400px;
 	
 }
+.ContentBoxSpecialTemplate
+{
+        border: solid 1px $lg_border_color;
+}
+.ContentBoxTemplate {
+        padding:10px;
+}
+
+div.columnSection > .ContentBoxTemplate,
+div.columnSection > .ContentBoxSpecialTemplate
+        {
+        width: 600px;
+
+}
+
 
 .LC_loginpage_container {
 	text-align:left;