commit 081432fe4eab648efc6d01f6df371a464e50404e Author: Mikael Nordin Date: Fri Jun 3 15:25:58 2016 +0200 Initial commit diff --git a/hello/description.txt b/hello/description.txt new file mode 100644 index 0000000..0dc6954 --- /dev/null +++ b/hello/description.txt @@ -0,0 +1,4 @@ +The 'Hello World' plugin displays the words "Hello World!" on the +plugin page hello.cgi. + +Url: hello.cgi diff --git a/hello/lib/Thruk/Controller/hello.pm b/hello/lib/Thruk/Controller/hello.pm new file mode 100644 index 0000000..42a6223 --- /dev/null +++ b/hello/lib/Thruk/Controller/hello.pm @@ -0,0 +1,37 @@ +package Thruk::Controller::hello; + +use strict; +use warnings; + +=head1 NAME + +Thruk::Controller::hello - Hello World! + +=head1 DESCRIPTION + +Hello World!. + +=head1 METHODS + +=cut + + +=head2 index + +=cut + +sub index { + my ( $c ) = @_; + $c->stash->{title} = 'Hello World!'; + $c->stash->{template} = 'hello.tt'; + $c->stash->{hello_var} = 'Hello World!'; # This is our magic variable +} + +=head1 LICENSE + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; diff --git a/hello/preview.png b/hello/preview.png new file mode 100644 index 0000000..0406157 Binary files /dev/null and b/hello/preview.png differ diff --git a/hello/routes b/hello/routes new file mode 100644 index 0000000..b1a0bbc --- /dev/null +++ b/hello/routes @@ -0,0 +1,15 @@ +########################################################## + +=head2 add_routes + +page: /thruk/cgi-bin/hello.cgi + +=cut + +$routes->{'/thruk/cgi-bin/hello.cgi'} = 'Thruk::Controller::hello::index'; + +# add new menu item +Thruk::Utils::Menu::insert_item('System', { + 'href' => '/thruk/cgi-bin/hello.cgi', + 'name' => 'Hello World!', +}); diff --git a/hello/templates/hello.tt b/hello/templates/hello.tt new file mode 100644 index 0000000..53d3bd1 --- /dev/null +++ b/hello/templates/hello.tt @@ -0,0 +1,12 @@ + + + + [% title_prefix %][% title %] + + + + + +

[% hello_var %]

+ +