Apache2-PageKit

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	- Renamed <PKIT_*> tags as follows:
	  <PKIT_IF NAME="VIEW:view"> -> <PKIT_VIEW NAME="view">
	  <PKIT_LOOP NAME="MESSAGE"> -> <PKIT_MESSAGES>, <PKIT_IS_ERROR>, <PKIT_MESSAGE>
	  <PKIT_VAR NAME="HOSTNAME"> -> <PKIT_HOSTNAME>
	- support for relative and absolute names for PKIT_COMPONENT
	- you may now place static HTML files in the pagekit/View/Default
		or View/pkit_view directories.
		If pagekit can not locate the approriate
		template/xml file, it will return declined, but set
		the filepath so that apache returns the files.
	- fixed up static handing with default_page and not_found_page
		(Boris Zentner)
	- Replaced MyPageKit::Common with __PACKAGE__ in Common.pm
		(Boris Zentner)

0.99
	- document() function now works in XML::XPathTemplate
	- logins are redirected to selfurl if there is no pkit_done param
	- merged View/Component and Page directories.
	- $model->input_param -> $model->input, $model->fillinform, $model->pnotes
	- $model->output_param -> $model->output

docsrc/reference.xml  view on Meta::CPAN

   <variablelist>
    <varlistentry id="config.global.cache_dir">
     <term>cache_dir</term>
     <listitem>
      <para>
       Specifies the directory where the PageKit Template cache files are stored.
       Defaults to <filename>View/pkit_cache</filename>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry id="config.global.cookies_not_set_page">
     <term>cookies_not_set_page</term>
     <listitem>
      <para>
This is the page that gets displayed if the user attempts to log in,
but their cookies are not enabled.  Defaults to <literal><link linkend="config.global.login_page">login_page</link></literal>.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry id="config.global.default_errorstr">
     <term>default_errorstr</term>

docsrc/reference.xml  view on Meta::CPAN

     <term>model_dispatch_prefix</term>
     <listitem>
      <para>
This prefixeds the <link linkend="model.dispatch">Derived Model Classes</link>.  Defaults to MyPageKit::MyModel.
      </para>
      <para>
Methods in this class take an derived Apache::PageKit::Model object as their only argument.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry id="config.global.not_found_page">
     <term>not_found_page</term>
     <listitem>
      <para>
Error page when page cannot be found.  Defaults to <literal><link linkend="config.global.default_page">default_page</link></literal>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry id="config.global.page_session">
     <term>page_session</term>
     <listitem>
      <para>

docsrc/reference.xml  view on Meta::CPAN

      </synopsis>
     </refsynopsisdiv>
     <refsect1>
      <title>Description</title>
      <para>
        Include the block between &lt;PKIT_HAVE_MESSAGES&gt; and &lt;/PKIT_HAVE_MESSAGES&gt; only,
        if one or more messages are avail.
      </para>
     </refsect1>
    </refentry>
    <refentry id="pkit.have_not_messages">
     <refnamediv>
      <refname>PKIT_HAVE_NOT_MESSAGES</refname>
      <refpurpose>
       Include the block between &lt;PKIT_HAVE_NOT_MESSAGES&gt; and &lt;/PKIT_HAVE_NOT_MESSAGES&gt; only,
       if no messages are avail.
      </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
      <synopsis>
       <![CDATA[<PKIT_HAVE_NOT_MESSAGES>

docsrc/reference.xml  view on Meta::CPAN

     <refsynopsisdiv>
      <synopsis>
       &lt;PKIT_VIEW NAME="print"&gt;This is text display for the printable view&lt;PKIT_ELSE&gt;And this text if hte view is NOT printable&lt;/PKIT_VIEW&gt;
      </synopsis>
     </refsynopsisdiv>
     <refsect1>
      <title>Description</title>
      <para>
            Can be used to add a else part to <link linkend="pkit.view">PKIT_VIEW</link>,
       <link linkend="pkit.have_messages">PKIT_HAVE_MESSAGES</link>,
       <link linkend="pkit.have_not_messages">PKIT_HAVE_NOT_MESSAGES</link>,
       <link linkend="pkit.is_error">PKIT_IS_ERROR</link> or
       <link linkend="pkit.not_error">PKIT_NOT_ERROR</link>.
      </para>
     </refsect1>
    </refentry>
    
       <refentry id="pkit.is_error">
     <refnamediv>
      <refname>PKIT_IS_ERROR</refname>
      <refpurpose>
       Used to display messages only if it is a errormessage.
      </refpurpose>

docsrc/reference.xml  view on Meta::CPAN

     </refsynopsisdiv>
     <refsect1>
      <title>Description</title>
      <para>
       Used to display messages only if it is a errormessage. Or display errors and warnings in different places.

      </para>
     </refsect1>
    </refentry>

          <refentry id="pkit.not_error">
     <refnamediv>
      <refname>PKIT_NOT_ERROR</refname>
      <refpurpose>
       Used to display messages only if it is a NOT a errormessage.
      </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
      <synopsis>

    <![CDATA[

eg/Config/PageKit_Config-0.97.dtd  view on Meta::CPAN

<!ELEMENT CONFIG (GLOBAL,SERVERS,PAGES)>
<!ELEMENT GLOBAL EMPTY>
<!ATTLIST GLOBAL
	cache_dir			CDATA	#IMPLIED
	cookies_not_set_page		CDATA	#IMPLIED
	default_lang			CDATA	"en"
	default_page			CDATA	"index"
	login_page			CDATA	"login"
	not_found_page			CDATA	#IMPLIED
	model_base_class		CDATA	"MyPageKit::Common"
	model_dispatch_prefix		CDATA	"MyPageKit::MyModel"
	post_max			CDATA	"100000000"
	recent_login_timeout		CDATA	"3600"
	request_param_in_tmpl		CDATA	"no"
	session_expires			CDATA	#IMPLIED
	uri_prefix			CDATA	#IMPLIED
	verify_page			CDATA	#IMPLIED>
<!ELEMENT SERVERS (SERVER)*>
<!ELEMENT SERVER EMPTY>

lib/Apache2/PageKit.pm  view on Meta::CPAN

	# we deliver silently http://xyz.abc.de/my_dir/some_default_page
	# but all relative links on some_default_page get
	# http://xyz.abc.de/_the_link_ istead of
	# http://xyz.abc.de/my_dir/_the_link_
	# so we redirect better ...
        $apr->headers_out->{Location} = $pk->{page_id} . '/';
	return REDIRECT;
      }

      $pk->{page_id} = $config->uri_match($pk->{page_id})
	|| $config->get_global_attr('not_found_page')
	|| $model->pkit_get_default_page;
      unless ($pk->page_exists($pk->{page_id})){
	# if not_found_page is static, then return DECLINED...
	$filename = $pk->static_page_exists($pk->{page_id});
      }
    }}
    if ($filename){
      my $require_login  = $config->get_page_attr($pk->{page_id},'require_login') || 'no';
      my $protect_static = $config->get_global_attr('protect_static') || 'yes';
      if ( $require_login eq 'no' || $protect_static ne 'yes' ) {
        # return the static page only, if no parameters are attached to the uri
	# otherwise we can not login logout and so on when one the default or index
	# or whatever page is static.

lib/Apache2/PageKit.pm  view on Meta::CPAN


#	$apr->user(undef);
      }
    }
  }
  else {
    # check if cookies should be set
    my $pkit_check_cookie = $apr->param('pkit_check_cookie');
    if(defined($pkit_check_cookie) && $pkit_check_cookie eq 'on'){
      # cookies should be set but aren't.
      if($config->get_global_attr('cookies_not_set_page')){
	# display "cookies are not set" error page.
	$pk->{page_id} = $config->get_global_attr('cookies_not_set_page');
	$pk->{browser_cache} = 'no';

      } else {
	# display login page with error message
	$pk->{page_id} = $config->get_global_attr('login_page');
	$model->pkit_gettext_message('Cookies must be enabled in your browser.', is_error => 1);
      }
    }

    my $require_login = $config->get_page_attr($pk->{page_id},'require_login');



( run in 1.356 second using v1.01-cache-2.11-cpan-cc502c75498 )