Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion contao/dca/tl_form_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Contao\Controller;

$GLOBALS['TL_DCA']['tl_form_field']['palettes']['mp_form_pageswitch'] = '{type_legend},type,label,mp_forms_backButton,slabel;{image_legend:hide},imageSubmit;{expert_legend:hide},mp_forms_backFragment,mp_forms_nextFragment,class,accesskey,tabindex;{template_legend:hide},customTpl;{invisible_legend:hide},invisible';
$GLOBALS['TL_DCA']['tl_form_field']['palettes']['mp_form_pageswitch'] = '{type_legend},type,label,mp_forms_backButton,slabel,mp_form_show_progressbar;{image_legend:hide},imageSubmit;{expert_legend:hide},mp_forms_backFragment,mp_forms_nextFragment,class,accesskey,tabindex;{template_legend:hide},customTpl;{invisible_legend:hide},invisible';
$GLOBALS['TL_DCA']['tl_form_field']['palettes']['mp_form_placeholder'] = '{type_legend},type;{text_legend},html;{mp_forms_download_legend},mp_forms_downloadTemplate,mp_forms_downloadInline;{template_legend:hide},customTpl;{invisible_legend:hide},invisible';

$GLOBALS['TL_DCA']['tl_form_field']['fields']['mp_forms_backButton'] = [
Expand All @@ -14,6 +14,13 @@
'sql' => ['type' => 'string', 'length' => 255, 'default' => '', 'notnull' => true],
];

$GLOBALS['TL_DCA']['tl_form_field']['fields']['mp_form_show_progressbar'] = [
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class'=>'w50 clr'],
'sql' => ['type' => 'boolean', 'default' => false]
];

$GLOBALS['TL_DCA']['tl_form_field']['fields']['mp_forms_backFragment'] = [
'exclude' => true,
'inputType' => 'text',
Expand Down
1 change: 1 addition & 0 deletions contao/languages/de/tl_form_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_nextFragment'] = ['URL Fragment für die Weiter-Schaltfläche', 'Hier können Sie ein optionales URL Fragment eingeben, welches der URL hinzugefügt wird (z.B. für Sprunglinks). Lassen Sie "#" weg.'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_downloadTemplate'] = ['Template für Download-Elemente', 'Template, das für das Rendern des Download-Links auf Zusammenfassungsseiten verwendet wird.'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_downloadInline'] = ['Im Browser anzeigen', 'Die Datei im Browser anzeigen, anstatt den Download-Dialog zu öffnen.'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_form_show_progressbar'] = ['Fortschritt anzeigen', 'zeigt den aktuellen Schritt im Formular als Fortschrittsanzeige an'];
1 change: 1 addition & 0 deletions contao/languages/en/tl_form_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_nextFragment'] = ['Continue button URL fragment', 'You may enter an optional URL fragment here which will be added to the URL when hitting the continue button (e.g. for anchor links). Omit the "#" here.'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_downloadTemplate'] = ['Template for download elements', 'Template used for rendering the download link on summary pages.'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_downloadInline'] = ['Show in browser', 'Show the file in the browser instead of opening the download dialog.'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_form_show_progressbar'] = ['Show Progress', 'Shows the current progress as a bar'];
1 change: 1 addition & 0 deletions contao/languages/ja/tl_form_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_nextFragment'] = ['続けるボタンのURLの断片', '続けるボタンをクリックしたときのURLに付加するURLの断片(例えば、アンカーのリンク)を入力できます。"#"とすると省略できます。'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_downloadTemplate'] = ['ダウンロード用テンプレート', 'サマリーページのダウンロードリンクのレンダリングに使用されるテンプレート。'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_forms_downloadInline'] = ['ブラウザーで表示', 'ダウンロードのダイアログを開く代わりにブラウザーでファイルを表示します。'];
$GLOBALS['TL_LANG']['tl_form_field']['mp_form_show_progressbar'] = ['進捗状況を表示', 'フォームの現在のステップを進行状況インジケーターとして表示します。'];
18 changes: 14 additions & 4 deletions contao/templates/form_mp_form_pageswitch.html5
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@

<?php $this->block('field'); ?>

<button type="submit" name="<?= $this->name ?>" value="continue"><?= $this->slabel ?></button>

<?php if ($this->canGoBack && $this->mp_forms_backButton): ?>
<button type="submit" name="<?= $this->name ?>" value="back" formnovalidate><?= $this->mp_forms_backButton ?></button>
<?php if($this->pid && $this->form_show_progressbar): ?>
<div class="progress">
<div class="progress-bar">
<div class="progress-bar-inner" style="width:{{mp_forms::<?=$this->pid ?? ""?>::step::percentage}}%"></div>
</div>
</div>
<?php endif; ?>

<div class="button-container">
<button type="submit" name="<?= $this->name ?>" value="continue"><?= $this->slabel ?></button>

<?php if ($this->canGoBack && $this->mp_forms_backButton): ?>
<button type="submit" name="<?= $this->name ?>" value="back" formnovalidate><?= $this->mp_forms_backButton ?></button>
<?php endif; ?>
</div>

<?php $this->endblock(); ?>