NAME

OpenGuides::CGI - An OpenGuides helper for CGI-related things.

DESCRIPTION

Does CGI stuff for OpenGuides. Distributed and installed as part of the OpenGuides project, not intended for independent installation. This documentation is probably only useful to OpenGuides developers.

SYNOPSIS

use Config::Tiny;
use OpenGuides::CGI;
use OpenGuides::Template;
use OpenGuides::Utils;

my $config = Config::Tiny->read( "wiki.conf" );

my $cookie = OpenGuides::CGI->make_prefs_cookie(
    config                 => $config,
    username               => "Kake",
    include_geocache_link  => 1,
    preview_above_edit_box => 1,
    latlong_traditional    => 1,
    omit_help_links        => 1,
    show_minor_edits_in_rc => 1,
    default_edit_type      => "tidying",
);

my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );
print OpenGuides::Template->output( wiki     => $wiki,
                                    config   => $config,
                                    template => "preferences.tt",
                                    cookies  => $cookie
);

# and to retrive prefs later:
my %prefs = OpenGuides::CGI->get_prefs_from_cookie(
    config => $config
);

METHODS

my $cookie = OpenGuides::CGI->make_prefs_cookie(
    config                 => $config,
    username               => "Kake",
    include_geocache_link  => 1,
    preview_above_edit_box => 1,
    latlong_traditional    => 1,
    omit_help_links        => 1,
    show_minor_edits_in_rc => 1,
    default_edit_type      => "tidying",
);

Croaks unless a Config::Tiny object is supplied as config.

my %prefs = OpenGuides::CGI->get_prefs_from_cookie(
    config => $config
);

Croaks unless a Config::Tiny object is supplied as config. Returns default values for any parameter not specified in cookie.

AUTHOR

The OpenGuides Project (openguides-dev@openguides.org)

COPYRIGHT

Copyright (C) 2003-4 The OpenGuides Project.  All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.