
macro/util - some utility functions

<import src="macro/util"/>

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

Create a plain and ugly html header (with an optional title).
Create a plain and ugly html footer.
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 ;)
<:}:>
]]>]]<<
PApp.

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