CGI::Wiki::Simple::Plugin::Static - Supply static text as node content


CGI-Wiki-Simple documentation Contained in the CGI-Wiki-Simple distribution.

Index


Code Index:

NAME

Top

CGI::Wiki::Simple::Plugin::Static - Supply static text as node content

DESCRIPTION

Top

This node supplies static text for a node. This text can't be changed. You could use a simple HTML file instead. No provisions are made against users wanting to edit the page. They can't save the data though.

SYNOPSIS

Top

  use CGI::Wiki::Simple;
  use CGI::Wiki::Simple::Plugin::Static( Welcome  => "There is an <a href='entrance'>entrance</a>. Speak <a href='Friend'>Friend</a> and <a href='Enter'>Enter</a>.",
                                         Enter    => "The <a href='entrance'>entrance</a> stays closed.",
                                         entrance => "It's a big and strong door.",
                                         Friend   => "You enter the deep dungeons of <a href='Moria'>Moria</a>.",
                                         );
  # nothing else is needed


CGI-Wiki-Simple documentation Contained in the CGI-Wiki-Simple distribution.

package CGI::Wiki::Simple::Plugin::Static;
use CGI::Wiki::Simple::Plugin();

use vars qw($VERSION);
$VERSION = 0.09;

my %static_content;

sub import {
    my ($module,%args) = @_;
    for my $node (keys %args) {
      $static_content{$node} = $args{$node};
      CGI::Wiki::Simple::Plugin::register_nodes(module => $module, name => $node);
    };
};

sub retrieve_node {
  my (%args) = @_;

  return ($static_content{$args{name}},"0","");
};

1;