Marc Lehmann > PApp > macro/util

Download:
PApp-1.43.tar.gz

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

macro/util - some utility functions

SYNOPSIS ^

 <import src="macro/util"/>

DESCRIPTION ^

This macro package contains some utility functions that make sense in a pure PApp environment only. It's of little use elsewhere.

Functions ^

plain_header [title]

Create a plain and ugly html header (with an optional title).

plain_footer

Create a plain and ugly html footer.

access_page $access, $title, \&body

Create a simple access-protected page. $access is the required access level ("editform" in macro), $title is the page title. The body argument must be a function reference. If the user has the required access right a plain page is created (using the functions above) and the body function is called. Otherwise the user is informed of his missing rights and gets the opportunity to log-in.

Use it like this:

   <phtml><![CDATA[
   <:access_page "app_access", "Main Page", sub {:>
      <h1>Main Page</h1>
      You are logged in now ;)
   <:}:>
   ]]>]]&lt;<![CDATA[

SEE ALSO ^

PApp.

AUTHOR ^

 Marc Lehmann <schmorp@schmorp.de>
 http://www.goof.com/pcg/marc/