|
Lines 44-49
BEGIN {
Link Here
|
| 44 |
|
44 |
|
| 45 |
Koha::Plugins - Module for loading and managing plugins. |
45 |
Koha::Plugins - Module for loading and managing plugins. |
| 46 |
|
46 |
|
|
|
47 |
=head2 new |
| 48 |
|
| 49 |
Constructor |
| 50 |
|
| 47 |
=cut |
51 |
=cut |
| 48 |
|
52 |
|
| 49 |
sub new { |
53 |
sub new { |
|
Lines 62-67
Calls a plugin method for all enabled plugins
Link Here
|
| 62 |
|
66 |
|
| 63 |
@responses = Koha::Plugins->call($method, @args) |
67 |
@responses = Koha::Plugins->call($method, @args) |
| 64 |
|
68 |
|
|
|
69 |
Note: Pass your arguments as refs, when you want subsequent plugins to use the value |
| 70 |
updated by preceding plugins, provided that these plugins support that. |
| 71 |
|
| 65 |
=cut |
72 |
=cut |
| 66 |
|
73 |
|
| 67 |
sub call { |
74 |
sub call { |
|
Lines 96-102
method or metadata value.
Link Here
|
| 96 |
}); |
103 |
}); |
| 97 |
|
104 |
|
| 98 |
The method and metadata parameters are optional. |
105 |
The method and metadata parameters are optional. |
| 99 |
Available methods currently are: 'report', 'tool', 'to_marc', 'edifact'. |
|
|
| 100 |
If you pass multiple keys in the metadata hash, all keys must match. |
106 |
If you pass multiple keys in the metadata hash, all keys must match. |
| 101 |
|
107 |
|
| 102 |
=cut |
108 |
=cut |
|
Lines 168-174
This method iterates through all plugins physically present on a system.
Link Here
|
| 168 |
For each plugin module found, it will test that the plugin can be loaded, |
174 |
For each plugin module found, it will test that the plugin can be loaded, |
| 169 |
and if it can, will store its available methods in the plugin_methods table. |
175 |
and if it can, will store its available methods in the plugin_methods table. |
| 170 |
|
176 |
|
| 171 |
NOTE: We re-load all plugins here as a protective measure in case someone |
177 |
NOTE: We reload all plugins here as a protective measure in case someone |
| 172 |
has removed a plugin directly from the system without using the UI |
178 |
has removed a plugin directly from the system without using the UI |
| 173 |
|
179 |
|
| 174 |
=cut |
180 |
=cut |
|
Lines 220-249
sub InstallPlugins {
Link Here
|
| 220 |
1; |
226 |
1; |
| 221 |
__END__ |
227 |
__END__ |
| 222 |
|
228 |
|
| 223 |
=head1 AVAILABLE HOOKS |
|
|
| 224 |
|
| 225 |
=head2 after_hold_create |
| 226 |
|
| 227 |
=head3 Parameters |
| 228 |
|
| 229 |
=over |
| 230 |
|
| 231 |
=item * C<$hold> - A Koha::Hold object that has just been inserted in database |
| 232 |
|
| 233 |
=back |
| 234 |
|
| 235 |
=head3 Return value |
| 236 |
|
| 237 |
None |
| 238 |
|
| 239 |
=head3 Example |
| 240 |
|
| 241 |
sub after_hold_create { |
| 242 |
my ($self, $hold) = @_; |
| 243 |
|
| 244 |
warn "New hold for borrower " . $hold->borrower->borrowernumber; |
| 245 |
} |
| 246 |
|
| 247 |
=head1 AUTHOR |
229 |
=head1 AUTHOR |
| 248 |
|
230 |
|
| 249 |
Kyle M Hall <kyle.m.hall@gmail.com> |
231 |
Kyle M Hall <kyle.m.hall@gmail.com> |
| 250 |
- |
|
|