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

amueller lon-capa-cvs-allow@mail.lon-capa.org
Wed, 19 Nov 2008 11:58:29 -0000


amueller		Wed Nov 19 11:58:29 2008 EDT

  Added files:                 
    /loncom/interface	lontemplate.pm 
  Log:
  new file integrated in the loncapa system. This file (lontemplate.pm) include services for template creation.
  

Index: loncom/interface/lontemplate.pm
+++ loncom/interface/lontemplate.pm
package Apache::lontemplate;


use strict;
use Apache::Constants qw(:common);
use Apache::loncommon;
use Apache::lonnet;
use Apache::lontexconvert;
use Apache::lonfeedback;
use Apache::lonrss();
use Apache::lonlocal;
use Apache::lonmsgdisplay();
use HTML::Entities();


sub print_template
{	
	my ($r,$topic,$content) = @_;
	$r->print('<div class="DivContentBoxSpecial">');
	$r->print('<h4 class="hcell">'.$topic.'</h4>');
	$r->print('<d1 class="ListStyleClean"><blockquote>'.$content.'</blockquote></d1>');
	$r->print('</div>');
}

sub print_editbox_template
{
	my ($r,$content,$field) = @_;
	$r->print('<br /><textarea cols="80" rows="6" name="'.$field.'">'.
                           &HTML::Entities::encode($content,'"&<>').
           '</textarea><input type="submit" name="storesyl" value="'.
                           &mt('Save').'" />');

}

1;