withdraw_admin_options_generator.php
88 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for generate withdraw options |
| 4 | */ |
| 5 | |
| 6 | |
| 7 | $withdraw_methods = $this->withdraw_methods; |
| 8 | |
| 9 | |
| 10 | ?> |
| 11 | |
| 12 | <div class="withdraw-admin-options-wrap"> |
| 13 | |
| 14 | <ul class="withdraw-method-nav"> |
| 15 | <?php |
| 16 | foreach ($withdraw_methods as $method_id => $method) { |
| 17 | ?> |
| 18 | <li><a href="javascript:;" data-target-id="withdraw-method-<?php esc_attr_e( $method_id ); ?>-form"> <?php esc_html_e( $method['method_name'] ); ?> </a> </li> |
| 19 | <?php |
| 20 | } |
| 21 | ?> |
| 22 | </ul> |
| 23 | |
| 24 | |
| 25 | <?php |
| 26 | $method_i = 0; |
| 27 | |
| 28 | foreach ($withdraw_methods as $method_id => $method){ |
| 29 | $method_i++; |
| 30 | |
| 31 | $is_enable = tutor_utils()->avalue_dot($method_id.".enabled", $this->get_options); |
| 32 | ?> |
| 33 | |
| 34 | <div id="withdraw-method-<?php esc_attr_e( $method_id ); ?>-form" class="withdraw-method-form-wrap" style="display: <?php esc_attr_e( $method_i ) == 1 ? 'block' : 'none'; ?>;"> |
| 35 | |
| 36 | <div class="tutor-option-field-row"> |
| 37 | <div class="tutor-option-field-label"> |
| 38 | <label for=""><?php esc_html_e('Enable/Disable', 'tutor'); ?></label> |
| 39 | </div> |
| 40 | <div class="tutor-option-field"> |
| 41 | <label> |
| 42 | <input type="checkbox" name="tutor_withdraw_options[<?php esc_attr_e( $method_id ); ?>][enabled]" value="1" <?php checked('1', $is_enable) ?> > |
| 43 | <?php esc_html_e('Enable ', 'tutor'); ?> <?php esc_html_e( $method['method_name'] ); ?> |
| 44 | </label> |
| 45 | </div> |
| 46 | </div> |
| 47 | |
| 48 | <?php |
| 49 | |
| 50 | if ( ! empty($method['admin_form_fields']) && tutor_utils()->count($method['admin_form_fields'])){ |
| 51 | $form_fields = $method['admin_form_fields']; |
| 52 | |
| 53 | foreach ($form_fields as $field_name => $field){ |
| 54 | $saved_value = tutor_utils()->avalue_dot($method_id.".".$field_name, $this->get_options); |
| 55 | ?> |
| 56 | <div class="tutor-option-field-row"> |
| 57 | <?php |
| 58 | if (isset($field['label'])){ |
| 59 | ?> |
| 60 | <div class="tutor-option-field-label"> |
| 61 | <label for=""><?php esc_html_e( $field['label'] ); ?></label> |
| 62 | </div> |
| 63 | <?php |
| 64 | } |
| 65 | ?> |
| 66 | <div class="tutor-option-field"> |
| 67 | <?php |
| 68 | include tutor()->path."views/options/withdraw/{$field['type']}.php"; |
| 69 | |
| 70 | if (isset($field['desc'])){ |
| 71 | echo '<p class="desc">' . esc_html( $field['desc'] ) . '</p>'; |
| 72 | } |
| 73 | ?> |
| 74 | </div> |
| 75 | </div> |
| 76 | <?php |
| 77 | } |
| 78 | } |
| 79 | ?> |
| 80 | |
| 81 | |
| 82 | </div> |
| 83 | |
| 84 | <?php |
| 85 | } |
| 86 | ?> |
| 87 | |
| 88 | </div> |