@@ -23,40 +23,40 @@ discard block |
||
| 23 | 23 | $order = self::get_param( array( 'param' => 'order', 'default' => 'ASC' ) ); |
| 24 | 24 | $start = self::get_param( array( 'param' => 'start', 'default' => ( ( $page - 1 ) * $per_page ) ) ); |
| 25 | 25 | |
| 26 | - $s_query = array(); |
|
| 27 | - $s_query[] = array( 'or' => 1, 'parent_form_id' => null, 'parent_form_id <' => 1 ); |
|
| 26 | + $s_query = array(); |
|
| 27 | + $s_query[] = array( 'or' => 1, 'parent_form_id' => null, 'parent_form_id <' => 1 ); |
|
| 28 | 28 | switch ( $this->status ) { |
| 29 | - case 'template': |
|
| 30 | - $s_query['is_template'] = 1; |
|
| 31 | - $s_query['status !'] = 'trash'; |
|
| 32 | - break; |
|
| 33 | - case 'draft': |
|
| 34 | - $s_query['is_template'] = 0; |
|
| 35 | - $s_query['status'] = 'draft'; |
|
| 36 | - break; |
|
| 37 | - case 'trash': |
|
| 38 | - $s_query['status'] = 'trash'; |
|
| 39 | - break; |
|
| 40 | - default: |
|
| 41 | - $s_query['is_template'] = 0; |
|
| 42 | - $s_query['status !'] = 'trash'; |
|
| 43 | - break; |
|
| 29 | + case 'template': |
|
| 30 | + $s_query['is_template'] = 1; |
|
| 31 | + $s_query['status !'] = 'trash'; |
|
| 32 | + break; |
|
| 33 | + case 'draft': |
|
| 34 | + $s_query['is_template'] = 0; |
|
| 35 | + $s_query['status'] = 'draft'; |
|
| 36 | + break; |
|
| 37 | + case 'trash': |
|
| 38 | + $s_query['status'] = 'trash'; |
|
| 39 | + break; |
|
| 40 | + default: |
|
| 41 | + $s_query['is_template'] = 0; |
|
| 42 | + $s_query['status !'] = 'trash'; |
|
| 43 | + break; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $s = self::get_param( array( 'param' => 's', 'sanitize' => 'sanitize_text_field' ) ); |
| 47 | - if ( $s != '' ) { |
|
| 48 | - preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); |
|
| 49 | - $search_terms = array_map('trim', $matches[0]); |
|
| 50 | - foreach ( (array) $search_terms as $term ) { |
|
| 51 | - $s_query[] = array( |
|
| 52 | - 'or' => true, 'name LIKE' => $term, 'description LIKE' => $term, 'created_at LIKE' => $term, |
|
| 53 | - ); |
|
| 54 | - unset($term); |
|
| 55 | - } |
|
| 56 | - } |
|
| 47 | + if ( $s != '' ) { |
|
| 48 | + preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); |
|
| 49 | + $search_terms = array_map('trim', $matches[0]); |
|
| 50 | + foreach ( (array) $search_terms as $term ) { |
|
| 51 | + $s_query[] = array( |
|
| 52 | + 'or' => true, 'name LIKE' => $term, 'description LIKE' => $term, 'created_at LIKE' => $term, |
|
| 53 | + ); |
|
| 54 | + unset($term); |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | 58 | $this->items = FrmForm::getAll( $s_query, $orderby . ' ' . $order, $start . ',' . $per_page ); |
| 59 | - $total_items = FrmDb::get_count( 'frm_forms', $s_query ); |
|
| 59 | + $total_items = FrmDb::get_count( 'frm_forms', $s_query ); |
|
| 60 | 60 | |
| 61 | 61 | $this->set_pagination_args( array( |
| 62 | 62 | 'total_items' => $total_items, |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function no_items() { |
| 68 | - if ( 'template' == $this->status ) { |
|
| 68 | + if ( 'template' == $this->status ) { |
|
| 69 | 69 | esc_html_e( 'No Templates Found.', 'formidable' ) ?> |
| 70 | 70 | <br/><br/><?php esc_html_e( 'To add a new template:', 'formidable' ) ?> |
| 71 | 71 | <ol> |
@@ -80,55 +80,55 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function get_bulk_actions() { |
| 83 | - $actions = array(); |
|
| 83 | + $actions = array(); |
|
| 84 | 84 | |
| 85 | 85 | if ( in_array( $this->status, array( '', 'published' ) ) ) { |
| 86 | - $actions['bulk_create_template'] = __( 'Create Template', 'formidable' ); |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - if ( 'trash' == $this->status ) { |
|
| 90 | - if ( current_user_can('frm_edit_forms') ) { |
|
| 91 | - $actions['bulk_untrash'] = __( 'Restore', 'formidable' ); |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - if ( current_user_can('frm_delete_forms') ) { |
|
| 95 | - $actions['bulk_delete'] = __( 'Delete Permanently', 'formidable' ); |
|
| 96 | - } |
|
| 97 | - } else if ( EMPTY_TRASH_DAYS && current_user_can('frm_delete_forms') ) { |
|
| 98 | - $actions['bulk_trash'] = __( 'Move to Trash', 'formidable' ); |
|
| 99 | - } else if ( current_user_can('frm_delete_forms') ) { |
|
| 100 | - $actions['bulk_delete'] = __( 'Delete'); |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - return $actions; |
|
| 104 | - } |
|
| 86 | + $actions['bulk_create_template'] = __( 'Create Template', 'formidable' ); |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + if ( 'trash' == $this->status ) { |
|
| 90 | + if ( current_user_can('frm_edit_forms') ) { |
|
| 91 | + $actions['bulk_untrash'] = __( 'Restore', 'formidable' ); |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + if ( current_user_can('frm_delete_forms') ) { |
|
| 95 | + $actions['bulk_delete'] = __( 'Delete Permanently', 'formidable' ); |
|
| 96 | + } |
|
| 97 | + } else if ( EMPTY_TRASH_DAYS && current_user_can('frm_delete_forms') ) { |
|
| 98 | + $actions['bulk_trash'] = __( 'Move to Trash', 'formidable' ); |
|
| 99 | + } else if ( current_user_can('frm_delete_forms') ) { |
|
| 100 | + $actions['bulk_delete'] = __( 'Delete'); |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + return $actions; |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | 106 | public function extra_tablenav( $which ) { |
| 107 | - if ( 'top' != $which ) { |
|
| 108 | - return; |
|
| 109 | - } |
|
| 107 | + if ( 'top' != $which ) { |
|
| 108 | + return; |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - if ( 'trash' == $this->status && current_user_can('frm_delete_forms') ) { |
|
| 111 | + if ( 'trash' == $this->status && current_user_can('frm_delete_forms') ) { |
|
| 112 | 112 | ?> |
| 113 | 113 | <div class="alignleft actions frm_visible_overflow"> |
| 114 | 114 | <?php submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false ); ?> |
| 115 | 115 | </div> |
| 116 | 116 | <?php |
| 117 | - return; |
|
| 118 | - } |
|
| 117 | + return; |
|
| 118 | + } |
|
| 119 | 119 | |
| 120 | - if ( 'template' != $this->status ) { |
|
| 121 | - return; |
|
| 122 | - } |
|
| 120 | + if ( 'template' != $this->status ) { |
|
| 121 | + return; |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | 124 | $where = apply_filters( 'frm_forms_dropdown', array(), '' ); |
| 125 | 125 | $forms = FrmForm::get_published_forms( $where ); |
| 126 | 126 | |
| 127 | - $base = admin_url('admin.php?page=formidable&form_type=template'); |
|
| 128 | - $args = array( |
|
| 129 | - 'frm_action' => 'duplicate', |
|
| 130 | - 'template' => true, |
|
| 131 | - ); |
|
| 127 | + $base = admin_url('admin.php?page=formidable&form_type=template'); |
|
| 128 | + $args = array( |
|
| 129 | + 'frm_action' => 'duplicate', |
|
| 130 | + 'template' => true, |
|
| 131 | + ); |
|
| 132 | 132 | |
| 133 | 133 | ?> |
| 134 | 134 | <div class="alignleft actions frm_visible_overflow"> |
@@ -136,18 +136,18 @@ discard block |
||
| 136 | 136 | <a href="#" id="frm-templateDrop" class="frm-dropdown-toggle button" data-toggle="dropdown"><?php esc_html_e( 'Create New Template', 'formidable' ) ?> <b class="caret"></b></a> |
| 137 | 137 | <ul class="frm-dropdown-menu" role="menu" aria-labelledby="frm-templateDrop"> |
| 138 | 138 | <?php |
| 139 | - if ( empty( $forms ) ) { ?> |
|
| 139 | + if ( empty( $forms ) ) { ?> |
|
| 140 | 140 | <li class="frm_dropdown_li"><?php esc_html_e( 'You have not created any forms yet. <br/>You must create a form before you can make a template.', 'formidable' ) ?></li> |
| 141 | 141 | <?php |
| 142 | - } else { |
|
| 143 | - foreach ( $forms as $form ) { |
|
| 144 | - $args['id'] = $form->id; ?> |
|
| 142 | + } else { |
|
| 143 | + foreach ( $forms as $form ) { |
|
| 144 | + $args['id'] = $form->id; ?> |
|
| 145 | 145 | <li><a href="<?php echo esc_url( add_query_arg( $args, $base ) ); ?>" tabindex="-1"><?php echo esc_html( empty( $form->name ) ? __( '(no title)' ) : FrmAppHelper::truncate( $form->name, 33 ) ); ?></a></li> |
| 146 | 146 | <?php |
| 147 | - unset($form); |
|
| 147 | + unset($form); |
|
| 148 | 148 | } |
| 149 | - } |
|
| 150 | - ?> |
|
| 149 | + } |
|
| 150 | + ?> |
|
| 151 | 151 | </ul> |
| 152 | 152 | </div> |
| 153 | 153 | </div> |
@@ -157,30 +157,30 @@ discard block |
||
| 157 | 157 | public function get_views() { |
| 158 | 158 | |
| 159 | 159 | $statuses = array( |
| 160 | - 'published' => __( 'My Forms', 'formidable' ), |
|
| 161 | - 'template' => __( 'Templates', 'formidable' ), |
|
| 162 | - 'draft' => __( 'Drafts', 'formidable' ), |
|
| 163 | - 'trash' => __( 'Trash', 'formidable' ), |
|
| 160 | + 'published' => __( 'My Forms', 'formidable' ), |
|
| 161 | + 'template' => __( 'Templates', 'formidable' ), |
|
| 162 | + 'draft' => __( 'Drafts', 'formidable' ), |
|
| 163 | + 'trash' => __( 'Trash', 'formidable' ), |
|
| 164 | 164 | ); |
| 165 | 165 | |
| 166 | - $links = array(); |
|
| 167 | - $counts = FrmForm::get_count(); |
|
| 166 | + $links = array(); |
|
| 167 | + $counts = FrmForm::get_count(); |
|
| 168 | 168 | $form_type = self::get_param( array( 'param' => 'form_type', 'default' => 'published' ) ); |
| 169 | 169 | |
| 170 | - foreach ( $statuses as $status => $name ) { |
|
| 170 | + foreach ( $statuses as $status => $name ) { |
|
| 171 | 171 | |
| 172 | - if ( $status == $form_type ) { |
|
| 173 | - $class = ' class="current"'; |
|
| 174 | - } else { |
|
| 175 | - $class = ''; |
|
| 176 | - } |
|
| 172 | + if ( $status == $form_type ) { |
|
| 173 | + $class = ' class="current"'; |
|
| 174 | + } else { |
|
| 175 | + $class = ''; |
|
| 176 | + } |
|
| 177 | 177 | |
| 178 | - if ( $counts->{$status} || 'published' == $status ) { |
|
| 178 | + if ( $counts->{$status} || 'published' == $status ) { |
|
| 179 | 179 | $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
| 180 | - } |
|
| 180 | + } |
|
| 181 | 181 | |
| 182 | - unset($status, $name); |
|
| 183 | - } |
|
| 182 | + unset($status, $name); |
|
| 183 | + } |
|
| 184 | 184 | |
| 185 | 185 | return $links; |
| 186 | 186 | } |
@@ -196,16 +196,16 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | public function single_row( $item, $style = '' ) { |
| 199 | - global $frm_vars, $mode; |
|
| 199 | + global $frm_vars, $mode; |
|
| 200 | 200 | |
| 201 | 201 | // Set up the hover actions for this user |
| 202 | 202 | $actions = array(); |
| 203 | 203 | $edit_link = '?page=formidable&frm_action=edit&id=' . $item->id; |
| 204 | 204 | $duplicate_link = '?page=formidable&frm_action=duplicate&id=' . $item->id; |
| 205 | 205 | |
| 206 | - $this->get_actions($actions, $item, $edit_link, $duplicate_link); |
|
| 206 | + $this->get_actions($actions, $item, $edit_link, $duplicate_link); |
|
| 207 | 207 | |
| 208 | - $action_links = $this->row_actions( $actions ); |
|
| 208 | + $action_links = $this->row_actions( $actions ); |
|
| 209 | 209 | |
| 210 | 210 | // Set up the checkbox ( because the user is editable, otherwise its empty ) |
| 211 | 211 | $checkbox = '<input type="checkbox" name="item-action[]" id="cb-item-action-' . absint( $item->id ) . '" value="' . esc_attr( $item->id ) . '" />'; |
@@ -214,9 +214,9 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | list( $columns, $hidden ) = $this->get_column_info(); |
| 216 | 216 | |
| 217 | - $format = 'Y/m/d'; |
|
| 218 | - if ( 'list' != $mode ) { |
|
| 219 | - $format .= ' \<\b\r \/\> g:i:s a'; |
|
| 217 | + $format = 'Y/m/d'; |
|
| 218 | + if ( 'list' != $mode ) { |
|
| 219 | + $format .= ' \<\b\r \/\> g:i:s a'; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | foreach ( $columns as $column_name => $column_display_name ) { |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | $style = ''; |
| 226 | 226 | if ( in_array( $column_name, $hidden ) ) { |
| 227 | - $class .= ' frm_hidden'; |
|
| 227 | + $class .= ' frm_hidden'; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | $class = 'class="' . esc_attr( $class ) . '"'; |
@@ -237,41 +237,41 @@ discard block |
||
| 237 | 237 | break; |
| 238 | 238 | case 'id': |
| 239 | 239 | case 'form_key': |
| 240 | - $val = $item->{$column_name}; |
|
| 241 | - break; |
|
| 240 | + $val = $item->{$column_name}; |
|
| 241 | + break; |
|
| 242 | 242 | case 'name': |
| 243 | - $val = $this->get_form_name( $item, $actions, $edit_link, $mode ); |
|
| 244 | - $val .= $action_links; |
|
| 243 | + $val = $this->get_form_name( $item, $actions, $edit_link, $mode ); |
|
| 244 | + $val .= $action_links; |
|
| 245 | 245 | |
| 246 | - break; |
|
| 246 | + break; |
|
| 247 | 247 | case 'created_at': |
| 248 | - $date = date($format, strtotime($item->created_at)); |
|
| 248 | + $date = date($format, strtotime($item->created_at)); |
|
| 249 | 249 | $val = '<abbr title="' . esc_attr( date( 'Y/m/d g:i:s A', strtotime( $item->created_at ) ) ) . '">' . $date . '</abbr>'; |
| 250 | 250 | break; |
| 251 | 251 | case 'shortcode': |
| 252 | 252 | $val = '<input type="text" readonly="readonly" class="frm_select_box" value="' . esc_attr( '[formidable id=' . $item->id . ']' ) . '" /><br/>'; |
| 253 | - if ( 'excerpt' == $mode ) { |
|
| 253 | + if ( 'excerpt' == $mode ) { |
|
| 254 | 254 | $val .= '<input type="text" readonly="readonly" class="frm_select_box" value="' . esc_attr( '[formidable key=' . $item->form_key . ']' ) . '" />'; |
| 255 | - } |
|
| 256 | - break; |
|
| 257 | - case 'entries': |
|
| 255 | + } |
|
| 256 | + break; |
|
| 257 | + case 'entries': |
|
| 258 | 258 | if ( isset( $item->options['no_save'] ) && $item->options['no_save'] ) { |
| 259 | 259 | $val = '<i class="frm_icon_font frm_forbid_icon frm_bstooltip" title="' . esc_attr('Saving entries is disabled for this form', 'formidable' ) . '"></i>'; |
| 260 | - } else { |
|
| 261 | - $text = FrmEntry::getRecordCount($item->id); |
|
| 260 | + } else { |
|
| 261 | + $text = FrmEntry::getRecordCount($item->id); |
|
| 262 | 262 | $val = current_user_can('frm_view_entries') ? '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-entries&form=' . $item->id ) ) . '">' . $text . '</a>' : $text; |
| 263 | - unset($text); |
|
| 264 | - } |
|
| 265 | - break; |
|
| 266 | - case 'type': |
|
| 267 | - $val = ( $item->is_template && $item->default_template ) ? __( 'Default', 'formidable' ) : __( 'Custom', 'formidable' ); |
|
| 268 | - break; |
|
| 263 | + unset($text); |
|
| 264 | + } |
|
| 265 | + break; |
|
| 266 | + case 'type': |
|
| 267 | + $val = ( $item->is_template && $item->default_template ) ? __( 'Default', 'formidable' ) : __( 'Custom', 'formidable' ); |
|
| 268 | + break; |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | if ( isset($val) ) { |
| 272 | - $r .= "<td $attributes>"; |
|
| 273 | - $r .= $val; |
|
| 274 | - $r .= '</td>'; |
|
| 272 | + $r .= "<td $attributes>"; |
|
| 273 | + $r .= $val; |
|
| 274 | + $r .= '</td>'; |
|
| 275 | 275 | } |
| 276 | 276 | unset($val); |
| 277 | 277 | } |
@@ -280,38 +280,38 @@ discard block |
||
| 280 | 280 | return $r; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - /** |
|
| 284 | - * @param string $edit_link |
|
| 285 | - * @param string $duplicate_link |
|
| 286 | - */ |
|
| 287 | - private function get_actions( &$actions, $item, $edit_link, $duplicate_link ) { |
|
| 283 | + /** |
|
| 284 | + * @param string $edit_link |
|
| 285 | + * @param string $duplicate_link |
|
| 286 | + */ |
|
| 287 | + private function get_actions( &$actions, $item, $edit_link, $duplicate_link ) { |
|
| 288 | 288 | if ( 'trash' == $this->status ) { |
| 289 | 289 | if ( current_user_can('frm_edit_forms') ) { |
| 290 | 290 | $actions['restore'] = FrmFormsHelper::delete_trash_link( $item->id, $item->status, 'short' ); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - if ( current_user_can('frm_delete_forms') ) { |
|
| 293 | + if ( current_user_can('frm_delete_forms') ) { |
|
| 294 | 294 | $trash_url = wp_nonce_url( '?page=formidable&form_status=trash&frm_action=destroy&id=' . $item->id, 'destroy_form_' . $item->id ); |
| 295 | 295 | $actions['trash'] = '<a href="' . esc_url( $trash_url ) . '" class="submitdelete" onclick="return confirm(\'' . __( 'Are you sure you want to permanently delete that?', 'formidable' ) . '\')">' . __( 'Delete Permanently' ) . '</a>'; |
| 296 | - } |
|
| 297 | - return; |
|
| 296 | + } |
|
| 297 | + return; |
|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | if ( current_user_can('frm_edit_forms') ) { |
| 301 | - if ( ! $item->is_template || ! $item->default_template ) { |
|
| 301 | + if ( ! $item->is_template || ! $item->default_template ) { |
|
| 302 | 302 | $actions['frm_edit'] = '<a href="' . esc_url( $edit_link ) . '">' . __( 'Edit' ) . '</a>'; |
| 303 | - } |
|
| 303 | + } |
|
| 304 | 304 | |
| 305 | - if ( $item->is_template ) { |
|
| 305 | + if ( $item->is_template ) { |
|
| 306 | 306 | $actions['frm_duplicate'] = '<a href="' . esc_url( wp_nonce_url( $duplicate_link ) ) . '">' . __( 'Create Form from Template', 'formidable' ) . '</a>'; |
| 307 | - } else { |
|
| 307 | + } else { |
|
| 308 | 308 | $actions['frm_settings'] = '<a href="' . esc_url( '?page=formidable&frm_action=settings&id=' . $item->id ) . '">' . __( 'Settings', 'formidable' ) . '</a>'; |
| 309 | 309 | |
| 310 | - if ( FrmAppHelper::pro_is_installed() ) { |
|
| 310 | + if ( FrmAppHelper::pro_is_installed() ) { |
|
| 311 | 311 | $actions['duplicate'] = '<a href="' . esc_url( wp_nonce_url( $duplicate_link ) ) . '">' . __( 'Duplicate', 'formidable' ) . '</a>'; |
| 312 | - } |
|
| 313 | - } |
|
| 314 | - } |
|
| 312 | + } |
|
| 313 | + } |
|
| 314 | + } |
|
| 315 | 315 | |
| 316 | 316 | $actions['trash'] = FrmFormsHelper::delete_trash_link( $item->id, $item->status, 'short' ); |
| 317 | 317 | if ( empty( $actions['trash'] ) ) { |
@@ -320,52 +320,52 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | $actions['view'] = '<a href="' . esc_url( FrmFormsHelper::get_direct_link( $item->form_key, $item ) ) . '" target="_blank">' . __( 'Preview') . '</a>'; |
| 323 | - } |
|
| 323 | + } |
|
| 324 | 324 | |
| 325 | - /** |
|
| 326 | - * @param string $edit_link |
|
| 327 | - */ |
|
| 325 | + /** |
|
| 326 | + * @param string $edit_link |
|
| 327 | + */ |
|
| 328 | 328 | private function get_form_name( $item, $actions, $edit_link, $mode = 'list' ) { |
| 329 | - $form_name = $item->name; |
|
| 330 | - if ( trim($form_name) == '' ) { |
|
| 331 | - $form_name = __( '(no title)'); |
|
| 332 | - } |
|
| 329 | + $form_name = $item->name; |
|
| 330 | + if ( trim($form_name) == '' ) { |
|
| 331 | + $form_name = __( '(no title)'); |
|
| 332 | + } |
|
| 333 | 333 | $form_name = FrmAppHelper::kses( $form_name ); |
| 334 | 334 | if ( 'excerpt' != $mode ) { |
| 335 | 335 | $form_name = FrmAppHelper::truncate( $form_name, 50 ); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - $val = '<strong>'; |
|
| 339 | - if ( 'trash' == $this->status ) { |
|
| 340 | - $val .= $form_name; |
|
| 341 | - } else { |
|
| 338 | + $val = '<strong>'; |
|
| 339 | + if ( 'trash' == $this->status ) { |
|
| 340 | + $val .= $form_name; |
|
| 341 | + } else { |
|
| 342 | 342 | $val .= '<a href="' . esc_url( isset( $actions['frm_edit'] ) ? $edit_link : FrmFormsHelper::get_direct_link( $item->form_key, $item ) ) . '" class="row-title">' . FrmAppHelper::kses( $form_name ) . '</a> '; |
| 343 | - } |
|
| 343 | + } |
|
| 344 | 344 | |
| 345 | - $this->add_draft_label( $item, $val ); |
|
| 346 | - $val .= '</strong>'; |
|
| 345 | + $this->add_draft_label( $item, $val ); |
|
| 346 | + $val .= '</strong>'; |
|
| 347 | 347 | |
| 348 | - $this->add_form_description( $item, $val ); |
|
| 348 | + $this->add_form_description( $item, $val ); |
|
| 349 | 349 | |
| 350 | - return $val; |
|
| 351 | - } |
|
| 350 | + return $val; |
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - /** |
|
| 354 | - * @param string $val |
|
| 355 | - */ |
|
| 356 | - private function add_draft_label( $item, &$val ) { |
|
| 357 | - if ( 'draft' == $item->status && 'draft' != $this->status ) { |
|
| 353 | + /** |
|
| 354 | + * @param string $val |
|
| 355 | + */ |
|
| 356 | + private function add_draft_label( $item, &$val ) { |
|
| 357 | + if ( 'draft' == $item->status && 'draft' != $this->status ) { |
|
| 358 | 358 | $val .= ' - <span class="post-state">' . __( 'Draft', 'formidable' ) . '</span>'; |
| 359 | - } |
|
| 360 | - } |
|
| 361 | - |
|
| 362 | - /** |
|
| 363 | - * @param string $val |
|
| 364 | - */ |
|
| 365 | - private function add_form_description( $item, &$val ) { |
|
| 366 | - global $mode; |
|
| 367 | - if ( 'excerpt' == $mode ) { |
|
| 368 | - $val .= FrmAppHelper::truncate(strip_tags($item->description), 50); |
|
| 369 | - } |
|
| 370 | - } |
|
| 359 | + } |
|
| 360 | + } |
|
| 361 | + |
|
| 362 | + /** |
|
| 363 | + * @param string $val |
|
| 364 | + */ |
|
| 365 | + private function add_form_description( $item, &$val ) { |
|
| 366 | + global $mode; |
|
| 367 | + if ( 'excerpt' == $mode ) { |
|
| 368 | + $val .= FrmAppHelper::truncate(strip_tags($item->description), 50); |
|
| 369 | + } |
|
| 370 | + } |
|
| 371 | 371 | } |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $s = self::get_param( array( 'param' => 's', 'sanitize' => 'sanitize_text_field' ) ); |
| 47 | 47 | if ( $s != '' ) { |
| 48 | - preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); |
|
| 49 | - $search_terms = array_map('trim', $matches[0]); |
|
| 48 | + preg_match_all( '/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches ); |
|
| 49 | + $search_terms = array_map( 'trim', $matches[0] ); |
|
| 50 | 50 | foreach ( (array) $search_terms as $term ) { |
| 51 | 51 | $s_query[] = array( |
| 52 | 52 | 'or' => true, 'name LIKE' => $term, 'description LIKE' => $term, 'created_at LIKE' => $term, |
| 53 | 53 | ); |
| 54 | - unset($term); |
|
| 54 | + unset( $term ); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | <br/><br/><?php esc_html_e( 'To add a new template:', 'formidable' ) ?> |
| 71 | 71 | <ol> |
| 72 | 72 | <li><?php printf( esc_html__( 'Create a new %1$sform%2$s.', 'formidable' ), '<a href="' . esc_url( admin_url( 'admin?page=formidable&frm_action=new' ) ) . '"', '</a>' ) ?></li> |
| 73 | - <li><?php printf( esc_html__( 'After your form is created, go to Formidable -> %1$sForms%2$s.', 'formidable' ), '<a href="?page=formidable">', '</a>') ?></li> |
|
| 73 | + <li><?php printf( esc_html__( 'After your form is created, go to Formidable -> %1$sForms%2$s.', 'formidable' ), '<a href="?page=formidable">', '</a>' ) ?></li> |
|
| 74 | 74 | <li><?php esc_html_e( 'Place your mouse over the name of the form you just created, and click the "Create Template" link.', 'formidable' ) ?></li> |
| 75 | 75 | </ol> |
| 76 | 76 | <?php } else { |
@@ -87,17 +87,17 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | if ( 'trash' == $this->status ) { |
| 90 | - if ( current_user_can('frm_edit_forms') ) { |
|
| 90 | + if ( current_user_can( 'frm_edit_forms' ) ) { |
|
| 91 | 91 | $actions['bulk_untrash'] = __( 'Restore', 'formidable' ); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if ( current_user_can('frm_delete_forms') ) { |
|
| 94 | + if ( current_user_can( 'frm_delete_forms' ) ) { |
|
| 95 | 95 | $actions['bulk_delete'] = __( 'Delete Permanently', 'formidable' ); |
| 96 | 96 | } |
| 97 | - } else if ( EMPTY_TRASH_DAYS && current_user_can('frm_delete_forms') ) { |
|
| 97 | + } else if ( EMPTY_TRASH_DAYS && current_user_can( 'frm_delete_forms' ) ) { |
|
| 98 | 98 | $actions['bulk_trash'] = __( 'Move to Trash', 'formidable' ); |
| 99 | - } else if ( current_user_can('frm_delete_forms') ) { |
|
| 100 | - $actions['bulk_delete'] = __( 'Delete'); |
|
| 99 | + } else if ( current_user_can( 'frm_delete_forms' ) ) { |
|
| 100 | + $actions['bulk_delete'] = __( 'Delete' ); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | return $actions; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | return; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - if ( 'trash' == $this->status && current_user_can('frm_delete_forms') ) { |
|
| 111 | + if ( 'trash' == $this->status && current_user_can( 'frm_delete_forms' ) ) { |
|
| 112 | 112 | ?> |
| 113 | 113 | <div class="alignleft actions frm_visible_overflow"> |
| 114 | 114 | <?php submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false ); ?> |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $where = apply_filters( 'frm_forms_dropdown', array(), '' ); |
| 125 | 125 | $forms = FrmForm::get_published_forms( $where ); |
| 126 | 126 | |
| 127 | - $base = admin_url('admin.php?page=formidable&form_type=template'); |
|
| 127 | + $base = admin_url( 'admin.php?page=formidable&form_type=template' ); |
|
| 128 | 128 | $args = array( |
| 129 | 129 | 'frm_action' => 'duplicate', |
| 130 | 130 | 'template' => true, |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $args['id'] = $form->id; ?> |
| 145 | 145 | <li><a href="<?php echo esc_url( add_query_arg( $args, $base ) ); ?>" tabindex="-1"><?php echo esc_html( empty( $form->name ) ? __( '(no title)' ) : FrmAppHelper::truncate( $form->name, 33 ) ); ?></a></li> |
| 146 | 146 | <?php |
| 147 | - unset($form); |
|
| 147 | + unset( $form ); |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | ?> |
@@ -176,10 +176,10 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | if ( $counts->{$status} || 'published' == $status ) { |
| 179 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 179 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - unset($status, $name); |
|
| 182 | + unset( $status, $name ); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | return $links; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $edit_link = '?page=formidable&frm_action=edit&id=' . $item->id; |
| 204 | 204 | $duplicate_link = '?page=formidable&frm_action=duplicate&id=' . $item->id; |
| 205 | 205 | |
| 206 | - $this->get_actions($actions, $item, $edit_link, $duplicate_link); |
|
| 206 | + $this->get_actions( $actions, $item, $edit_link, $duplicate_link ); |
|
| 207 | 207 | |
| 208 | 208 | $action_links = $this->row_actions( $actions ); |
| 209 | 209 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | break; |
| 247 | 247 | case 'created_at': |
| 248 | - $date = date($format, strtotime($item->created_at)); |
|
| 248 | + $date = date( $format, strtotime( $item->created_at ) ); |
|
| 249 | 249 | $val = '<abbr title="' . esc_attr( date( 'Y/m/d g:i:s A', strtotime( $item->created_at ) ) ) . '">' . $date . '</abbr>'; |
| 250 | 250 | break; |
| 251 | 251 | case 'shortcode': |
@@ -256,11 +256,11 @@ discard block |
||
| 256 | 256 | break; |
| 257 | 257 | case 'entries': |
| 258 | 258 | if ( isset( $item->options['no_save'] ) && $item->options['no_save'] ) { |
| 259 | - $val = '<i class="frm_icon_font frm_forbid_icon frm_bstooltip" title="' . esc_attr('Saving entries is disabled for this form', 'formidable' ) . '"></i>'; |
|
| 259 | + $val = '<i class="frm_icon_font frm_forbid_icon frm_bstooltip" title="' . esc_attr( 'Saving entries is disabled for this form', 'formidable' ) . '"></i>'; |
|
| 260 | 260 | } else { |
| 261 | - $text = FrmEntry::getRecordCount($item->id); |
|
| 262 | - $val = current_user_can('frm_view_entries') ? '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-entries&form=' . $item->id ) ) . '">' . $text . '</a>' : $text; |
|
| 263 | - unset($text); |
|
| 261 | + $text = FrmEntry::getRecordCount( $item->id ); |
|
| 262 | + $val = current_user_can( 'frm_view_entries' ) ? '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-entries&form=' . $item->id ) ) . '">' . $text . '</a>' : $text; |
|
| 263 | + unset( $text ); |
|
| 264 | 264 | } |
| 265 | 265 | break; |
| 266 | 266 | case 'type': |
@@ -268,12 +268,12 @@ discard block |
||
| 268 | 268 | break; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - if ( isset($val) ) { |
|
| 271 | + if ( isset( $val ) ) { |
|
| 272 | 272 | $r .= "<td $attributes>"; |
| 273 | 273 | $r .= $val; |
| 274 | 274 | $r .= '</td>'; |
| 275 | 275 | } |
| 276 | - unset($val); |
|
| 276 | + unset( $val ); |
|
| 277 | 277 | } |
| 278 | 278 | $r .= '</tr>'; |
| 279 | 279 | |
@@ -286,18 +286,18 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | private function get_actions( &$actions, $item, $edit_link, $duplicate_link ) { |
| 288 | 288 | if ( 'trash' == $this->status ) { |
| 289 | - if ( current_user_can('frm_edit_forms') ) { |
|
| 289 | + if ( current_user_can( 'frm_edit_forms' ) ) { |
|
| 290 | 290 | $actions['restore'] = FrmFormsHelper::delete_trash_link( $item->id, $item->status, 'short' ); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - if ( current_user_can('frm_delete_forms') ) { |
|
| 293 | + if ( current_user_can( 'frm_delete_forms' ) ) { |
|
| 294 | 294 | $trash_url = wp_nonce_url( '?page=formidable&form_status=trash&frm_action=destroy&id=' . $item->id, 'destroy_form_' . $item->id ); |
| 295 | 295 | $actions['trash'] = '<a href="' . esc_url( $trash_url ) . '" class="submitdelete" onclick="return confirm(\'' . __( 'Are you sure you want to permanently delete that?', 'formidable' ) . '\')">' . __( 'Delete Permanently' ) . '</a>'; |
| 296 | 296 | } |
| 297 | 297 | return; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | - if ( current_user_can('frm_edit_forms') ) { |
|
| 300 | + if ( current_user_can( 'frm_edit_forms' ) ) { |
|
| 301 | 301 | if ( ! $item->is_template || ! $item->default_template ) { |
| 302 | 302 | $actions['frm_edit'] = '<a href="' . esc_url( $edit_link ) . '">' . __( 'Edit' ) . '</a>'; |
| 303 | 303 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | unset( $actions['trash'] ); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - $actions['view'] = '<a href="' . esc_url( FrmFormsHelper::get_direct_link( $item->form_key, $item ) ) . '" target="_blank">' . __( 'Preview') . '</a>'; |
|
| 322 | + $actions['view'] = '<a href="' . esc_url( FrmFormsHelper::get_direct_link( $item->form_key, $item ) ) . '" target="_blank">' . __( 'Preview' ) . '</a>'; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /** |
@@ -327,8 +327,8 @@ discard block |
||
| 327 | 327 | */ |
| 328 | 328 | private function get_form_name( $item, $actions, $edit_link, $mode = 'list' ) { |
| 329 | 329 | $form_name = $item->name; |
| 330 | - if ( trim($form_name) == '' ) { |
|
| 331 | - $form_name = __( '(no title)'); |
|
| 330 | + if ( trim( $form_name ) == '' ) { |
|
| 331 | + $form_name = __( '(no title)' ); |
|
| 332 | 332 | } |
| 333 | 333 | $form_name = FrmAppHelper::kses( $form_name ); |
| 334 | 334 | if ( 'excerpt' != $mode ) { |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | private function add_form_description( $item, &$val ) { |
| 366 | 366 | global $mode; |
| 367 | 367 | if ( 'excerpt' == $mode ) { |
| 368 | - $val .= FrmAppHelper::truncate(strip_tags($item->description), 50); |
|
| 368 | + $val .= FrmAppHelper::truncate( strip_tags( $item->description ), 50 ); |
|
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | } |
@@ -6,10 +6,10 @@ discard block |
||
| 6 | 6 | protected $field; |
| 7 | 7 | |
| 8 | 8 | public function prepare_items() { |
| 9 | - global $per_page; |
|
| 9 | + global $per_page; |
|
| 10 | 10 | |
| 11 | 11 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_entries_per_page' ); |
| 12 | - $form_id = $this->params['form']; |
|
| 12 | + $form_id = $this->params['form']; |
|
| 13 | 13 | |
| 14 | 14 | $s_query = array(); |
| 15 | 15 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $limit = FrmDb::esc_limit( $start . ',' . $per_page ); |
| 47 | 47 | $this->items = FrmEntry::getAll( $s_query, $order, $limit, true, $join_form_in_query ); |
| 48 | - $total_items = FrmEntry::getRecordCount($s_query); |
|
| 48 | + $total_items = FrmEntry::getRecordCount($s_query); |
|
| 49 | 49 | |
| 50 | 50 | $this->set_pagination_args( array( |
| 51 | 51 | 'total_items' => $total_items, |
@@ -55,18 +55,18 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function no_items() { |
| 57 | 57 | $s = self::get_param( array( 'param' => 's', 'sanitize' => 'sanitize_text_field' ) ); |
| 58 | - if ( ! empty($s) ) { |
|
| 58 | + if ( ! empty($s) ) { |
|
| 59 | 59 | esc_html_e( 'No Entries Found', 'formidable' ); |
| 60 | - return; |
|
| 61 | - } |
|
| 60 | + return; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | 63 | $form_id = $this->params['form']; |
| 64 | 64 | $form = $this->params['form']; |
| 65 | 65 | |
| 66 | - if ( $form_id ) { |
|
| 67 | - $form = FrmForm::getOne($form_id); |
|
| 68 | - } |
|
| 69 | - $colspan = $this->get_column_count(); |
|
| 66 | + if ( $form_id ) { |
|
| 67 | + $form = FrmForm::getOne($form_id); |
|
| 68 | + } |
|
| 69 | + $colspan = $this->get_column_count(); |
|
| 70 | 70 | |
| 71 | 71 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/no_entries.php' ); |
| 72 | 72 | } |
@@ -86,12 +86,12 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | - * Gets the name of the primary column in the Entries screen |
|
| 90 | - * |
|
| 91 | - * @since 2.0.14 |
|
| 92 | - * |
|
| 93 | - * @return string $primary_column |
|
| 94 | - */ |
|
| 89 | + * Gets the name of the primary column in the Entries screen |
|
| 90 | + * |
|
| 91 | + * @since 2.0.14 |
|
| 92 | + * |
|
| 93 | + * @return string $primary_column |
|
| 94 | + */ |
|
| 95 | 95 | protected function get_primary_column_name() { |
| 96 | 96 | $columns = get_column_headers( $this->screen ); |
| 97 | 97 | $hidden = get_hidden_columns( $this->screen ); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | $this->get_actions( $actions, $item, $view_link ); |
| 117 | 117 | |
| 118 | - $action_links = $this->row_actions( $actions ); |
|
| 118 | + $action_links = $this->row_actions( $actions ); |
|
| 119 | 119 | |
| 120 | 120 | // Set up the checkbox ( because the user is editable, otherwise its empty ) |
| 121 | 121 | $checkbox = "<input type='checkbox' name='item-action[]' id='cb-item-action-{$item->id}' value='{$item->id}' />"; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $r = "<tr id='item-action-{$item->id}'$style>"; |
| 124 | 124 | |
| 125 | 125 | list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
| 126 | - $action_col = false; |
|
| 126 | + $action_col = false; |
|
| 127 | 127 | |
| 128 | 128 | foreach ( $columns as $column_name => $column_display_name ) { |
| 129 | 129 | $class = $column_name . ' column-' . $column_name; |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | if ( in_array( $column_name, $hidden ) ) { |
| 136 | 136 | $class .= ' frm_hidden'; |
| 137 | 137 | } else if ( ! $action_col && ! in_array( $column_name, array( 'cb', 'id', 'form_id', 'post_id' ) ) ) { |
| 138 | - $action_col = $column_name; |
|
| 139 | - } |
|
| 138 | + $action_col = $column_name; |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | 141 | $attributes = 'class="' . esc_attr( $class ) . '"'; |
| 142 | 142 | unset($class); |
@@ -154,15 +154,15 @@ discard block |
||
| 154 | 154 | $val = $this->column_value( $item ); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - $r .= "<td $attributes>"; |
|
| 157 | + $r .= "<td $attributes>"; |
|
| 158 | 158 | if ( $column_name == $action_col ) { |
| 159 | 159 | $edit_link = '?page=formidable-entries&frm_action=edit&id=' . $item->id; |
| 160 | 160 | $r .= '<a href="' . esc_url( isset( $actions['edit'] ) ? $edit_link : $view_link ) . '" class="row-title" >' . $val . '</a> '; |
| 161 | - $r .= $action_links; |
|
| 161 | + $r .= $action_links; |
|
| 162 | 162 | } else { |
| 163 | - $r .= $val; |
|
| 164 | - } |
|
| 165 | - $r .= '</td>'; |
|
| 163 | + $r .= $val; |
|
| 164 | + } |
|
| 165 | + $r .= '</td>'; |
|
| 166 | 166 | } |
| 167 | 167 | unset($val); |
| 168 | 168 | } |
@@ -215,19 +215,19 @@ discard block |
||
| 215 | 215 | return $val; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - /** |
|
| 219 | - * @param string $view_link |
|
| 220 | - */ |
|
| 221 | - private function get_actions( &$actions, $item, $view_link ) { |
|
| 218 | + /** |
|
| 219 | + * @param string $view_link |
|
| 220 | + */ |
|
| 221 | + private function get_actions( &$actions, $item, $view_link ) { |
|
| 222 | 222 | $actions['view'] = '<a href="' . esc_url( $view_link ) . '">' . __( 'View', 'formidable' ) . '</a>'; |
| 223 | 223 | |
| 224 | - if ( current_user_can('frm_delete_entries') ) { |
|
| 224 | + if ( current_user_can('frm_delete_entries') ) { |
|
| 225 | 225 | $delete_link = '?page=formidable-entries&frm_action=destroy&id=' . $item->id . '&form=' . $this->params['form']; |
| 226 | 226 | $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( $delete_link ) ) . '" class="submitdelete" onclick="return confirm(\'' . esc_attr( __( 'Are you sure you want to delete that?', 'formidable' ) ) . '\')">' . __( 'Delete' ) . '</a>'; |
| 227 | - } |
|
| 227 | + } |
|
| 228 | 228 | |
| 229 | - $actions = apply_filters('frm_row_actions', $actions, $item); |
|
| 230 | - } |
|
| 229 | + $actions = apply_filters('frm_row_actions', $actions, $item); |
|
| 230 | + } |
|
| 231 | 231 | |
| 232 | 232 | private function get_column_value( $item, &$val ) { |
| 233 | 233 | $col_name = $this->column_name; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $limit = FrmDb::esc_limit( $start . ',' . $per_page ); |
| 47 | 47 | $this->items = FrmEntry::getAll( $s_query, $order, $limit, true, $join_form_in_query ); |
| 48 | - $total_items = FrmEntry::getRecordCount($s_query); |
|
| 48 | + $total_items = FrmEntry::getRecordCount( $s_query ); |
|
| 49 | 49 | |
| 50 | 50 | $this->set_pagination_args( array( |
| 51 | 51 | 'total_items' => $total_items, |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function no_items() { |
| 57 | 57 | $s = self::get_param( array( 'param' => 's', 'sanitize' => 'sanitize_text_field' ) ); |
| 58 | - if ( ! empty($s) ) { |
|
| 58 | + if ( ! empty( $s ) ) { |
|
| 59 | 59 | esc_html_e( 'No Entries Found', 'formidable' ); |
| 60 | 60 | return; |
| 61 | 61 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $form = $this->params['form']; |
| 65 | 65 | |
| 66 | 66 | if ( $form_id ) { |
| 67 | - $form = FrmForm::getOne($form_id); |
|
| 67 | + $form = FrmForm::getOne( $form_id ); |
|
| 68 | 68 | } |
| 69 | 69 | $colspan = $this->get_column_count(); |
| 70 | 70 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $r = "<tr id='item-action-{$item->id}'$style>"; |
| 124 | 124 | |
| 125 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
| 125 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
| 126 | 126 | $action_col = false; |
| 127 | 127 | |
| 128 | 128 | foreach ( $columns as $column_name => $column_display_name ) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $attributes = 'class="' . esc_attr( $class ) . '"'; |
| 142 | - unset($class); |
|
| 142 | + unset( $class ); |
|
| 143 | 143 | $attributes .= ' data-colname="' . $column_display_name . '"'; |
| 144 | 144 | |
| 145 | 145 | $form_id = $this->params['form'] ? $this->params['form'] : 0; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | $r .= '</td>'; |
| 166 | 166 | } |
| 167 | - unset($val); |
|
| 167 | + unset( $val ); |
|
| 168 | 168 | } |
| 169 | 169 | $r .= '</tr>'; |
| 170 | 170 | |
@@ -221,12 +221,12 @@ discard block |
||
| 221 | 221 | private function get_actions( &$actions, $item, $view_link ) { |
| 222 | 222 | $actions['view'] = '<a href="' . esc_url( $view_link ) . '">' . __( 'View', 'formidable' ) . '</a>'; |
| 223 | 223 | |
| 224 | - if ( current_user_can('frm_delete_entries') ) { |
|
| 224 | + if ( current_user_can( 'frm_delete_entries' ) ) { |
|
| 225 | 225 | $delete_link = '?page=formidable-entries&frm_action=destroy&id=' . $item->id . '&form=' . $this->params['form']; |
| 226 | 226 | $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( $delete_link ) ) . '" class="submitdelete" onclick="return confirm(\'' . esc_attr( __( 'Are you sure you want to delete that?', 'formidable' ) ) . '\')">' . __( 'Delete' ) . '</a>'; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - $actions = apply_filters('frm_row_actions', $actions, $item); |
|
| 229 | + $actions = apply_filters( 'frm_row_actions', $actions, $item ); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | private function get_column_value( $item, &$val ) { |
@@ -1,67 +1,67 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | class FrmStylesHelper { |
| 3 | 3 | |
| 4 | - public static function jquery_themes() { |
|
| 5 | - $themes = array( |
|
| 6 | - 'ui-lightness' => 'UI Lightness', |
|
| 7 | - 'ui-darkness' => 'UI Darkness', |
|
| 8 | - 'smoothness' => 'Smoothness', |
|
| 9 | - 'start' => 'Start', |
|
| 10 | - 'redmond' => 'Redmond', |
|
| 11 | - 'sunny' => 'Sunny', |
|
| 12 | - 'overcast' => 'Overcast', |
|
| 13 | - 'le-frog' => 'Le Frog', |
|
| 14 | - 'flick' => 'Flick', |
|
| 4 | + public static function jquery_themes() { |
|
| 5 | + $themes = array( |
|
| 6 | + 'ui-lightness' => 'UI Lightness', |
|
| 7 | + 'ui-darkness' => 'UI Darkness', |
|
| 8 | + 'smoothness' => 'Smoothness', |
|
| 9 | + 'start' => 'Start', |
|
| 10 | + 'redmond' => 'Redmond', |
|
| 11 | + 'sunny' => 'Sunny', |
|
| 12 | + 'overcast' => 'Overcast', |
|
| 13 | + 'le-frog' => 'Le Frog', |
|
| 14 | + 'flick' => 'Flick', |
|
| 15 | 15 | 'pepper-grinder' => 'Pepper Grinder', |
| 16 | - 'eggplant' => 'Eggplant', |
|
| 17 | - 'dark-hive' => 'Dark Hive', |
|
| 18 | - 'cupertino' => 'Cupertino', |
|
| 19 | - 'south-street' => 'South Street', |
|
| 20 | - 'blitzer' => 'Blitzer', |
|
| 21 | - 'humanity' => 'Humanity', |
|
| 22 | - 'hot-sneaks' => 'Hot Sneaks', |
|
| 23 | - 'excite-bike' => 'Excite Bike', |
|
| 24 | - 'vader' => 'Vader', |
|
| 25 | - 'dot-luv' => 'Dot Luv', |
|
| 26 | - 'mint-choc' => 'Mint Choc', |
|
| 27 | - 'black-tie' => 'Black Tie', |
|
| 28 | - 'trontastic' => 'Trontastic', |
|
| 29 | - 'swanky-purse' => 'Swanky Purse', |
|
| 30 | - ); |
|
| 31 | - |
|
| 32 | - $themes = apply_filters('frm_jquery_themes', $themes); |
|
| 33 | - return $themes; |
|
| 34 | - } |
|
| 16 | + 'eggplant' => 'Eggplant', |
|
| 17 | + 'dark-hive' => 'Dark Hive', |
|
| 18 | + 'cupertino' => 'Cupertino', |
|
| 19 | + 'south-street' => 'South Street', |
|
| 20 | + 'blitzer' => 'Blitzer', |
|
| 21 | + 'humanity' => 'Humanity', |
|
| 22 | + 'hot-sneaks' => 'Hot Sneaks', |
|
| 23 | + 'excite-bike' => 'Excite Bike', |
|
| 24 | + 'vader' => 'Vader', |
|
| 25 | + 'dot-luv' => 'Dot Luv', |
|
| 26 | + 'mint-choc' => 'Mint Choc', |
|
| 27 | + 'black-tie' => 'Black Tie', |
|
| 28 | + 'trontastic' => 'Trontastic', |
|
| 29 | + 'swanky-purse' => 'Swanky Purse', |
|
| 30 | + ); |
|
| 31 | + |
|
| 32 | + $themes = apply_filters('frm_jquery_themes', $themes); |
|
| 33 | + return $themes; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | public static function jquery_css_url( $theme_css ) { |
| 37 | - if ( $theme_css == -1 ) { |
|
| 38 | - return; |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
| 42 | - $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
| 43 | - } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
| 44 | - $css_file = $theme_css; |
|
| 45 | - } else { |
|
| 46 | - $uploads = self::get_upload_base(); |
|
| 37 | + if ( $theme_css == -1 ) { |
|
| 38 | + return; |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
| 42 | + $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
| 43 | + } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
| 44 | + $css_file = $theme_css; |
|
| 45 | + } else { |
|
| 46 | + $uploads = self::get_upload_base(); |
|
| 47 | 47 | $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css'; |
| 48 | - if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
| 49 | - $css_file = $uploads['baseurl'] . $file_path; |
|
| 50 | - } else { |
|
| 48 | + if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
| 49 | + $css_file = $uploads['baseurl'] . $file_path; |
|
| 50 | + } else { |
|
| 51 | 51 | $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css'; |
| 52 | - } |
|
| 53 | - } |
|
| 52 | + } |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - return $css_file; |
|
| 56 | - } |
|
| 55 | + return $css_file; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - public static function enqueue_jquery_css() { |
|
| 58 | + public static function enqueue_jquery_css() { |
|
| 59 | 59 | $form = self::get_form_for_page(); |
| 60 | 60 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
| 61 | - if ( $theme_css != -1 ) { |
|
| 62 | - wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
| 63 | - } |
|
| 64 | - } |
|
| 61 | + if ( $theme_css != -1 ) { |
|
| 62 | + wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
| 63 | + } |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | 66 | public static function get_form_for_page() { |
| 67 | 67 | global $frm_vars; |
@@ -77,14 +77,14 @@ discard block |
||
| 77 | 77 | return $form_id; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - public static function get_upload_base() { |
|
| 81 | - $uploads = wp_upload_dir(); |
|
| 82 | - if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
| 83 | - $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
| 84 | - } |
|
| 80 | + public static function get_upload_base() { |
|
| 81 | + $uploads = wp_upload_dir(); |
|
| 82 | + if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
| 83 | + $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - return $uploads; |
|
| 87 | - } |
|
| 86 | + return $uploads; |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | 89 | public static function style_menu( $active = '' ) { |
| 90 | 90 | ?> |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php esc_html_e( 'Custom CSS', 'formidable' ) ?></a> |
| 95 | 95 | </h2> |
| 96 | 96 | <?php |
| 97 | - } |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | 100 | * @since 2.05 |
@@ -121,20 +121,20 @@ discard block |
||
| 121 | 121 | ); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - public static function minus_icons() { |
|
| 125 | - return array( |
|
| 124 | + public static function minus_icons() { |
|
| 125 | + return array( |
|
| 126 | 126 | 0 => array( '-' => '62e', '+' => '62f' ), |
| 127 | 127 | 1 => array( '-' => '600', '+' => '602' ), |
| 128 | 128 | 2 => array( '-' => '604', '+' => '603' ), |
| 129 | 129 | 3 => array( '-' => '633', '+' => '632' ), |
| 130 | 130 | 4 => array( '-' => '613', '+' => '60f' ), |
| 131 | - ); |
|
| 132 | - } |
|
| 131 | + ); |
|
| 132 | + } |
|
| 133 | 133 | |
| 134 | - public static function arrow_icons() { |
|
| 135 | - $minus_icons = self::minus_icons(); |
|
| 134 | + public static function arrow_icons() { |
|
| 135 | + $minus_icons = self::minus_icons(); |
|
| 136 | 136 | |
| 137 | - return array( |
|
| 137 | + return array( |
|
| 138 | 138 | 6 => array( '-' => '62d', '+' => '62a' ), |
| 139 | 139 | 0 => array( '-' => '60d', '+' => '609' ), |
| 140 | 140 | 1 => array( '-' => '60e', '+' => '60c' ), |
@@ -142,44 +142,44 @@ discard block |
||
| 142 | 142 | 3 => array( '-' => '62b', '+' => '628' ), |
| 143 | 143 | 4 => array( '-' => '62c', '+' => '629' ), |
| 144 | 144 | 5 => array( '-' => '635', '+' => '634' ), |
| 145 | - 'p0' => $minus_icons[0], |
|
| 146 | - 'p1' => $minus_icons[1], |
|
| 147 | - 'p2' => $minus_icons[2], |
|
| 148 | - 'p3' => $minus_icons[3], |
|
| 149 | - 'p4' => $minus_icons[4], |
|
| 150 | - ); |
|
| 151 | - } |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * @since 2.0 |
|
| 155 | - * @return The class for this icon |
|
| 156 | - */ |
|
| 145 | + 'p0' => $minus_icons[0], |
|
| 146 | + 'p1' => $minus_icons[1], |
|
| 147 | + 'p2' => $minus_icons[2], |
|
| 148 | + 'p3' => $minus_icons[3], |
|
| 149 | + 'p4' => $minus_icons[4], |
|
| 150 | + ); |
|
| 151 | + } |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * @since 2.0 |
|
| 155 | + * @return The class for this icon |
|
| 156 | + */ |
|
| 157 | 157 | public static function icon_key_to_class( $key, $icon = '+', $type = 'arrow' ) { |
| 158 | - if ( 'arrow' == $type && is_numeric($key) ) { |
|
| 159 | - //frm_arrowup6_icon |
|
| 158 | + if ( 'arrow' == $type && is_numeric($key) ) { |
|
| 159 | + //frm_arrowup6_icon |
|
| 160 | 160 | $arrow = array( '-' => 'down', '+' => 'up' ); |
| 161 | 161 | $class = 'frm_arrow' . $arrow[ $icon ]; |
| 162 | - } else { |
|
| 163 | - //frm_minus1_icon |
|
| 164 | - $key = str_replace('p', '', $key); |
|
| 162 | + } else { |
|
| 163 | + //frm_minus1_icon |
|
| 164 | + $key = str_replace('p', '', $key); |
|
| 165 | 165 | $plus = array( '-' => 'minus', '+' => 'plus' ); |
| 166 | 166 | $class = 'frm_' . $plus[ $icon ]; |
| 167 | - } |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | - if ( $key ) { |
|
| 170 | - $class .= $key; |
|
| 171 | - } |
|
| 172 | - $class .= '_icon'; |
|
| 169 | + if ( $key ) { |
|
| 170 | + $class .= $key; |
|
| 171 | + } |
|
| 172 | + $class .= '_icon'; |
|
| 173 | 173 | |
| 174 | - return $class; |
|
| 175 | - } |
|
| 174 | + return $class; |
|
| 175 | + } |
|
| 176 | 176 | |
| 177 | 177 | public static function bs_icon_select( $style, $frm_style, $type = 'arrow' ) { |
| 178 | 178 | $function_name = $type . '_icons'; |
| 179 | 179 | $icons = self::$function_name(); |
| 180 | 180 | unset( $function_name ); |
| 181 | 181 | |
| 182 | - $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
|
| 182 | + $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
|
| 183 | 183 | ?> |
| 184 | 184 | <select name="<?php echo esc_attr( $frm_style->get_field_name($name) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
| 185 | 185 | <?php foreach ( $icons as $key => $icon ) { ?> |
@@ -212,24 +212,24 @@ discard block |
||
| 212 | 212 | </ul> |
| 213 | 213 | </div> |
| 214 | 214 | <?php |
| 215 | - } |
|
| 215 | + } |
|
| 216 | 216 | |
| 217 | 217 | public static function hex2rgb( $hex ) { |
| 218 | - $hex = str_replace('#', '', $hex); |
|
| 218 | + $hex = str_replace('#', '', $hex); |
|
| 219 | 219 | |
| 220 | - if ( strlen($hex) == 3 ) { |
|
| 220 | + if ( strlen($hex) == 3 ) { |
|
| 221 | 221 | $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); |
| 222 | 222 | $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); |
| 223 | 223 | $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); |
| 224 | - } else { |
|
| 224 | + } else { |
|
| 225 | 225 | $r = hexdec( substr( $hex, 0, 2 ) ); |
| 226 | 226 | $g = hexdec( substr( $hex, 2, 2 ) ); |
| 227 | 227 | $b = hexdec( substr( $hex, 4, 2 ) ); |
| 228 | - } |
|
| 228 | + } |
|
| 229 | 229 | $rgb = array( $r, $g, $b ); |
| 230 | - return implode(',', $rgb); // returns the rgb values separated by commas |
|
| 231 | - //return $rgb; // returns an array with the rgb values |
|
| 232 | - } |
|
| 230 | + return implode(',', $rgb); // returns the rgb values separated by commas |
|
| 231 | + //return $rgb; // returns an array with the rgb values |
|
| 232 | + } |
|
| 233 | 233 | |
| 234 | 234 | /** |
| 235 | 235 | * @param $hex string - The original color in hex format #ffffff |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | 'swanky-purse' => 'Swanky Purse', |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | - $themes = apply_filters('frm_jquery_themes', $themes); |
|
| 32 | + $themes = apply_filters( 'frm_jquery_themes', $themes ); |
|
| 33 | 33 | return $themes; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
| 42 | 42 | $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
| 43 | - } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
| 43 | + } else if ( preg_match( '/^http.?:\/\/.*\..*$/', $theme_css ) ) { |
|
| 44 | 44 | $css_file = $theme_css; |
| 45 | 45 | } else { |
| 46 | 46 | $uploads = self::get_upload_base(); |
| 47 | 47 | $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css'; |
| 48 | - if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
| 48 | + if ( file_exists( $uploads['basedir'] . $file_path ) ) { |
|
| 49 | 49 | $css_file = $uploads['baseurl'] . $file_path; |
| 50 | 50 | } else { |
| 51 | 51 | $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css'; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $form = self::get_form_for_page(); |
| 60 | 60 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
| 61 | 61 | if ( $theme_css != -1 ) { |
| 62 | - wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
| 62 | + wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() ); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public static function get_upload_base() { |
| 81 | 81 | $uploads = wp_upload_dir(); |
| 82 | - if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
| 83 | - $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
| 82 | + if ( is_ssl() && ! preg_match( '/^https:\/\/.*\..*$/', $uploads['baseurl'] ) ) { |
|
| 83 | + $uploads['baseurl'] = str_replace( 'http://', 'https://', $uploads['baseurl'] ); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return $uploads; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | <h2 class="nav-tab-wrapper"> |
| 92 | 92 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles' ) ) ?>" class="nav-tab <?php echo ( '' == $active ) ? 'nav-tab-active' : '' ?>"><?php esc_html_e( 'Edit Styles', 'formidable' ) ?></a> |
| 93 | 93 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=manage' ) ) ?>" class="nav-tab <?php echo ( 'manage' == $active ) ? 'nav-tab-active' : '' ?>"><?php esc_html_e( 'Manage Form Styles', 'formidable' ) ?></a> |
| 94 | - <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php esc_html_e( 'Custom CSS', 'formidable' ) ?></a> |
|
| 94 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php esc_html_e( 'Custom CSS', 'formidable' ) ?></a> |
|
| 95 | 95 | </h2> |
| 96 | 96 | <?php |
| 97 | 97 | } |
@@ -155,15 +155,15 @@ discard block |
||
| 155 | 155 | * @return The class for this icon |
| 156 | 156 | */ |
| 157 | 157 | public static function icon_key_to_class( $key, $icon = '+', $type = 'arrow' ) { |
| 158 | - if ( 'arrow' == $type && is_numeric($key) ) { |
|
| 158 | + if ( 'arrow' == $type && is_numeric( $key ) ) { |
|
| 159 | 159 | //frm_arrowup6_icon |
| 160 | 160 | $arrow = array( '-' => 'down', '+' => 'up' ); |
| 161 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
| 161 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
| 162 | 162 | } else { |
| 163 | 163 | //frm_minus1_icon |
| 164 | - $key = str_replace('p', '', $key); |
|
| 164 | + $key = str_replace( 'p', '', $key ); |
|
| 165 | 165 | $plus = array( '-' => 'minus', '+' => 'plus' ); |
| 166 | - $class = 'frm_' . $plus[ $icon ]; |
|
| 166 | + $class = 'frm_' . $plus[$icon]; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | if ( $key ) { |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
| 183 | 183 | ?> |
| 184 | - <select name="<?php echo esc_attr( $frm_style->get_field_name($name) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
|
| 184 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
|
| 185 | 185 | <?php foreach ( $icons as $key => $icon ) { ?> |
| 186 | - <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $style->post_content[ $name ], $key ) ?>> |
|
| 186 | + <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $style->post_content[$name], $key ) ?>> |
|
| 187 | 187 | <?php echo '' . $icon['+'] . '; ' . $icon['-'] . ';'; ?> |
| 188 | 188 | </option> |
| 189 | 189 | <?php } ?> |
@@ -191,8 +191,8 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | <div class="btn-group hide-if-no-js" id="frm_<?php echo esc_attr( $name ) ?>_select"> |
| 193 | 193 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
| 194 | - <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ) ?>"></i> |
|
| 195 | - <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ) ?>"></i> |
|
| 194 | + <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[$name], '+', $type ) ) ?>"></i> |
|
| 195 | + <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[$name], '-', $type ) ) ?>"></i> |
|
| 196 | 196 | <b class="caret"></b> |
| 197 | 197 | </button> |
| 198 | 198 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -215,9 +215,9 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | public static function hex2rgb( $hex ) { |
| 218 | - $hex = str_replace('#', '', $hex); |
|
| 218 | + $hex = str_replace( '#', '', $hex ); |
|
| 219 | 219 | |
| 220 | - if ( strlen($hex) == 3 ) { |
|
| 220 | + if ( strlen( $hex ) == 3 ) { |
|
| 221 | 221 | $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); |
| 222 | 222 | $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); |
| 223 | 223 | $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $b = hexdec( substr( $hex, 4, 2 ) ); |
| 228 | 228 | } |
| 229 | 229 | $rgb = array( $r, $g, $b ); |
| 230 | - return implode(',', $rgb); // returns the rgb values separated by commas |
|
| 230 | + return implode( ',', $rgb ); // returns the rgb values separated by commas |
|
| 231 | 231 | //return $rgb; // returns an array with the rgb values |
| 232 | 232 | } |
| 233 | 233 | |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | * @since 2.3 |
| 238 | 238 | */ |
| 239 | 239 | public static function adjust_brightness( $hex, $steps ) { |
| 240 | - $steps = max( -255, min( 255, $steps ) ); |
|
| 240 | + $steps = max( - 255, min( 255, $steps ) ); |
|
| 241 | 241 | |
| 242 | 242 | // Normalize into a six character long hex string |
| 243 | 243 | $hex = str_replace( '#', '', $hex ); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | foreach ( $color_parts as $color ) { |
| 255 | 255 | $color = hexdec( $color ); // Convert to decimal |
| 256 | - $color = max( 0,min( 255,$color + $steps ) ); // Adjust color |
|
| 256 | + $color = max( 0, min( 255, $color + $steps ) ); // Adjust color |
|
| 257 | 257 | $return .= str_pad( dechex( $color ), 2, '0', STR_PAD_LEFT ); // Make two char hex code |
| 258 | 258 | } |
| 259 | 259 | |
@@ -288,8 +288,8 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
| 290 | 290 | foreach ( $checkbox_opts as $opt ) { |
| 291 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
| 292 | - $settings[ $opt ] = 0; |
|
| 291 | + if ( ! isset( $settings[$opt] ) ) { |
|
| 292 | + $settings[$opt] = 0; |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | $colors = self::allow_color_override(); |
| 306 | 306 | foreach ( $colors as $css => $opts ) { |
| 307 | 307 | foreach ( $opts as $opt ) { |
| 308 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
| 308 | + self::get_color_output( $css, $settings[$opt] ); |
|
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( empty($values) || ! isset($values['fields']) || empty($values['fields']) ) { ?> |
|
| 3 | -<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($form); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
|
| 2 | +if ( empty( $values ) || ! isset( $values['fields'] ) || empty( $values['fields'] ) ) { ?> |
|
| 3 | +<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class( $form ); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
|
| 4 | 4 | <div class="frm_error_style"><strong><?php esc_html_e( 'Oops!', 'formidable' ) ?></strong> <?php printf( esc_html__( 'You did not add any fields to your form. %1$sGo back%2$s and add some.', 'formidable' ), '<a href="' . esc_url( admin_url( '?page=formidable&frm_action=edit&id=' . $form->id ) ) . '">', '</a>' ) ?> |
| 5 | 5 | </div> |
| 6 | 6 | </div> |
@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | <div class="frm_form_fields <?php echo esc_attr( apply_filters( 'frm_form_fields_class', '', $values ) ); ?>"> |
| 19 | 19 | <fieldset> |
| 20 | 20 | <?php echo FrmFormsHelper::replace_shortcodes( $values['before_html'], $form, $title, $description ); ?> |
| 21 | -<?php do_action( 'frm_after_title', compact('form') ) ?> |
|
| 22 | -<input type="hidden" name="frm_action" value="<?php echo esc_attr($form_action) ?>" /> |
|
| 23 | -<input type="hidden" name="form_id" value="<?php echo esc_attr($form->id) ?>" /> |
|
| 24 | -<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr($frm_hide_fields) ?>" /> |
|
| 25 | -<input type="hidden" name="form_key" value="<?php echo esc_attr($form->form_key) ?>" /> |
|
| 21 | +<?php do_action( 'frm_after_title', compact( 'form' ) ) ?> |
|
| 22 | +<input type="hidden" name="frm_action" value="<?php echo esc_attr( $form_action ) ?>" /> |
|
| 23 | +<input type="hidden" name="form_id" value="<?php echo esc_attr( $form->id ) ?>" /> |
|
| 24 | +<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr( $frm_hide_fields ) ?>" /> |
|
| 25 | +<input type="hidden" name="form_key" value="<?php echo esc_attr( $form->form_key ) ?>" /> |
|
| 26 | 26 | <input type="hidden" name="item_meta[0]" value="" /> |
| 27 | 27 | <?php wp_nonce_field( 'frm_submit_entry_nonce', 'frm_submit_entry_' . $form->id ); ?> |
| 28 | -<input type="text" class="frm_hidden frm_verify" id="frm_verify_<?php echo esc_attr( $form->id ) ?>" name="frm_verify" value="<?php echo esc_attr( FrmAppHelper::get_param('frm_verify', '', 'get', 'wp_kses_post' ) ) ?>" <?php FrmFormsHelper::maybe_hide_inline() ?> /> |
|
| 28 | +<input type="text" class="frm_hidden frm_verify" id="frm_verify_<?php echo esc_attr( $form->id ) ?>" name="frm_verify" value="<?php echo esc_attr( FrmAppHelper::get_param( 'frm_verify', '', 'get', 'wp_kses_post' ) ) ?>" <?php FrmFormsHelper::maybe_hide_inline() ?> /> |
|
| 29 | 29 | |
| 30 | 30 | <?php if ( isset( $id ) ) { ?><input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" /><?php } |
| 31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | } else { |
| 37 | 37 | do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) ); |
| 38 | 38 | } |
| 39 | - do_action('frm_get_field_scripts', $field, $form, $form->id); |
|
| 39 | + do_action( 'frm_get_field_scripts', $field, $form, $form->id ); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | if ( FrmAppHelper::is_admin() ) { ?> |
| 45 | 45 | <div class="frm_form_field form-field"> |
| 46 | 46 | <label class="frm_primary_label"><?php esc_html_e( 'Entry Key', 'formidable' ) ?></label> |
| 47 | -<input type="text" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" /> |
|
| 47 | +<input type="text" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" /> |
|
| 48 | 48 | </div> |
| 49 | 49 | <?php } else { ?> |
| 50 | -<input type="hidden" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" /> |
|
| 50 | +<input type="hidden" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" /> |
|
| 51 | 51 | <?php } |
| 52 | 52 | |
| 53 | -do_action('frm_entry_form', $form, $form_action, $errors); |
|
| 53 | +do_action( 'frm_entry_form', $form, $form_action, $errors ); |
|
| 54 | 54 | |
| 55 | 55 | global $frm_vars; |
| 56 | 56 | // close open section div |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // close open collapsible toggle div |
| 63 | -if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) { |
|
| 63 | +if ( isset( $frm_vars['collapse_div'] ) && $frm_vars['collapse_div'] ) { |
|
| 64 | 64 | echo "</div>\n"; |
| 65 | - unset($frm_vars['collapse_div']); |
|
| 65 | + unset( $frm_vars['collapse_div'] ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | -echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form); |
|
| 68 | +echo FrmFormsHelper::replace_shortcodes( $values['after_html'], $form ); |
|
| 69 | 69 | |
| 70 | 70 | if ( FrmForm::show_submit( $form ) ) { |
| 71 | 71 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | </fieldset> |
| 79 | 79 | </div> |
| 80 | 80 | <?php |
| 81 | -if ( has_action('frm_entries_footer_scripts') ) { |
|
| 81 | +if ( has_action( 'frm_entries_footer_scripts' ) ) { |
|
| 82 | 82 | ?><script type="text/javascript"><?php |
| 83 | 83 | do_action( 'frm_entries_footer_scripts', $values['fields'], $form ); |
| 84 | 84 | ?></script><?php |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <div class="frmcenter frm_no_entries_form"> |
| 2 | 2 | <?php |
| 3 | -if ( $form && isset($form->options['no_save']) && $form->options['no_save'] ) { ?> |
|
| 3 | +if ( $form && isset( $form->options['no_save'] ) && $form->options['no_save'] ) { ?> |
|
| 4 | 4 | <h3><?php esc_html_e( 'This form is not set to save any entries.', 'formidable' ) ?></h3> |
| 5 | 5 | <p>If you would like entries in this form to be saved, go to the <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable' ) . '&frm_action=settings&id=' . $form->id ) ?>">form Settings</a> page and uncheck the "Do not store any entries submitted from this form" box.</p> |
| 6 | 6 | <?php |
| 7 | 7 | } else if ( $form ) { |
| 8 | 8 | ?> |
| 9 | -<div class="frm_no_entries_header"><?php printf(__( 'No Entries for form: %s', 'formidable' ), $form->name); ?></div> |
|
| 10 | -<p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthe docs%2$s or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidableforms.com/knowledgebase/publish-your-forms/" target="_blank">', '</a> <br/>', '<a href="' . esc_url( admin_url('admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p> |
|
| 9 | +<div class="frm_no_entries_header"><?php printf( __( 'No Entries for form: %s', 'formidable' ), $form->name ); ?></div> |
|
| 10 | +<p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthe docs%2$s or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidableforms.com/knowledgebase/publish-your-forms/" target="_blank">', '</a> <br/>', '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p> |
|
| 11 | 11 | <?php |
| 12 | 12 | } else { |
| 13 | 13 | ?> |
@@ -206,10 +206,10 @@ |
||
| 206 | 206 | } else { |
| 207 | 207 | call_user_func( ( isset( $section['function'] ) ? $section['function'] : $section ) ); |
| 208 | 208 | } |
| 209 | - } ?> |
|
| 209 | + } ?> |
|
| 210 | 210 | </div> |
| 211 | 211 | <?php |
| 212 | - } ?> |
|
| 212 | + } ?> |
|
| 213 | 213 | |
| 214 | 214 | <p class="alignright frm_uninstall"> |
| 215 | 215 | <a href="javascript:void(0)" id="frm_uninstall_now"><?php esc_html_e( 'Uninstall Formidable', 'formidable' ) ?></a> |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | </ul> |
| 28 | 28 | </div> |
| 29 | 29 | |
| 30 | - <?php do_action('frm_before_settings'); ?> |
|
| 30 | + <?php do_action( 'frm_before_settings' ); ?> |
|
| 31 | 31 | |
| 32 | 32 | <form name="frm_settings_form" method="post" class="frm_settings_form" action="?page=formidable-settings<?php echo ( $a ? '&t=' . $a : '' ); ?>"> |
| 33 | 33 | <input type="hidden" name="frm_action" value="process-form" /> |
| 34 | 34 | <input type="hidden" name="action" value="process-form" /> |
| 35 | - <?php wp_nonce_field('process_form_nonce', 'process_form'); ?> |
|
| 35 | + <?php wp_nonce_field( 'process_form_nonce', 'process_form' ); ?> |
|
| 36 | 36 | |
| 37 | - <div class="general_settings tabs-panel <?php echo ($a == 'general_settings') ? 'frm_block' : 'frm_hidden'; ?>"> |
|
| 37 | + <div class="general_settings tabs-panel <?php echo ( $a == 'general_settings' ) ? 'frm_block' : 'frm_hidden'; ?>"> |
|
| 38 | 38 | <p class="submit"> |
| 39 | 39 | <input class="button-primary" type="submit" value="<?php esc_attr_e( 'Update Options', 'formidable' ) ?>" /> |
| 40 | 40 | </p> |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | <p> |
| 59 | 59 | <label for="frm_use_html"> |
| 60 | - <input type="checkbox" id="frm_use_html" name="frm_use_html" value="1" <?php checked($frm_settings->use_html, 1) ?>> <?php esc_html_e( 'Use HTML5 in forms', 'formidable' ) ?> |
|
| 60 | + <input type="checkbox" id="frm_use_html" name="frm_use_html" value="1" <?php checked( $frm_settings->use_html, 1 ) ?>> <?php esc_html_e( 'Use HTML5 in forms', 'formidable' ) ?> |
|
| 61 | 61 | </label> |
| 62 | 62 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'We recommend using HTML 5 for your forms. It adds some nifty options like placeholders, patterns, and autocomplete.', 'formidable' ) ?>"></span> |
| 63 | 63 | </p> |
| 64 | 64 | |
| 65 | - <?php do_action('frm_style_general_settings', $frm_settings); ?> |
|
| 65 | + <?php do_action( 'frm_style_general_settings', $frm_settings ); ?> |
|
| 66 | 66 | |
| 67 | 67 | <h3><?php esc_html_e( 'User Permissions', 'formidable' ); ?> |
| 68 | 68 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Select users that are allowed access to Formidable. Without access to View Forms, users will be unable to see the Formidable menu.', 'formidable' ) ?>"></span> |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | </p> |
| 87 | 87 | |
| 88 | 88 | <p><label class="frm_left_label"><?php esc_html_e( 'Site Key', 'formidable' ) ?></label> |
| 89 | - <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr($frm_settings->pubkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
| 89 | + <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr( $frm_settings->pubkey ) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
| 90 | 90 | |
| 91 | 91 | <p><label class="frm_left_label"><?php esc_html_e( 'Secret Key', 'formidable' ) ?></label> |
| 92 | - <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr($frm_settings->privkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
| 92 | + <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr( $frm_settings->privkey ) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
| 93 | 93 | |
| 94 | 94 | <p><label class="frm_left_label"><?php esc_html_e( 'reCAPTCHA Type', 'formidable' ) ?></label> |
| 95 | 95 | <select name="frm_re_type" id="frm_re_type"> |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | <select name="frm_re_lang" id="frm_re_lang"> |
| 106 | 106 | <option value="" <?php selected( $frm_settings->re_lang, '' ) ?>><?php esc_html_e( 'Browser Default', 'formidable' ); ?></option> |
| 107 | 107 | <?php foreach ( $captcha_lang as $lang => $lang_name ) { ?> |
| 108 | - <option value="<?php echo esc_attr($lang) ?>" <?php selected($frm_settings->re_lang, $lang) ?>><?php echo esc_html( $lang_name ) ?></option> |
|
| 108 | + <option value="<?php echo esc_attr( $lang ) ?>" <?php selected( $frm_settings->re_lang, $lang ) ?>><?php echo esc_html( $lang_name ) ?></option> |
|
| 109 | 109 | <?php } ?> |
| 110 | 110 | </select></p> |
| 111 | 111 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | <label class="frm_left_label"><?php esc_html_e( 'Success Message', 'formidable' ); ?> |
| 159 | 159 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'The default message seen after a form is submitted.', 'formidable' ) ?>" ></span> |
| 160 | 160 | </label> |
| 161 | - <input type="text" id="frm_success_msg" name="frm_success_msg" class="frm_with_left_label" value="<?php echo esc_attr($frm_settings->success_msg) ?>" /> |
|
| 161 | + <input type="text" id="frm_success_msg" name="frm_success_msg" class="frm_with_left_label" value="<?php echo esc_attr( $frm_settings->success_msg ) ?>" /> |
|
| 162 | 162 | </p> |
| 163 | 163 | |
| 164 | 164 | <p> |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | <input type="text" value="<?php echo esc_attr( $frm_settings->submit_value ) ?>" id="frm_submit_value" name="frm_submit_value" class="frm_with_left_label" /> |
| 167 | 167 | </p> |
| 168 | 168 | |
| 169 | - <?php do_action('frm_settings_form', $frm_settings); ?> |
|
| 169 | + <?php do_action( 'frm_settings_form', $frm_settings ); ?> |
|
| 170 | 170 | |
| 171 | 171 | <?php if ( ! FrmAppHelper::pro_is_installed() ) { ?> |
| 172 | 172 | <div class="clear"></div> |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | <?php } ?> |
| 177 | 177 | |
| 178 | 178 | <p><label class="frm_left_label"><?php esc_html_e( 'Preview Page', 'formidable' ); ?></label> |
| 179 | - <?php FrmAppHelper::wp_pages_dropdown('frm-preview-page-id', $frm_settings->preview_page_id ) ?> |
|
| 179 | + <?php FrmAppHelper::wp_pages_dropdown( 'frm-preview-page-id', $frm_settings->preview_page_id ) ?> |
|
| 180 | 180 | </p> |
| 181 | 181 | |
| 182 | 182 | <p> |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | -<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('post_excerpt', '') ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" /> |
|
| 2 | -<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('ID', '') ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" /> |
|
| 1 | +<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'post_excerpt', '' ) ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" /> |
|
| 2 | +<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" /> |
|
| 3 | 3 | |
| 4 | 4 | <table class="form-table"> |
| 5 | 5 | <tr> |
| 6 | 6 | <th> |
| 7 | - <label <?php FrmAppHelper::maybe_add_tooltip('action_title') ?>><?php esc_html_e( 'Label', 'formidable' ) ?></label> |
|
| 7 | + <label <?php FrmAppHelper::maybe_add_tooltip( 'action_title' ) ?>><?php esc_html_e( 'Label', 'formidable' ) ?></label> |
|
| 8 | 8 | </th> |
| 9 | - <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name('post_title', '') ) ?>" value="<?php echo esc_attr($form_action->post_title); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip('action_title', 'open') ?>" id="<?php echo esc_attr( $action_control->get_field_id('action_post_title') ) ?>" /> |
|
| 9 | + <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name( 'post_title', '' ) ) ?>" value="<?php echo esc_attr( $form_action->post_title ); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip( 'action_title', 'open' ) ?>" id="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ) ?>" /> |
|
| 10 | 10 | </td> |
| 11 | 11 | </tr> |
| 12 | 12 | </table> |
| 13 | -<?php $action_control->form($form_action, compact('form', 'action_key', 'values')); |
|
| 13 | +<?php $action_control->form( $form_action, compact( 'form', 'action_key', 'values' ) ); |
|
| 14 | 14 | |
| 15 | 15 | if ( ! isset( $action_control->action_options['event'] ) ) { |
| 16 | 16 | $events = 'create'; |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | if ( count( $action_control->action_options['event'] ) == 1 || $action_control->action_options['force_event'] ) { |
| 24 | 24 | foreach ( $action_control->action_options['event'] as $e ) { ?> |
| 25 | - <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" value="<?php echo esc_attr( $e ) ?>" /> |
|
| 25 | + <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" value="<?php echo esc_attr( $e ) ?>" /> |
|
| 26 | 26 | <?php |
| 27 | 27 | } |
| 28 | 28 | } else { |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | <h3><?php esc_html_e( 'Action Triggers', 'formidable' ); ?></h3> |
| 31 | 31 | <p> |
| 32 | 32 | <label class="frm_left_label"><?php esc_html_e( 'Trigger this action after', 'formidable' ) ?></label> |
| 33 | - <select name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id('event') ) ?>"> |
|
| 33 | + <select name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id( 'event' ) ) ?>"> |
|
| 34 | 34 | <?php |
| 35 | 35 | |
| 36 | 36 | $event_labels = FrmFormAction::trigger_labels(); |
| 37 | 37 | foreach ( $action_control->action_options['event'] as $event ) { ?> |
| 38 | - <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?></option> |
|
| 38 | + <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[$event] ) ? $event_labels[$event] : $event; ?></option> |
|
| 39 | 39 | <?php |
| 40 | 40 | }?> |
| 41 | 41 | </select> |
@@ -47,5 +47,5 @@ discard block |
||
| 47 | 47 | do_action( 'frm_additional_action_settings', $form_action, $pass_args ); |
| 48 | 48 | |
| 49 | 49 | ?> |
| 50 | -<span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID); ?></span> |
|
| 50 | +<span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID ); ?></span> |
|
| 51 | 51 | <div style="clear:both;"></div> |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | -<?php wp_nonce_field('frm_save_form_nonce', 'frm_save_form'); ?> |
|
| 1 | +<?php wp_nonce_field( 'frm_save_form_nonce', 'frm_save_form' ); ?> |
|
| 2 | 2 | <input type="hidden" name="status" value="<?php echo esc_attr( $values['status'] ); ?>" /> |
| 3 | 3 | <input type="hidden" name="new_status" value="" /> |
| 4 | 4 | |
| 5 | 5 | <div id="frm_form_editor_container"> |
| 6 | 6 | <div id="titlediv"> |
| 7 | - <input type="text" name="name" value="<?php echo esc_attr($form->name); ?>" id="title" placeholder="<?php esc_attr_e( 'Enter title here') ?>" /> |
|
| 7 | + <input type="text" name="name" value="<?php echo esc_attr( $form->name ); ?>" id="title" placeholder="<?php esc_attr_e( 'Enter title here' ) ?>" /> |
|
| 8 | 8 | <div id="edit-slug-box" class="hide-if-no-js"> |
| 9 | 9 | <div id="frm_form_key_box" class="alignright"> |
| 10 | 10 | <strong><?php esc_html_e( 'Form Key:', 'formidable' ) ?></strong> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | </div> |
| 17 | 17 | |
| 18 | 18 | <div class="postbox"> |
| 19 | - <div class="frm_no_fields <?php echo ( isset($values['fields']) && ! empty($values['fields']) ) ? 'frm_hidden' : ''; ?>"> |
|
| 19 | + <div class="frm_no_fields <?php echo ( isset( $values['fields'] ) && ! empty( $values['fields'] ) ) ? 'frm_hidden' : ''; ?>"> |
|
| 20 | 20 | <div class="alignleft sketch1"> |
| 21 | 21 | <img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/sketch_arrow1.png' ); ?>" alt="" /> |
| 22 | 22 | </div> |
@@ -50,16 +50,16 @@ discard block |
||
| 50 | 50 | </div> |
| 51 | 51 | <ul id="new_fields" class="frm_sorting inside"> |
| 52 | 52 | <?php |
| 53 | -if ( isset($values['fields']) && ! empty($values['fields']) ) { |
|
| 53 | +if ( isset( $values['fields'] ) && ! empty( $values['fields'] ) ) { |
|
| 54 | 54 | $count = 0; |
| 55 | 55 | foreach ( $values['fields'] as $field ) { |
| 56 | - $count++; |
|
| 56 | + $count ++; |
|
| 57 | 57 | $field_name = 'item_meta[' . $field['id'] . ']'; |
| 58 | - $html_id = FrmFieldsHelper::get_html_id($field); |
|
| 58 | + $html_id = FrmFieldsHelper::get_html_id( $field ); |
|
| 59 | 59 | require( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/add_field.php' ); |
| 60 | - unset($field, $field_name); |
|
| 60 | + unset( $field, $field_name ); |
|
| 61 | 61 | } |
| 62 | - unset($count); |
|
| 62 | + unset( $count ); |
|
| 63 | 63 | } ?> |
| 64 | 64 | </ul> |
| 65 | 65 | </div> |