Revision 60d0f05f
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
bin/mozilla/am.pl | ||
---|---|---|
614 | 614 |
$main::lxdebug->leave_sub(); |
615 | 615 |
} |
616 | 616 |
|
617 |
sub add_language { |
|
618 |
$main::lxdebug->enter_sub(); |
|
619 |
|
|
620 |
my $form = $main::form; |
|
621 |
|
|
622 |
$main::auth->assert('config'); |
|
623 |
|
|
624 |
$form->{title} = "Add"; |
|
625 |
|
|
626 |
$form->{callback} = "am.pl?action=add_language" unless $form->{callback}; |
|
627 |
|
|
628 |
&language_header; |
|
629 |
&form_footer; |
|
630 |
|
|
631 |
$main::lxdebug->leave_sub(); |
|
632 |
} |
|
633 |
|
|
634 |
sub edit_language { |
|
635 |
$main::lxdebug->enter_sub(); |
|
636 |
|
|
637 |
my $form = $main::form; |
|
638 |
my %myconfig = %main::myconfig; |
|
639 |
|
|
640 |
$main::auth->assert('config'); |
|
641 |
|
|
642 |
$form->{title} = "Edit"; |
|
643 |
|
|
644 |
AM->get_language(\%myconfig, \%$form); |
|
645 |
|
|
646 |
&language_header; |
|
647 |
|
|
648 |
$form->{orphaned} = 1; |
|
649 |
&form_footer; |
|
650 |
|
|
651 |
$main::lxdebug->leave_sub(); |
|
652 |
} |
|
653 |
|
|
654 |
sub list_language { |
|
655 |
$::lxdebug->enter_sub; |
|
656 |
$::auth->assert('config'); |
|
657 |
|
|
658 |
AM->language(\%::myconfig, $::form); |
|
659 |
|
|
660 |
$::form->{callback} = "am.pl?action=list_language"; |
|
661 |
$::form->{title} = $::locale->text('Languages'); |
|
662 |
|
|
663 |
$::form->header; |
|
664 |
|
|
665 |
print $::form->parse_html_template('am/language_list'); |
|
666 |
|
|
667 |
$::lxdebug->leave_sub; |
|
668 |
} |
|
669 |
|
|
670 |
sub language_header { |
|
671 |
$::lxdebug->enter_sub; |
|
672 |
$::auth->assert('config'); |
|
673 |
|
|
674 |
# $locale->text('Add Language') |
|
675 |
# $locale->text('Edit Language') |
|
676 |
$::form->{title} = $::locale->text("$::form->{title} Language"); |
|
677 |
|
|
678 |
$::form->header; |
|
679 |
|
|
680 |
print $::form->parse_html_template('am/language_header', { |
|
681 |
numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00', "1'000.00" ], |
|
682 |
dateformats => [ qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ], |
|
683 |
}); |
|
684 |
|
|
685 |
$::lxdebug->leave_sub; |
|
686 |
} |
|
687 |
|
|
688 |
sub save_language { |
|
689 |
$main::lxdebug->enter_sub(); |
|
690 |
|
|
691 |
my $form = $main::form; |
|
692 |
my %myconfig = %main::myconfig; |
|
693 |
my $locale = $main::locale; |
|
694 |
|
|
695 |
$main::auth->assert('config'); |
|
696 |
|
|
697 |
$form->isblank("description", $locale->text('Language missing!')); |
|
698 |
$form->isblank("template_code", $locale->text('Template Code missing!')); |
|
699 |
$form->isblank("article_code", $locale->text('Article Code missing!')); |
|
700 |
AM->save_language(\%myconfig, \%$form); |
|
701 |
$form->redirect($locale->text('Language saved!')); |
|
702 |
|
|
703 |
$main::lxdebug->leave_sub(); |
|
704 |
} |
|
705 |
|
|
706 |
sub delete_language { |
|
707 |
$main::lxdebug->enter_sub(); |
|
708 |
|
|
709 |
my $form = $main::form; |
|
710 |
my %myconfig = %main::myconfig; |
|
711 |
my $locale = $main::locale; |
|
712 |
|
|
713 |
$main::auth->assert('config'); |
|
714 |
|
|
715 |
AM->delete_language(\%myconfig, \%$form); |
|
716 |
$form->redirect($locale->text('Language deleted!')); |
|
717 |
|
|
718 |
$main::lxdebug->leave_sub(); |
|
719 |
} |
|
720 |
|
|
721 | 617 |
sub _build_cfg_options { |
722 | 618 |
my $form = $main::form; |
723 | 619 |
my %myconfig = %main::myconfig; |
Auch abrufbar als: Unified diff
SimpleSystemSetting: Umstellung von »Sprachen«