Revision 66fab876
Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt
SL/Controller/Base.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use Carp; |
8 | 8 |
use IO::File; |
9 |
use List::MoreUtils qw(apply); |
|
9 | 10 |
use List::Util qw(first); |
11 |
use SL::HelpSystem; |
|
10 | 12 |
use SL::Request qw(flatten); |
11 | 13 |
use SL::MoreCommon qw(uri_encode); |
12 | 14 |
use SL::Presenter; |
... | ... | |
228 | 230 |
} |
229 | 231 |
} |
230 | 232 |
|
233 |
# |
|
234 |
# Other class methods |
|
235 |
# |
|
236 |
|
|
237 |
sub override_help_contexts { |
|
238 |
my $class = shift; |
|
239 |
my $controller = apply { s{.+:}{} } $class; |
|
240 |
|
|
241 |
SL::HelpSystem->override_help_contexts($controller, @_); |
|
242 |
} |
|
243 |
|
|
231 | 244 |
# |
232 | 245 |
# behaviour. override these |
233 | 246 |
# |
... | ... | |
244 | 257 |
sub keep_auth_vars_in_form { |
245 | 258 |
return 0; |
246 | 259 |
} |
247 |
|
|
248 | 260 |
# |
249 | 261 |
# private functions -- for use in Base only |
250 | 262 |
# |
... | ... | |
628 | 640 |
|
629 | 641 |
=back |
630 | 642 |
|
643 |
=head2 OTHER CLASS FUNCTIONS |
|
644 |
|
|
645 |
=over 4 |
|
646 |
|
|
647 |
=item C<override_help_contexts %help_contexts> |
|
648 |
|
|
649 |
Created overrides for the help context auto-detection by |
|
650 |
L<SL::HelpSystem/context>. The keys given in the hash are action names |
|
651 |
for which the help context is overridden. |
|
652 |
|
|
653 |
The value can contain a slash in which case its used |
|
654 |
verbatim. Otherwise value is taken to be an action name in the calling |
|
655 |
controller and the controller's name will be prepended. |
|
656 |
|
|
657 |
For example, in this example both targets will effectively be |
|
658 |
C<BackgroundJob/edit>: |
|
659 |
|
|
660 |
|
|
661 |
package SL::Controller::BackgroundJob; |
|
662 |
|
|
663 |
use parent qw(SL::Controller::Base); |
|
664 |
|
|
665 |
__PACKAGE__->set_help_contexts( |
|
666 |
new => 'edit', |
|
667 |
create => 'BackgroundJob/edit', |
|
668 |
); |
|
669 |
|
|
670 |
=back |
|
671 |
|
|
631 | 672 |
=head2 PRIVATE FUNCTIONS |
632 | 673 |
|
633 | 674 |
These functions are supposed to be used from this base class only. |
Auch abrufbar als: Unified diff
Hilfesystem: Hilfe-Link anzeigen; Hilfe-Seiten zu Kontext anzeigen; Hilfe-Start-Seite