Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6fb7bcc9

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 6fb7bcc9f1e00bc068a4514a3c7fa599119e6e06
  • Vorgänger b11e5803
  • Nachfolger c7771eec

kopf.pl auf Controller umgestellt

Unterschiede anzeigen:

SL/Controller/DebugMenu.pm
9 9
sub action_reload {
10 10
  my ($self, %params) = @_;
11 11

  
12
  print $::cgi->redirect('kopf.pl');
12
  print $::cgi->redirect('controller.pl?action=FrameHeader/header');
13 13
  exit;
14 14
}
15 15

  
......
17 17
  my ($self, %params) = @_;
18 18

  
19 19
  $::lxdebug->level_by_name($::form->{level}, !$::lxdebug->level_by_name($::form->{level}));
20
  print $::cgi->redirect('kopf.pl');
20
  print $::cgi->redirect('controller.pl?action=FrameHeader/header');
21 21
  return;
22 22
}
23 23

  
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
  delete $::form->{stylesheet};
10
  $::form->use_stylesheet('frame_header/header.css');
11
  $self->render('menu/header',
12
                now        => DateTime->now_local,
13
                is_fastcgi => scalar($::dispatcher->interface_type =~ /fastcgi/i),
14
                is_links   => scalar($ENV{HTTP_USER_AGENT}         =~ /links/i));
15
}
16

  
17
1;
SL/Dispatcher.pm
188 188

  
189 189
    $::form->error($::locale->text('System currently down for maintenance!')) if -e ($::lx_office_conf{paths}->{userspath} . "/nologin") && $script ne 'admin';
190 190

  
191
    if ($script eq 'login' or $script eq 'admin' or $script eq 'kopf') {
191
    if ($script eq 'login' or $script eq 'admin') {
192 192
      $::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}";
193 193
      ::run($session_result);
194 194

  
SL/Form.pm
640 640
  return $output;
641 641
}
642 642

  
643
sub use_stylesheet {
644
  my $self = shift;
645

  
646
  $self->{stylesheet} = [ $self->{stylesheet} ] unless ref $self->{stylesheet} eq 'ARRAY';
647
  $self->{stylesheet} = [ grep { -f                       }
648
                          map  { m:^css/: ? $_ : "css/$_" }
649
                          grep { $_                       }
650
                               (@{ $self->{stylesheet} }, @_)
651
                        ];
652

  
653
  return @{ $self->{stylesheet} };
654
}
643 655

  
644 656
sub header {
645 657
  $::lxdebug->enter_sub;
......
662 674
    push @header, "<meta http-equiv='refresh' content='$refresh_time;$refresh_url'>";
663 675
  }
664 676

  
665
  push @header, "<link rel='stylesheet' href='css/$_' type='text/css' title='Lx-Office stylesheet'>"
666
    for grep { -f "css/$_" } apply { s|.*/|| } $self->{stylesheet}, $self->{stylesheets};
677
  push @header, map { qq|<link rel="stylesheet" href="$_" type="text/css" title="Lx-Office stylesheet">| } $self->use_stylesheet;
667 678

  
668 679
  push @header, "<style type='text/css'>\@page { size:landscape; }</style>" if $self->{landscape};
669 680
  push @header, "<link rel='shortcut icon' href='$self->{favicon}' type='image/x-icon'>" if -f $self->{favicon};
......
1638 1649
  #   Leere Datumseingabe i.O.
1639 1650
  #     SELECT 1 FROM defaults WHERE '' < closedto
1640 1651
  #   normale Zahlungsbuchung ?ber Rechnungsmaske i.O.
1641
  #     SELECT 1 FROM defaults WHERE '10.05.2011' < closedto 
1652
  #     SELECT 1 FROM defaults WHERE '10.05.2011' < closedto
1642 1653
  # Testf?lle mit definiertem closedto (30.04.2011):
1643 1654
  #  Leere Datumseingabe i.O.
1644 1655
  #   SELECT 1 FROM defaults WHERE '' < closedto
......
3812 3823
=head2 C<header>
3813 3824

  
3814 3825
Generates a general purpose http/html header and includes most of the scripts
3815
ans stylesheets needed.
3826
and stylesheets needed. Stylesheets can be added with L<use_stylesheet>.
3816 3827

  
3817 3828
Only one header will be generated. If the method was already called in this
3818 3829
request it will not output anything and return undef. Also if no
......
3832 3843

  
3833 3844
=item stylesheet
3834 3845

  
3835
=item stylesheets
3836

  
3837
If these are arrayrefs the contents will be inlined into the header.
3846
Either a scalar or an array ref. Will be inlined into the header. Add
3847
stylesheets with the L<use_stylesheet> function.
3838 3848

  
3839 3849
=item landscape
3840 3850

  
bin/mozilla/am.pl
504 504

  
505 505
  push(@ { $form->{AJAX} }, $pjx);
506 506

  
507
  $form->{stylesheets} = "list_accounts.css";
507
  $form->use_stylesheet("list_accounts.css");
508 508
  $form->{title}       = $locale->text('Chart of Accounts');
509 509

  
510 510
  $form->header;
bin/mozilla/kopf.pl
1
#!/usr/bin/perl
2

  
3
use strict;
4
use DateTime;
5

  
6
sub run {
7
  my $session_result = shift;
8

  
9
  %::myconfig = $::auth->read_user($::form->{login})  if $::form->{login};
10
  $::locale   = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
11

  
12
  $::form->header;
13
  print $::form->parse_html_template('menu/header', {
14
    now        => DateTime->now,
15
    show_debug => $::lx_office_conf{debug}{show_debug_menu},
16
    lxdebug    => $::lxdebug,
17
    is_links   => ($ENV{HTTP_USER_AGENT} =~ /links/i),
18
  });
19
}
20

  
21
1;
22

  
23
#
bin/mozilla/menu.pl
63 63

  
64 64
  print qq|
65 65
<frameset rows="28px,*" cols="*" framespacing="0" frameborder="0">
66
  <frame  src="kopf.pl" name="kopf"  scrolling="NO">
66
  <frame  src="controller.pl?action=FrameHeader/header" scrolling="NO">
67 67
  <frameset cols="$framesize,*" framespacing="0" frameborder="0" border="0" id="menuframe" name="menuframe">
68 68
    <frame src="$::form->{script}?action=acc_menu" name="acc_menu"  scrolling="auto" noresize marginwidth="0">
69 69
    <frame src="$callback" name="main_window" scrolling="auto">
config/lx_office.conf.default
222 222
# default.
223 223
watch_form = 0
224 224

  
225
# Include menu options for debugging in the HTML menu
225
# Include menu options for debugging in the HTML menu. Works only in
226
# FastCGI mode.
226 227
show_debug_menu = 0
227 228

  
228 229
# If you want to debug the creation of LaTeX files then set this to 1.
css/frame_header/header.css
1
body {
2
  margin: 0;
3
  color: white;
4
  background: url('../../image/fade.png') repeat-x;
5
}
6

  
7
a:link, a:visited, a:hover, a:active {
8
  color: white;
9
}
10

  
11
body > * {
12
  font-size: 12px;
13
  font-family: verdana,arial,sans-serif;
14
  vertical-align: middle;
15
}
16

  
17
table {
18
  border: 0;
19
  width: 100%;
20
  background: url('../../image/bg_titel.gif');
21
  border-spacing: 0;
22
}
23

  
24
td {
25
  padding: 0;
26
}
js/switchmenuframe.js
1
/* This is used in bin/mozilla/kopf.pl to switch the HTML side menu on/off
2
   2010, Sven Donath, lxo@dexo.de  */
3

  
4 1
var vSwitch_Menu = 1;
5 2
var FrameSize = (parent.document.getElementById('menuframe').cols);
6 3

  
scripts/mklinks.sh
1 1
#!/bin/sh
2 2

  
3
for i in am dispatcher kopf login; do
3
for i in am dispatcher login; do
4 4
	rm $i.pl 2> /dev/null
5 5
	ln -s admin.pl $i.pl
6 6
done
7
for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is licenses menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do 
7
for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is licenses menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do
8 8
	rm $i.pl 2> /dev/null
9 9
	ln -s am.pl $i.pl
10 10
done
templates/webpages/menu/header.html
1 1
[%- USE T8 %]
2
<style type='text/css'>
3
  body { margin: 0; color: white; background: url('image/fade.png') repeat-x; }
4
  a:link, a:visited, a:hover, a:active { color:white }
5
  body > * { font-size: 12px; font-family:verdana,arial,sans-serif; vertical-align:middle; }
6
  table { border:0; width: 100%; background: url('image/bg_titel.gif'); border-spacing:0; }
7
  td { padding: 0 }
8
</style>
9
<script language='javascript' src='js/switchmenuframe.js'></script>
2
<script language="javascript" src="js/switchmenuframe.js"></script>
10 3
<body>
11 4
 <table>
12 5
  <tr>
......
19 12
    [<a href="Javascript:top.main_window.history.forward();" title="[% 'Go one step forward' | $T8 %]">[% 'Fwd' | $T8 %]</a>]
20 13
   </td>
21 14
[%- END %]
22
[% IF show_debug %]
15
[% IF is_fastcgi && LXCONFIG.debug.show_debug_menu %]
23 16
   <td align='center' nowrap>
24 17
    Debug:
25 18
    [<a href='controller.pl?action=DebugMenu/reload']>FCGI Reload</a>]
26
    [<a href='controller.pl?action=DebugMenu/toggle&level=request_timer'>[% IF lxdebug.level_by_name('request_timer') %]<b>Timing</b>[% ELSE %]Timing[% END %]</a>]
27
    [<a href='controller.pl?action=DebugMenu/toggle&level=trace'>[% IF lxdebug.level_by_name('trace') %]<b>Trace</b>[% ELSE %]Trace[% END %]</a>]
28
    [<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=request_timer'>[% IF LXDEBUG.level_by_name('request_timer') %]<b>Timing</b>[% ELSE %]Timing[% END %]</a>]
20
    [<a href='controller.pl?action=DebugMenu/toggle&level=trace'>[% IF LXDEBUG.level_by_name('trace') %]<b>Trace</b>[% ELSE %]Trace[% END %]</a>]
21
    [<a href='controller.pl?action=DebugMenu/toggle&level=query'>[% IF LXDEBUG.level_by_name('query') %]<b>Query</b>[% ELSE %]Query[% END %]</a>]
29 22
   </td>
30 23
[%- END %]
31 24
   <td align="right" nowrap>

Auch abrufbar als: Unified diff