Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b8388d68

Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt

  • ID b8388d6875acac67b5a7d2fb0a8203d6426fea1e
  • Vorgänger 1132e5ed
  • Nachfolger 66fab876

Dispatcher: aktuellen Controller, Action, Routing-Typ in Request-Objekt speichern

Unterschiede anzeigen:

SL/Dispatcher.pm
23 23
use Encode;
24 24
use English qw(-no_match_vars);
25 25
use File::Basename;
26
use List::MoreUtils qw(all);
26
use List::MoreUtils qw(apply all);
27 27
use List::Util qw(first);
28 28
use SL::ArchiveZipFixes;
29 29
use SL::Auth;
......
240 240
  $::lxdebug->log_request($routing_type, $script_name, $action);
241 241

  
242 242
  $::request->type(lc($routing{request_type} || 'html'));
243
  $::request->routing_type($routing{type});
244
  $::request->controller(apply { s{.*/|\.pl$}{}g } $routing{controller});
243 245

  
244 246
  if ($routing_type eq 'old') {
245 247
    $::form->{action}  =  lc $::form->{action};
......
250 252

  
251 253
    $::form->{script} = $script . $suffix;
252 254

  
255
    my $actual_action = $::locale->findsub($routing{action});
256
    $actual_action    = apply { s{^action_}{} } first { m{^action_} && $::form->{$_} } keys %{ $::form } if $actual_action eq 'dispatcher';
257

  
258
    $::request->action($actual_action);
259

  
253 260
  } else {
254 261
    _require_controller($script_name);
255 262
    $::form->{script} = "controller.pl";
263
    $::request->action($routing{action});
256 264
  }
257 265

  
258 266
  eval {
......
324 332
    $self->{request}->Finish;
325 333
  }
326 334

  
327
  $::lxdebug->end_request(routing_type => $routing_type, script_name => $script_name, action => $action);
335
  $::lxdebug->end_request;
328 336

  
329 337
  # cleanup
330 338
  $::auth->save_session;

Auch abrufbar als: Unified diff