[Jifty-commit] r5067 - in jifty/trunk: lib/Jifty/Plugin
Jifty commits
jifty-commit at lists.jifty.org
Thu Feb 7 14:27:17 EST 2008
Author: sartak
Date: Thu Feb 7 14:27:17 2008
New Revision: 5067
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/Halo.pm
Log:
r51455 at onn: sartak | 2008-02-07 14:25:55 -0500
Halo pod coverage
Modified: jifty/trunk/lib/Jifty/Plugin/Halo.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Halo.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Halo.pm Thu Feb 7 14:27:17 2008
@@ -18,6 +18,12 @@
=cut
+=head2 init
+
+Only enable halos in DevelMode. Add our instrumentation to L<Template::Declare>.
+
+=cut
+
sub init {
my $self = shift;
return if $self->_pre_init;
@@ -36,8 +42,13 @@
Template::Declare->around_template(sub { $self->around_template(@_) });
}
-# parts of why this is.. weird is because we want to play nicely with Mason
-# halos
+=head2 around_template
+
+This is called to instrument L<Template::Declare> templates. We also draw a halo
+around the template itself.
+
+=cut
+
sub around_template {
my ($self, $orig, $path, $args, $code) = @_;
@@ -69,6 +80,13 @@
Template::Declare->buffer->append($self->halo_footer($frame));
}
+=head2 halo_header frame -> string
+
+This will give you the halo header which includes links to the various
+information displays for this template.
+
+=cut
+
sub halo_header {
my $self = shift;
my $frame = shift;
@@ -103,6 +121,13 @@
HEADER
}
+=head2 halo_footer frame -> string
+
+This will give you the halo footer which includes the actual information to
+be displayed when the user pokes the halo.
+
+=cut
+
sub halo_footer {
my $self = shift;
my $frame = shift;
@@ -144,6 +169,12 @@
FOOTER
}
+=head2 new_frame -> hashref
+
+Gives you a new frame for storing halo information.
+
+=cut
+
sub new_frame {
my $self = shift;
@@ -203,6 +234,15 @@
};
}
+=head2 push_frame -> frame
+
+Creates and pushes a frame onto the render stack. Mason's halos do not support
+"around"ing a component, so we fake it with an explicit stack.
+
+This also triggers C<halo_pre_template> for plugins adding halo data.
+
+=cut
+
sub push_frame {
my $self = shift;
@@ -223,6 +263,15 @@
return $frame;
}
+=head2 pop_frame -> frame
+
+Pops a frame off the render stack. Mason's halos do not support
+"around"ing a component, so we fake it with an explicit stack.
+
+This also triggers C<halo_post_template> for plugins adding halo data.
+
+=cut
+
sub pop_frame {
my $self = shift;
More information about the Jifty-commit
mailing list