cvsuser 02/11/01 12:25:59
Modified: App-Widget/lib/App Widget.pm
Log:
moved App::Context snippet to App::Context
Revision Changes Path
1.3 +10 -9 p5ee/App-Widget/lib/App/Widget.pm
Index: Widget.pm
===================================================================
RCS file: /cvs/public/p5ee/App-Widget/lib/App/Widget.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- Widget.pm 25 Oct 2002 19:50:19 -0000 1.2
+++ Widget.pm 1 Nov 2002 20:25:59 -0000 1.3
@@ -1,16 +1,10 @@
######################################################################
-## $Id: Widget.pm,v 1.2 2002/10/25 19:50:19 spadkins Exp $
+## $Id: Widget.pm,v 1.3 2002/11/01 20:25:59 spadkins Exp $
######################################################################
-package App::Context;
-
-# add a convenience function to the App::Context package
-sub widget { my $self = shift; return $self->service("SessionObject",@_); }
-sub template_engine { my $self = shift; return $self->service("TemplateEngine",@_);
}
-
package App::Widget;
-$VERSION = do { my @r=(q$Revision: 1.2 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
+$VERSION = do { my @r=(q$Revision: 1.3 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
use App::SessionObject;
@ISA = ( "App::SessionObject" );
@@ -99,7 +93,7 @@
EOF
}
- my ($title, $bodyoptions, $w, $var, $value, $context_body, $context_head);
+ my ($title, $bodyoptions, $w, $var, $value, $context_body, $context_head,
$session_html);
$title = "Widget";
$bodyoptions = "";
@@ -122,6 +116,7 @@
$context_body = "";
#$context_head = $self->{context}->head_html();
#$context_body = $self->{context}->body_html(\%main::conf);
+ $session_html = $self->{context}->session()->html();
my $content = <<EOF;
<html>
@@ -130,6 +125,7 @@
$context_head</head>
<body${bodyoptions}>
<form method="POST">
+$session_html
$context_body
$html
</form>
@@ -265,6 +261,11 @@
$text =~ s{>}{>}gso;
$text =~ s{\"}{"}gso;
return $text;
+}
+
+sub html {
+ my ($self) = @_;
+ return $self->html_escape($self->{name});
}
# get the URL of the host