Revision 83a428a3
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/Controller/DebugMenu.pm | ||
---|---|---|
1 |
package SL::Controller::DebugMenu; |
|
2 |
|
|
3 |
use strict; |
|
4 |
use parent qw(SL::Controller::Base); |
|
5 |
|
|
6 |
# safety |
|
7 |
__PACKAGE__->run_before(sub { die 'not allowed in config' unless $::lx_office_conf{debug}{show_debug_menu}; }); |
|
8 |
|
|
9 |
sub action_reload { |
|
10 |
my ($self, %params) = @_; |
|
11 |
|
|
12 |
print $::request->{cgi}->redirect('controller.pl?action=FrameHeader/header'); |
|
13 |
exit; |
|
14 |
} |
|
15 |
|
|
16 |
sub action_toggle { |
|
17 |
my ($self, %params) = @_; |
|
18 |
|
|
19 |
$::lxdebug->level_by_name($::form->{level}, !$::lxdebug->level_by_name($::form->{level})); |
|
20 |
print $::request->{cgi}->redirect('controller.pl?action=FrameHeader/header'); |
|
21 |
return; |
|
22 |
} |
|
23 |
|
|
24 |
1; |
SL/Controller/FrameHeader.pm | ||
---|---|---|
1 |
package SL::Controller::FrameHeader; |
|
2 |
|
|
3 |
use strict; |
|
4 |
use parent qw(SL::Controller::Base); |
|
5 |
|
|
6 |
sub action_header { |
|
7 |
my ($self) = @_; |
|
8 |
|
|
9 |
$::form->use_stylesheet('frame_header/header.css'); |
|
10 |
$self->render('menu/header', { partial => 1, no_output => 1 }, |
|
11 |
now => DateTime->now_local, |
|
12 |
is_fastcgi => scalar($::dispatcher->interface_type =~ /fastcgi/i), |
|
13 |
is_links => scalar($ENV{HTTP_USER_AGENT} =~ /links/i)); |
|
14 |
} |
|
15 |
|
|
16 |
1; |
SL/LXDebug.pm | ||
---|---|---|
453 | 453 |
# This does trigger: |
454 | 454 |
$::form->{some_hash} = { something => 'else' }; |
455 | 455 |
|
456 |
=item C<show_debug_menu> |
|
457 |
|
|
458 |
A boolean (C<1> or C<0>). If turned on then certain debug facilities |
|
459 |
are available from the v1 menu. These include e.g. |
|
460 |
|
|
461 |
=over 6 |
|
462 |
|
|
463 |
=item * |
|
464 |
|
|
465 |
restarting the FastCGI process by forcefully exiting after the |
|
466 |
request, |
|
467 |
|
|
468 |
=item * |
|
469 |
|
|
470 |
enabling and disabling function tracing, |
|
471 |
|
|
472 |
=item * |
|
473 |
|
|
474 |
enabling and disabling certain debug levels. |
|
475 |
|
|
476 |
=back |
|
477 |
|
|
478 |
Note that these are only useful if kivitendo is running as a FastCGI |
|
479 |
application because otherwise the changes would be lost when the |
|
480 |
process exits in a normal CGI environment. |
|
481 |
|
|
482 | 456 |
=item C<keep_temp_files> |
483 | 457 |
|
484 | 458 |
A boolean (C<1> or C<0>). If turned on then certain temporary files |
config/kivitendo.conf.default | ||
---|---|---|
277 | 277 |
# default. |
278 | 278 |
watch_form = 0 |
279 | 279 |
|
280 |
# Include menu options for debugging in the HTML menu. Works only in |
|
281 |
# FastCGI mode. |
|
282 |
show_debug_menu = 0 |
|
283 |
|
|
284 | 280 |
# If you want to debug the creation of LaTeX files then set this to 1. |
285 | 281 |
# That way the temporary LaTeX files created during PDF creation are |
286 | 282 |
# not removed and remain in the "users" directory. |
templates/webpages/menu/header.html | ||
---|---|---|
8 | 8 |
[<a href="Javascript:top.history.back();" title="[% 'Go one step back' | $T8 %]">[% 'Back' | $T8 %]</a>] |
9 | 9 |
[<a href="Javascript:top.history.forward();" title="[% 'Go one step forward' | $T8 %]">[% 'Fwd' | $T8 %]</a>] |
10 | 10 |
</span> |
11 |
[%- END %] |
|
12 |
[% IF is_fastcgi && LXCONFIG.debug.show_debug_menu %] |
|
13 |
<span class="frame-header-element frame-header-center"> |
|
14 |
Debug: |
|
15 |
[<a href='controller.pl?action=DebugMenu/reload'>FCGI Reload</a>] |
|
16 |
[<a href='controller.pl?action=DebugMenu/toggle&level=request_timer'>[% IF LXDEBUG.level_by_name('request_timer') %]<b>Timing</b>[% ELSE %]Timing[% END %]</a>] |
|
17 |
[<a href='controller.pl?action=DebugMenu/toggle&level=trace'>[% IF LXDEBUG.level_by_name('trace') %]<b>Trace</b>[% ELSE %]Trace[% END %]</a>] |
|
18 |
[<a href='controller.pl?action=DebugMenu/toggle&level=query'>[% IF LXDEBUG.level_by_name('query') %]<b>Query</b>[% ELSE %]Query[% END %]</a>] |
|
19 |
[<a href='controller.pl?action=DebugMenu/toggle&level=warn'>[% IF LXDEBUG.level_by_name('warn') %]<b>Warnings</b>[% ELSE %]Warnings[% END %]</a>] |
|
20 |
</span> |
|
21 | 11 |
[%- END %] |
22 | 12 |
<span class="frame-header-element frame-header-right"> |
23 | 13 |
[% 'User' | $T8 %]: |
Auch abrufbar als: Unified diff
DebugMenu entfernt, weil es momentan nicht mehr funktioniert