Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3880d657

Von Sven Schöling vor etwa 12 Jahren hinzugefügt

  • ID 3880d6570d3ee1d0f26e54887defcf49f359b9a9
  • Vorgänger d2c9cb3b
  • Nachfolger 6eb48ef9

Erste Version Frameless

Unterschiede anzeigen:

SL/Controller/Base.pm
84 84

  
85 85
    } else {
86 86
      $::form->{title} = $locals{title} if $locals{title};
87
      $::form->header;
87
      $::form->header(no_menu => $options->{no_menu});
88 88
    }
89 89
  }
90 90

  
SL/Controller/FrameHeader.pm
6 6
sub action_header {
7 7
  my ($self) = @_;
8 8

  
9
  delete $::form->{stylesheet};
10 9
  $::form->use_stylesheet('frame_header/header.css');
11
  $self->render('menu/header',
10
  $self->render('menu/header', { partial => 1, no_output => 1 },
12 11
                now        => DateTime->now_local,
13 12
                is_fastcgi => scalar($::dispatcher->interface_type =~ /fastcgi/i),
14 13
                is_links   => scalar($ENV{HTTP_USER_AGENT}         =~ /links/i));
SL/Controller/LoginScreen.pm
19 19
  return if $self->_redirect_to_main_script_if_already_logged_in;
20 20

  
21 21
  # Otherwise show the login form.
22
  $self->render('login_screen/user_login');
22
  $self->render('login_screen/user_login', { no_menu => 1 });
23 23
}
24 24

  
25 25
sub action_logout {
......
27 27

  
28 28
  $::auth->destroy_session;
29 29
  $::auth->create_or_refresh_session;
30
  $self->render('login_screen/user_login', error => $::locale->text('You are logged out!'));
30
  $self->render('login_screen/user_login', { no_menu => 1 }, error => $::locale->text('You are logged out!'));
31 31
}
32 32

  
33 33
sub action_login {
......
54 54
  # Other login errors.
55 55
  if (0 > $result) {
56 56
    $::auth->punish_wrong_login;
57
    return $self->render('login_screen/user_login', error => $::locale->text('Incorrect username or password!'));
57
    return $self->render('login_screen/user_login', { no_menu => 1 }, error => $::locale->text('Incorrect username or password!'));
58 58
  }
59 59

  
60 60
  # Everything is fine.
......
83 83

  
84 84
  return $self->redirect_to($::form->{callback}) if $::form->{callback};
85 85

  
86
  my %style_to_script_map = (
87
    v3  => 'v3',
88
    neu => 'new',
89
    v4  => 'v4',
90
  );
91

  
92
  my $menu_script = $style_to_script_map{$user->{menustyle}} || '';
93

  
94
  $self->redirect_to(controller => "menu${menu_script}.pl", action => 'display');
86
  $self->redirect_to(controller => "login.pl", action => 'company_logo');
95 87
}
96 88

  
97 89
sub _redirect_to_main_script_if_already_logged_in {
SL/Form.pm
489 489

  
490 490
  $::lxdebug->leave_sub and return if !$ENV{HTTP_USER_AGENT} || $self->{header}++;
491 491

  
492
  my $layout;
493
  $layout = $self->layout unless $params{no_menu};
494

  
492 495
  my $css_path = $self->get_stylesheet_for_user;
493 496

  
494 497
  $self->{favicon} ||= "favicon.ico";
......
516 519
  push @header, sprintf "<script type='text/javascript'>top.document.title='%s';</script>",
517 520
    join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title};
518 521

  
519
  # if there is a title, we put some JavaScript in to the page, wich writes a
520
  # meaningful title-tag for our frameset.
521
  my $title_hack = '';
522
  if ($self->{title}) {
523
    $title_hack = qq|
524
    <script type="text/javascript">
525
    <!--
526
      // Write a meaningful title-tag for our frameset.
527
      top.document.title="| . $self->{"title"} . qq| - | . $self->{"login"} . qq| - | . $::myconfig{dbname} . qq| - V| . $self->{"version"} . qq|";
528
    //-->
529
    </script>|;
530
  }
531

  
532 522
  my  %doctypes = (
533 523
    strict       => qq|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">|,
534 524
    transitional => qq|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">|,
......
557 547

  
558 548
  </script>
559 549
  $params{extra_code}
560
  $title_hack
561 550
 </head>
551
 <body>
562 552

  
563 553
EOT
554
  print $layout;
555

  
556
  print "<div id='content'>\n";
564 557

  
565 558
  $::lxdebug->leave_sub;
566 559
}
......
3590 3583
  $::myconfig{numberformat} = $saved_numberformat;
3591 3584
}
3592 3585

  
3586
sub layout {
3587
  my ($self) = @_;
3588
  $::lxdebug->enter_sub;
3589

  
3590
  my %style_to_script_map = (
3591
    v3  => 'v3',
3592
    neu => 'new',
3593
    v4  => 'v4',
3594
  );
3595

  
3596
  my $menu_script = $style_to_script_map{$::myconfig{menustyle}} || '';
3597

  
3598
  package main;
3599
  require "bin/mozilla/menu$menu_script.pl";
3600
  package Form;
3601
  require SL::Controller::FrameHeader;
3602

  
3603

  
3604
  my $layout = SL::Controller::FrameHeader->new->action_header . ::render();
3605

  
3606
  $::lxdebug->leave_sub;
3607
  return $layout;
3608
}
3609

  
3593 3610
1;
3594 3611

  
3595 3612
__END__
bin/mozilla/menu.pl
44 44

  
45 45
use List::MoreUtils qw(apply);
46 46

  
47
# end of main
48

  
49
sub display {
47
sub render {
50 48
  $::lxdebug->enter_sub;
51 49

  
52
  my $callback  = $::form->unescape($::form->{callback});
53
  $callback     = URI->new($callback)->rel($callback) if $callback;
54
  $callback     = "login.pl?action=company_logo"      if $callback =~ /^(\.\/)?$/;
55
  my $framesize = _calc_framesize();
56

  
57
  $::form->header(doctype => 'frameset');
58

  
59
  print qq|
60
<frameset rows="28px,*" cols="*" framespacing="0" frameborder="0">
61
  <frame  src="controller.pl?action=FrameHeader/header" scrolling="NO">
62
  <frameset cols="$framesize,*" framespacing="0" frameborder="0" border="0" id="menuframe" name="menuframe">
63
    <frame src="$::form->{script}?action=acc_menu" name="acc_menu"  scrolling="auto" noresize marginwidth="0">
64
    <frame src="$callback" name="main_window" scrolling="auto">
65
  </frameset>
66
  <noframes>
67
  You need a browser that can read frames to see this page.
68
  </noframes>
69
</frameset>
70
</HTML>
71
|;
72

  
73
  $::lxdebug->leave_sub;
74
}
75

  
76
sub acc_menu {
77
  $::lxdebug->enter_sub;
50
  $::form->use_stylesheet(qw(css/icons16.css css/icons24.css));
78 51

  
79
  $::form->{stylesheet} = [ qw(css/icons16.css css/icons24.css ) ];
80

  
81
  my $framesize    = _calc_framesize() - 2;
82 52
  my $menu         = Menu->new("menu.ini");
83
  $::form->{title} = $::locale->text('kivitendo');
84
  $::form->header;
85 53

  
86 54
  my $sections = [ section_menu($menu) ];
87 55

  
88
  print $::form->parse_html_template('menu/menu', {
89
    framesize => $framesize,
56
  $::form->parse_html_template('menu/menu', {
90 57
    sections  => $sections,
58
    inline    => 1,
91 59
  });
92

  
93
  $::lxdebug->leave_sub;
94 60
}
95 61

  
96 62
sub section_menu {
97
  $::lxdebug->enter_sub;
63
  $::lxdebug->enter_sub(2);
98 64
  my ($menu, $level, $id_prefix) = @_;
99 65
  my @menuorder = $menu->access_control(\%::myconfig, $level);
100 66
  my @items;
......
114 80

  
115 81
    $menuitem->{module} ||= $::form->{script};
116 82
    $menuitem->{action} ||= "section_menu";
117
    $menuitem->{target} ||= "main_window";
118 83
    $menuitem->{href}   ||= "$menuitem->{module}?action=$menuitem->{action}";
119 84

  
120 85
    # add other params
......
159 124
    $id++;
160 125
  }
161 126

  
162
  $::lxdebug->leave_sub;
127
  $::lxdebug->leave_sub(2);
163 128
  return @items;
164 129
}
165 130

  
css/lx-office-erp/menu.css
304 304
#html-menu .m span.ms { float: left; width: 32px }
305 305
#html-menu .sm span.ms { float: left; width: 24px; background: url(../../image/unterpunkt.png); }
306 306
#html-menu div.m { height: 24px }
307
#html-menu div.m span.mic { color:blue; position: relative; top: 5px; }
307
#html-menu div.m span.mic { color:blue; position: relative; top: 4px }
308 308
#html-menu div.m:hover,
309 309
#html-menu div.i:hover { color:blue; background-color: lemonchiffon; cursor: pointer; }
310 310
#html-menu span.mic { white-space: normal; display: inline-block; vertical-align: top; line-height: 1.2; }
......
313 313
#html-menu div.s1 { padding-left: 8px }
314 314
#html-menu div.s2 { padding-left: 16px }
315 315

  
316
#content { margin-left: 190px }
316 317

  
318
body { margin: 0 }
templates/webpages/menu/header.html
1 1
[%- USE T8 %]
2
[%- UNLESS inline %]
2 3
<body class="frame-header">
4
[%- END %]
3 5
<div class="frame-header">
4 6
[% UNLESS is_links %]
5 7
 <span class="frame-header-element frame-header-left">
......
28 30
  [% now.hms %]
29 31
 </span>
30 32
</div>
33
[%- UNLESS inline %]
31 34
</body>
32 35
</html>
36
[%- END %]
templates/webpages/menu/menu.html
1 1
[%- USE JSON %]
2
<body class="menu">
3 2
<div id='html-menu'></div>
4 3
<script type='text/javascript'>$(function(){$([% JSON.json(sections) %]).each(function(i,b){var a=$('<a class="ml">').append($('<span class="mii ms">').append($('<div>').addClass(b.i)),$('<span class="mic">').append(b.l));if(b.h)a.attr('href', b.h);if(b.t)a.attr('target', b.t);$('#html-menu').append($('<div class="mi">').addClass(b.c).addClass(b.s).attr('id','mi'+b.id).append(a));});$('#html-menu div.i, #html-menu div.sm').hide();$('#html-menu div.m').each(function(){$(this).click(function(){$('#html-menu div.mi').not('div.m').not('[id^='+$(this).attr('id')+'_]').hide();$('#html-menu div.mi[id^='+$(this).attr('id')+'_]').toggle()})})})</script>
5
</body>
6
</html>

Auch abrufbar als: Unified diff