PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | stripe/controllers/FrmTransLiteListsController.php +51 -17 6.25.1 → trunk View file →
@@ -8,12 +8,8 @@
8 8 /**
9 9 * @return void
10 10 */
11 11 public static function add_list_hooks() {
12 - if ( FrmTransLiteAppHelper::should_fallback_to_paypal() ) {
13 - return;
14 - }
15 -
16 12 $unread_count = FrmEntriesHelper::get_visible_unread_inbox_count();
17 13 $hook_name = 'manage_' . sanitize_title( FrmAppHelper::get_menu_name() ) . ( $unread_count ? '-' . $unread_count : '' ) . '_page_formidable-payments_columns';
18 14
19 15 add_filter( $hook_name, self::class . '::payment_columns' );
@@ -21,8 +17,9 @@
21 17 }
22 18
23 19 /**
24 20 * @param array $columns
21 + *
25 22 * @return array
26 23 */
27 24 public static function payment_columns( $columns = array() ) {
28 25 add_screen_option(
@@ -70,10 +67,13 @@
70 67
71 68 $columns['status'] = esc_html__( 'Status', 'formidable' );
72 69 $columns['created_at'] = esc_html__( 'Date', 'formidable' );
73 70 $columns['paysys'] = esc_html__( 'Processor', 'formidable' );
74 - $columns['mode'] = esc_html__( 'Mode', 'formidable' );
75 71
72 + if ( 'bulk_delete' !== FrmAppHelper::simple_get( 'action' ) && ! class_exists( 'FrmTransListHelper' ) && class_exists( 'FrmPaymentsListHelper' ) ) {
73 + $columns['mode'] = esc_html__( 'Mode', 'formidable' );
74 + }
75 +
76 76 return $columns;
77 77 }
78 78
79 79 /**
@@ -80,8 +80,13 @@
80 80 * Prevent the "screen options" tab from showing when
81 81 * viewing a payment or subscription
82 82 *
83 83 * @since 6.5
84 + *
85 + * @param bool $show_screen Whether to show the screen options tab.
86 + * @param object $screen The current screen.
87 + *
88 + * @return bool
84 89 */
85 90 public static function remove_screen_options( $show_screen, $screen ) {
86 91 if ( ! in_array( FrmAppHelper::simple_get( 'action', 'sanitize_title' ), array( 'edit', 'show', 'new', 'duplicate' ), true ) ) {
87 92 return $show_screen;
@@ -86,17 +91,17 @@
86 91 if ( ! in_array( FrmAppHelper::simple_get( 'action', 'sanitize_title' ), array( 'edit', 'show', 'new', 'duplicate' ), true ) ) {
87 92 return $show_screen;
88 93 }
89 94
90 - $menu_name = sanitize_title( FrmAppHelper::get_menu_name() );
95 + $menu_name = sanitize_title( FrmAppHelper::get_menu_name() );
96 + $unread_count = FrmEntriesHelper::get_visible_unread_inbox_count();
91 97
92 - $unread_count = FrmEntriesHelper::get_visible_unread_inbox_count();
93 98 if ( $unread_count ) {
94 99 $menu_name .= '-' . $unread_count;
95 100 }
96 101
97 102 if ( $screen->id === $menu_name . '_page_formidable-payments' ) {
98 - $show_screen = false;
103 + return false;
99 104 }
100 105
101 106 return $show_screen;
102 107 }
@@ -104,11 +109,37 @@
104 109 /**
105 110 * Handle payment/subscription list routing.
106 111 *
107 112 * @param string $action
113 + *
108 114 * @return void
109 115 */
110 116 public static function route( $action ) {
117 + if ( 'coupons' === $action ) {
118 + FrmAppHelper::permission_check( 'frm_change_settings' );
119 +
120 + include FrmTransLiteAppHelper::plugin_path() . '/views/lists/coupons.php';
121 + return;
122 + }
123 +
124 + // Show no-payments placeholder if payments table doesn't exist.
125 + if ( ! FrmTransLiteAppHelper::payments_table_exists() ) {
126 + include FrmTransLiteAppHelper::plugin_path() . '/views/lists/no-payments.php';
127 + return;
128 + }
129 +
130 + /**
131 + * @since 6.27
132 + *
133 + * @param bool $route_handled
134 + * @param string $action
135 + */
136 + $route_handled = apply_filters( 'frm_trans_lite_route', false, $action );
137 +
138 + if ( $route_handled ) {
139 + return;
140 + }
141 +
111 142 self::display_list();
112 143 }
113 144
114 145 /**
@@ -115,8 +146,9 @@
115 146 * @return array
116 147 */
117 148 public static function list_page_params() {
118 149 $values = array();
150 +
119 151 foreach ( array(
120 152 'id' => '',
121 153 'paged' => 1,
122 154 'form' => '',
@@ -133,30 +165,30 @@
133 165 /**
134 166 * Display a list.
135 167 *
136 168 * @param array $response
169 + *
137 170 * @return void
138 171 */
139 172 public static function display_list( $response = array() ) {
140 173 FrmAppHelper::include_svg();
141 174
142 - $defaults = array(
175 + $defaults = array(
143 176 'errors' => array(),
144 177 'message' => '',
145 178 );
146 - $response = array_merge( $defaults, $response );
147 - $errors = $response['errors'];
148 - $message = $response['message'];
149 -
179 + $response = array_merge( $defaults, $response );
180 + $errors = $response['errors'];
181 + $message = $response['message'];
150 182 $wp_list_table = new FrmTransLiteListHelper( self::list_page_params() );
183 + $pagenum = $wp_list_table->get_pagenum();
151 184
152 - $pagenum = $wp_list_table->get_pagenum();
153 -
154 185 $wp_list_table->prepare_items();
155 186
156 187 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
188 +
157 189 if ( $pagenum > $total_pages && $total_pages > 0 ) {
158 - // if the current page is higher than the total pages,
190 + // If the current page is higher than the total pages,
159 191 // reset it and prepare again to get the right entries.
160 192 $_GET['paged'] = $total_pages;
161 193 $_REQUEST['paged'] = $total_pages;
162 194 $pagenum = $wp_list_table->get_pagenum();
@@ -169,12 +201,14 @@
169 201 /**
170 202 * @param mixed $save
171 203 * @param string $option
172 204 * @param int $value
205 + *
206 + * @return mixed
173 207 */
174 208 public static function save_per_page( $save, $option, $value ) {
175 209 if ( $option === 'formidable_page_formidable_payments_per_page' ) {
176 - $save = absint( $value );
210 + return absint( $value );
177 211 }
178 212 return $save;
179 213 }
180 214 }