templates
4 years ago
dashboard.php
4 years ago
enqueue.php
4 years ago
functions.php
4 years ago
render.php
4 years ago
render.php
132 lines
| 1 | <?php |
| 2 | |
| 3 | function wplra_prepare_filters_based_on_saved( $filter_by, $filter_by_value, $redirect_to_url ) |
| 4 | { ?> |
| 5 | <div class="input-group mb-3 wplra_filtering_group_container"> |
| 6 | <div class="input-group-prepend"> |
| 7 | <span class="input-group-text">Redirect If</span> |
| 8 | </div> |
| 9 | |
| 10 | <select name="wplra_select_filter_by_elem" id="wplra_select_filter_by_elem" class="form-control wplra_filter_select wplra_select_filter_by_elem"> |
| 11 | <option value="id" <?php echo $filter_by == "id" ? 'selected' : ''; ?>>User ID</option> |
| 12 | <option value="email" <?php echo $filter_by == "email" ? 'selected' : ''; ?>>User Email</option> |
| 13 | <option value="role" <?php echo $filter_by == "role" ? 'selected' : ''; ?>>User Role</option> |
| 14 | <option value="username" <?php echo $filter_by == "username" ? 'selected' : ''; ?>>User Username</option> |
| 15 | </select> |
| 16 | |
| 17 | <div class="input-group-append"> |
| 18 | <span class="input-group-text"> == </span> |
| 19 | </div> |
| 20 | |
| 21 | <select name="wplra_filter_by_id" class="form-control wplra_filter_select wplra_filter_by_id wplra_saved_filter" <?php echo $filter_by == 'id' ? " style='display:block;'":""; ?>> |
| 22 | <?php |
| 23 | |
| 24 | $users = get_users(); |
| 25 | |
| 26 | foreach ( $users as $user ) |
| 27 | { |
| 28 | if ( ! empty( $user->ID ) ) |
| 29 | { |
| 30 | echo "<option value='$user->ID'"; |
| 31 | |
| 32 | if ( $filter_by == 'id' ) |
| 33 | { |
| 34 | if ( $filter_by_value == $user->ID ) |
| 35 | { |
| 36 | echo ' selected '; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | echo ">$user->ID</option>"; |
| 41 | } |
| 42 | } |
| 43 | ?> |
| 44 | |
| 45 | </select> |
| 46 | |
| 47 | <select name="wplra_filter_by_email" class="form-control wplra_filter_select wplra_filter_by_email" <?php echo $filter_by == 'email' ? " style='display:block;'":""; ?>> |
| 48 | <?php |
| 49 | |
| 50 | $users = get_users(); |
| 51 | |
| 52 | foreach ( $users as $user ) |
| 53 | { |
| 54 | if ( ! empty( $user->user_email ) ) |
| 55 | { |
| 56 | echo "<option value='$user->user_email'"; |
| 57 | |
| 58 | if ( $filter_by == 'email' ) |
| 59 | { |
| 60 | if ( $filter_by_value == $user->user_email ) |
| 61 | { |
| 62 | echo ' selected '; |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | echo ">$user->user_email</option>"; |
| 67 | } |
| 68 | } |
| 69 | ?> |
| 70 | </select> |
| 71 | |
| 72 | <select name="wplra_filter_by_role" class="form-control wplra_filter_select wplra_filter_by_role" <?php echo $filter_by == 'role' ? " style='display:block;'":""; ?>> |
| 73 | <?php |
| 74 | |
| 75 | $roles = get_editable_roles(); |
| 76 | |
| 77 | foreach ( $roles as $role_name => $role_info ) |
| 78 | { |
| 79 | if ( ! empty( $role_name ) ) |
| 80 | { |
| 81 | echo "<option value='$role_name'"; |
| 82 | |
| 83 | if ( $filter_by == 'role' ) |
| 84 | { |
| 85 | if ( $filter_by_value == $role_name ) |
| 86 | { |
| 87 | echo ' selected '; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | echo ">$role_name</option>"; |
| 92 | } |
| 93 | } |
| 94 | ?> |
| 95 | </select> |
| 96 | |
| 97 | <select name="wplra_filter_by_username" class="form-control wplra_filter_select wplra_filter_by_username" <?php echo $filter_by == 'username' ? " style='display:block;'":""; ?>> |
| 98 | <?php |
| 99 | |
| 100 | $users = get_users(); |
| 101 | |
| 102 | foreach ( $users as $user ) |
| 103 | { |
| 104 | if ( ! empty( $user->user_login ) ) |
| 105 | { |
| 106 | echo "<option value='$user->user_login'"; |
| 107 | |
| 108 | if ( $filter_by == 'username' ) |
| 109 | { |
| 110 | if ( $filter_by_value == $user->user_login ) |
| 111 | { |
| 112 | echo ' selected '; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | echo ">$user->user_login</option>"; |
| 117 | } |
| 118 | } |
| 119 | ?> |
| 120 | </select> |
| 121 | |
| 122 | <div class="input-group-append"> |
| 123 | <span class="input-group-text">To</span> |
| 124 | <span class="input-group-text wplra_site_protocol" id="wplra_site_protocol"></span> |
| 125 | </div> |
| 126 | |
| 127 | <input type="text" class="form-control wplra_filter_select wplra_redirect_url" id="wplra_redirect_url" name="wplra_redirect_url" value="<?php echo $redirect_to_url; ?>" placeholder="Enter Redirect URL..."> |
| 128 | <span class="dashicons dashicons-plus-alt wplra_add_more_filter"></span> |
| 129 | <span class="dashicons dashicons-minus wplra_delete_filter"></span> |
| 130 | </div> |
| 131 | <?php } |
| 132 |