Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4a12c839

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

  • ID 4a12c839937370488b8b8a40bef376e7cb0a2ce6
  • Vorgänger 3ab26ffc
  • Nachfolger 0164607c

Layouts eingeführt

bin/mozilla/menu* -> SL/Controller/Layout/*

Unterschiede anzeigen:

SL/Form.pm
451 451
  my $self = shift;
452 452

  
453 453
  $self->{stylesheet} = [ $self->{stylesheet} ] unless ref $self->{stylesheet} eq 'ARRAY';
454
  $self->{stylesheet} = [ grep { -f                       }
455
                          map  { m:^css/: ? $_ : "css/$_" }
456
                          grep { $_                       }
457
                               (@{ $self->{stylesheet} }, @_)
458
                        ];
454

  
455
  if (@_) {
456
    $self->{stylesheet} =
457
      [ grep { -f                       }
458
        map  { m:^css/: ? $_ : "css/$_" }
459
        grep { $_                       }
460
             (@{ $self->{stylesheet} }, @_)
461
      ];
462
  }
459 463

  
460 464
  return @{ $self->{stylesheet} };
461 465
}
......
489 493

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

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

  
495 496
  my $css_path = $self->get_stylesheet_for_user;
496 497

  
497 498
  $self->{favicon} ||= "favicon.ico";
498
  $self->{titlebar}  = "$self->{title} - $self->{titlebar}" if $self->{title};
499
  $self->{titlebar} = join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title};
499 500

  
500 501
  # build includes
501 502
  if ($self->{refresh_url} || $self->{refresh_time}) {
......
504 505
    push @header, "<meta http-equiv='refresh' content='$refresh_time;$refresh_url'>";
505 506
  }
506 507

  
507
  push @header, map { qq|<link rel="stylesheet" href="$_" type="text/css" title="Stylesheet">| } $self->use_stylesheet;
508
  push @header, map { qq|<link rel="stylesheet" href="$_" type="text/css" title="Stylesheet">| } $self->use_stylesheet, $::request->{layout}->stylesheets;
508 509

  
509 510
  push @header, "<style type='text/css'>\@page { size:landscape; }</style>" if $self->{landscape};
510 511
  push @header, "<link rel='shortcut icon' href='$self->{favicon}' type='image/x-icon'>" if -f $self->{favicon};
......
516 517
  push @header, map { qq|<link rel="stylesheet" type="text/css" href="js/jscalendar/calendar-win2k-1.css">| }
517 518
  push @header, map { $_->show_javascript } @{ $self->{AJAX} || [] };
518 519
  push @header, "<script type='text/javascript'>function fokus(){ document.$self->{fokus}.focus(); }</script>" if $self->{fokus};
519
  push @header, sprintf "<script type='text/javascript'>top.document.title='%s';</script>",
520
    join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title};
521 520

  
522 521
  my  %doctypes = (
523 522
    strict       => qq|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">|,
......
551 550
 <body>
552 551

  
553 552
EOT
554
  print $layout;
555

  
556
  print "<div id='content'>\n";
553
  print $::request->{layout}->pre_content;
554
  print $::request->{layout}->start_content;
557 555

  
558 556
  $::lxdebug->leave_sub;
559 557
}
560 558

  
559
sub footer {
560
  # TODO: fix abort conditions
561

  
562
  print $::request->{layout}->post_content;
563
  print "<script type='text/javascript' src='$_'></script>\n" for $::request->{layout}->javascripts;
564
  if (my @inline_scripts = $::request->{layout}->javascript_inline) {
565
    print "<script type='text/javascript'>$_</script>\n" for @inline_scripts;
566
  }
567

  
568
  print <<EOL
569
 </body>
570
</html>
571
EOL
572
}
573

  
561 574
sub ajax_response_header {
562 575
  $main::lxdebug->enter_sub();
563 576

  

Auch abrufbar als: Unified diff