Author: spadkins
Date: Tue Jan  9 16:18:02 2007
New Revision: 8535

Modified:
   p5ee/trunk/App-Context/lib/App/Response.pm

Log:
added ability to include chunks of HTML in the <HEAD> by name

Modified: p5ee/trunk/App-Context/lib/App/Response.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Response.pm  (original)
+++ p5ee/trunk/App-Context/lib/App/Response.pm  Tue Jan  9 16:18:02 2007
@@ -213,23 +213,24 @@
 
 sub include {
     &App::sub_entry if ($App::trace);
-    my ($self, $type, $content) = @_;
-    if (!$self->{include}{$type}{$content}) {
+    my ($self, $type, $content, $key) = @_;
+    $key = $content if (!$key);
+    if (!$self->{include}{$type}{$key}) {
         if (!$self->{include}{"${type}_list"}) {
             $self->{include}{"${type}_list"} = [ $content ];
         }
         else {
             push(@{$self->{include}{"${type}_list"}}, $content);
         }
-        $self->{include}{$type}{$content} = 1;
+        $self->{include}{$type}{$key} = 1;
     }
     &App::sub_exit() if ($App::trace);
 }
 
 sub is_included {
     &App::sub_entry if ($App::trace);
-    my ($self, $type, $content) = @_;
-    my $included = $self->{include}{$type}{$content};
+    my ($self, $type, $key) = @_;
+    my $included = (defined $self->{include}{$type}{$key});
     &App::sub_exit($included) if ($App::trace);
     return($included);
 }

Reply via email to