Skip to content

Commit

Permalink
Admin plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mrenvoize authored and kylemhall committed Mar 20, 2024
1 parent 5fe48a6 commit fde827b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ sub tool {
}
}

## The existance of an 'admin' subroutine means the plugin has some functionality that
## should only be available to Koha librarians with administrative privileges.
##
## Such plugins will be displayed in the admin page and work in a similar way to the 'tool'
## system above.
sub admin {
my ( $self, $args ) = @_;

my $cgi = $self->{'cgi'};

my $template = $self->get_template( { file => 'admin_example.tt' } );

$self->output_html( $template->output() );
return;
}

## The existiance of a 'to_marc' subroutine means the plugin is capable
## of converting some type of file to MARC for use from the stage records
## for import tool
Expand Down
36 changes: 36 additions & 0 deletions Koha/Plugin/Com/ByWaterSolutions/KitchenSink/admin_example.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha: KitchenSink - Admin</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>

<body>
[% WRAPPER 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
[% END %]

<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
&rsaquo; <a href="/cgi-bin/koha/plugins/plugins-home.pl">Plugins</a>
&rsaquo; KitchenSink
&rsaquo; Administration
</div>

<div class="main container-fluid">
<div class="row">
<div class="col-sm-12">
<main>
<h1>Administration demonstration</h1>
<div class="page-section">
<pre>You could do all sorts of administration worthy things on a page like this</pre>
</div>

<div class="page-section">
Lots of shiny, shiny things.
</div>
</main>
</div>
</div>
</div>

[% INCLUDE 'intranet-bottom.inc' %]

0 comments on commit fde827b

Please sign in to comment.