PUM_Gravity_Forms_Integation::render_settings_page()
Description Description
Source Source
File: includes/integrations/class-pum-gravity-forms.php
public static function render_settings_page() { $form_id = rgget( 'id' ); self::save(); $settings = self::form_options( $form_id ); GFFormSettings::page_header( __( 'Popup Settings', 'popup-maker' ) ); ?> <div id="popup_settings-editor"> <form id="popup_settings_edit_form" method="post"> <table class="form-table gforms_form_settings"> <tr> <th scope="row"> <label for="gforms-pum-closepopup"><?php _e( 'Close Popup', 'popup-maker' ); ?></label> </th> <td> <input type="checkbox" id="gforms-pum-closepopup" name="gforms-pum[closepopup]" value="true" <?php checked( $settings['closepopup'], true ); ?> /> </td> </tr> <tr id="gforms-pum-closedelay-wrapper"> <th scope="row"> <label for="gforms-pum-closedelay"><?php _e( 'Delay', 'popup-maker' ); ?></label> </th> <td> <?php if ( strlen( $settings['closedelay'] ) >= 3 ) { $settings['closedelay'] = $settings['closedelay'] / 1000; } ?> <input type="number" id="gforms-pum-closedelay" min="0" step="1" name="gforms-pum[closedelay]" style="width: 100px;" value="<?php echo esc_attr( $settings['closedelay'] ); ?>" /><?php _e( 'seconds', 'popup-maker' ); ?> </td> </tr> <tr> <th scope="row"> <label for="gforms-pum-openpopup"><?php _e( 'Open Popup', 'popup-maker' ); ?></label> </th> <td> <input type="checkbox" id="gforms-pum-openpopup" name="gforms-pum[openpopup]" value="true" <?php checked( $settings['openpopup'], true ); ?> /> </td> </tr> <tr id="gforms-pum-openpopup_id-wrapper"> <th scope="row"> <label for="gforms-pum-openpopup_id"><?php _e( 'Popup', 'popup-maker' ); ?></label> </th> <td> <select id="gforms-pum-openpopup_id" name="gforms-pum[openpopup_id]"> <?php foreach ( self::get_popup_list() as $option ) { ?> <option value="<?php echo esc_attr( $option['value'] ); ?>" <?php selected( $settings['openpopup_id'], $option['value'] ); ?>><?php echo $option['label']; ?></option> <?php } ?> </select> </td> </tr> </table> <input type="hidden" id="form_id" name="form_id" value="<?php echo esc_attr( $form_id ); ?>" /> <p class="submit"> <input type="submit" name="save" value="<?php _e( 'Save', 'popup-maker' ); ?>" class="button-primary"> </p> <?php wp_nonce_field( 'gform_popup_settings_edit', 'gform_popup_settings_edit' ); ?> </form> <script type="text/javascript"> (function ($) { var $open = $('#gforms-pum-openpopup'), $close = $('#gforms-pum-closepopup'), $popup_id_wrapper = $('#gforms-pum-openpopup_id-wrapper'), $delay_wrapper = $('#gforms-pum-closedelay-wrapper'); function check_open() { if ($open.is(':checked')) { $popup_id_wrapper.show(); } else { $popup_id_wrapper.hide(); } } function check_close() { if ($close.is(':checked')) { $delay_wrapper.show(); } else { $delay_wrapper.hide(); } } check_open(); check_close(); $open.on('click', check_open); $close.on('click', check_close); }(jQuery)); </script> </div> <!-- / popup-editor --> <?php GFFormSettings::page_footer(); }
Expand full source code Collapse full source code View on Trac