Skip to content
Merged
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
29 changes: 24 additions & 5 deletions classes/models/FrmFormMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private function maybe_add_to_import_page() {
}

public function import_page() {
$forms = $this->get_forms();
?>
<div class="wrap">
<h2 class="frm-h2"><?php echo esc_html( $this->name ); ?> Importer</h2>
Expand All @@ -66,11 +67,11 @@ public function import_page() {
<input type="hidden" name="action" value="frm_import_<?php echo esc_attr( $this->slug ); ?>" />
<div style="max-width:400px;text-align:left;">
<?php
if ( empty( $this->get_forms() ) ) {
if ( ! $forms ) {
esc_html_e( 'No Forms Found.', 'formidable' );
}
?>
<?php foreach ( $this->get_forms() as $form_id => $name ) { ?>
<?php foreach ( $forms as $form_id => $name ) { ?>
<p>
<label>
<input type="checkbox" name="form_id[]"
Expand All @@ -86,7 +87,20 @@ public function import_page() {
</p>
<?php } ?>
</div>
<p class="submit"><button type="submit" class="button button-primary frm-button-primary">Start Import</button></p>
<?php
$button_atts = array(
'type' => 'submit',
'class' => 'button button-primary frm-button-primary',
);
if ( ! $forms ) {
$button_atts['disabled'] = 'disabled';
}
?>
<p class="submit">
<button <?php FrmAppHelper::array_to_html_params( $button_atts, true ); ?>>
<?php esc_html_e( 'Start Import', 'formidable' ); ?>
</button>
</p>
</form>
<div id="frm-importer-process" class="frm-importer-process frm_hidden">

Expand All @@ -97,8 +111,13 @@ public function import_page() {
</p>

<p class="process-completed" class="frm_hidden">
The import process has finished! We have successfully imported
<span class="forms-completed"></span> forms. You can review the results below.
<?php
printf(
// translators: %s is the number of forms that were imported.
esc_html__( 'The import process has finished! We have successfully imported %s forms. You can review the results below.', 'formidable' ),
'<span class="forms-completed"></span>'
);
?>
</p>

<div class="status"></div>
Expand Down