Linux SoftwareProgrammingLibrariesOpenInteract::UI::Main 1.62

OpenInteract::UI::Main 1.62


OpenInteract::UI::Main is the primary user interface assembly 'conductor'. SYNOPSIS my $page = OpenInteract::UI::Mai
Developer:   Chris Winters
      more software by author →
Price:  0.00
License:   Perl Artistic License
File size:   642K
Language:   
OS:   
Rating:   0 /5 (0 votes)
Your vote:  
enlarge screenshot


OpenInteract::UI::Main is the primary user interface assembly 'conductor'.

SYNOPSIS

my $page = OpenInteract::UI::Main->handler();
send_http_headers();
print $page;

# Subclass to define a new method for looking up template names:

package OpenInteract::UI::LanguageChoice;

use base qw( OpenInteract::UI::Main );

my $DEFAULT_LANGUAGE = 'en';

sub choose_template {
my ( $class ) = @_;
my ( $language );
if ( $R->{auth}{is_logged_in} ) {
$language = $R->{auth}{user}->language;
}
$language ||= $R->apache->param( 'lang' )
|| $R->{session}{lang}
|| $DEFAULT_LANGUAGE;
my $R = OpenInteract::Request->instance;
my $template = $R->{theme}->property_value( "template_$language" )
|| $R->{theme}->property_value( 'main_template' );
return $template;
}

This is the handler that puts the main content generated together with the template that surrounds the content on every page.

The action has already been parsed from the URL for us so we look up the class/method used to generate the content and call them. We then put that content into the main template which is specified in our theme, unless we have received another directive to use a separate template or no template at all.

Another alternative is that the content handler needs to return a file that is not HTML, such as a PDF, graphic, word processing document, archive, or whatever. If so the content handler should put the complete filename in the $R->{page}->{send_file} key.

A content author can set a main template to use for the generated content by setting:

$R->{page}{_template_name_}

to the name of the template to use. This should be a fully-qualified template name -- such as 'mypkg::mytemplate'. If you do not specify a package the OI template provider will try to find the template in the global template directory.

You can also set a template that might vary by theme. This is not the name of the template directly but rather a placeholder within the theme which holds the name of the template. For instance, say you created a 'spooky_template' and implemented it in multiple themes. Even though you as an author do not know what theme will be used, you can still pick the right template by setting:

$R->{page}{_template_key_}

And to use the 'simple' template, the author should set:

$R->{page}{_simple_}

to a true value. The default 'simple' template is 'base_simple', although you can set its name under the template_names key of your server configuration.

Finally, the author can also set:

$R->{page}{_no_template_}

to display the content without a template at all.

Main Template Variables

Any content handler can send information to be placed directly onto the main template by setting information using the $R->{main_template_vars} hashref. For instance:

$R->{main_template_vars}{current_weather} = 'Rainy and cold';

would set the 'current_weather' template variable for display on the main template and not on any of the content handlers.

Note that while this sounds useful (and it can be), you will probably use it only very rarely. The 'boxes' concept is more comprehensive and full-featured and will almost certainly do what you need.

Requirements:
  • Perl
    tags the content  main template  the template  the main  content handler  the name  you can  also set  can also  for instance  {main template  the author  template and  

    Download OpenInteract::UI::Main 1.62


     http://ftp.casaafacerilor.ro/mirrors/CPAN/authors/id/C/CW/CWINTERS/OpenInteract-1.62.tar.gz


    Authors software

    OpenInteract2::Conversion::ActionConfig 1.99_06 (by Chris Winters)
    OpenInteract2::Conversion::ActionConfig is a Perl module that can convert old action.perl files into INI configurations.

    SYNOPSIS

    OpenInteract::UI::Main 1.62 (by Chris Winters)
    OpenInteract::UI::Main is the primary user interface assembly 'conductor'.

    SYNOPSIS

    my $page = OpenInteract::UI::Mai

    SPOPS::Manual::Configuration 0.87 (by Chris Winters)
    SPOPS::Manual::Configuration is a description of variables used in the SPOPS configuration process.

    These are variables used in al


    Similar software

    OpenInteract::UI::Main 1.62 (by Chris Winters)
    OpenInteract::UI::Main is the primary user interface assembly 'conductor'.

    SYNOPSIS

    my $page = OpenInteract::UI::Mai

    Template::Tutorial 2.15 (by Andy Wardley)
    Template::Tutorial are template toolkit tutorials.

    This section includes tutorials on using the Template Toolkit

    Template::Tutorial::Web 2.15 (by Andy Wardley)
    Template::Tutorial::Web is a Perl module for generating web content using the template toolkit.

    This tutorial document provides a

    libhtmlTemplate 1.1.0 (by Rui Barreiros)
    libhtmlTemplate, is a library to aid developers to separate content from code

    HTML::DWT 2.08 (by S.D. Campbell)

    Template::Magic 1.38 (by Domizio Demichelis)

    Class::DBI::Template::Stash 0.03 (by Jason Kohles)
    Class::DBI::Template::Stash is a Perl module with Template::Stash subclass for Class::DBI::Template.

    SYNOPSIS

    package Music::

    MfGames.Template 1.1.0 (by Dylan R. E. Moonfire)
    The MfGames.Template library is a C# native library for creating template libaries.

    MfGames.Template was inspired by NVelocity, bu

    SmartTemplate 1.2.1 (by EndelWar)
    SmartTemplate is a Template Engine that was designed to support large scale, web based applications.

    What's so special about it?

    Template::Plugin::XML 2.16 (by Andy Wardley)
    Template::Plugin::XML is a XML plugin for the Template Toolkit.

    SYNOPSIS

    [% USE XML;
    dom = XML.dom('foo.xml');


    Other software in this category

    zlib 1.2.3 (by Jean-loup Gailly)
    zlib is designed to be a free, general-purpose, legally unencumbered, lossless data-compression library for use on virtually any comp

    libjpeg v6b (by Independent JPEG Group)
    libjpeg is a library for handling the JPEG (JFIF) image format

    OpenSSL 0.9.7c (by The OpenSSL Project Team)
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implement

    libxml2 2.6.27 (by DV)
    Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), libxml2 library i

    GNU C library 2.4 (by Andreas Jaeger)
    GNU C library (glibc) is one of the most important components of GNU Hurd and most modern Linux distributions.

    GNU C library is us

  •     search


    Featured Software

    jEdit 4.3 pre8
    jEdit is an Open Source text editor written in Java

    Opera 9.02
    Surf the Internet in a safer, faster, and easier way with Opera browser

    GNU Aspell 0.60.4
    GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell


    Subscribe in Rojo
    Google Reader
    Add to My Yahoo!

    Add to My AOL
    Subscribe with Bloglines
    Subscribe in NewsGator Online
    Add 'nixbit linux software' to Newsburst from CNET News.com
    del.icio.us nixbit linux software


    Top tags