File:  [LON-CAPA] / loncom / interface / lontemplate.pm
Revision 1.1: download - view: text, annotated - select for diffs
Wed Nov 19 11:58:29 2008 UTC (15 years, 7 months ago) by amueller
Branches: MAIN
CVS tags: HEAD
new file integrated in the loncapa system. This file (lontemplate.pm) include services for template creation.

    1: package Apache::lontemplate;
    2: 
    3: 
    4: use strict;
    5: use Apache::Constants qw(:common);
    6: use Apache::loncommon;
    7: use Apache::lonnet;
    8: use Apache::lontexconvert;
    9: use Apache::lonfeedback;
   10: use Apache::lonrss();
   11: use Apache::lonlocal;
   12: use Apache::lonmsgdisplay();
   13: use HTML::Entities();
   14: 
   15: 
   16: sub print_template
   17: {	
   18: 	my ($r,$topic,$content) = @_;
   19: 	$r->print('<div class="DivContentBoxSpecial">');
   20: 	$r->print('<h4 class="hcell">'.$topic.'</h4>');
   21: 	$r->print('<d1 class="ListStyleClean"><blockquote>'.$content.'</blockquote></d1>');
   22: 	$r->print('</div>');
   23: }
   24: 
   25: sub print_editbox_template
   26: {
   27: 	my ($r,$content,$field) = @_;
   28: 	$r->print('<br /><textarea cols="80" rows="6" name="'.$field.'">'.
   29:                            &HTML::Entities::encode($content,'"&<>').
   30:            '</textarea><input type="submit" name="storesyl" value="'.
   31:                            &mt('Save').'" />');
   32: 
   33: }
   34: 
   35: 1;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>