| @@ -184,10 +184,10 @@ | ||
| 184 | 184 | |
| 185 | 185 | /////////////////////////////////////////////////////////////// |
| 186 | 186 | // Listing Template |
| 187 | 187 | /////////////////////////////////////////////////////////////// |
| 188 | - $row_template = get_wpbm_option( 'wpbm_listing_template' ); | |
| 189 | - | |
| 188 | + $row_template = wpbm_sanitize_listing_template( get_wpbm_option( 'wpbm_listing_template' ) ); | |
| 189 | + | |
| 190 | 190 | // Normilize |
| 191 | 191 | $replace_array = array(); |
| 192 | 192 | foreach ( $evnt as $key => $value ) { |
| 193 | 193 | $key = str_replace( '_BOOKING_', '', $key ); |
| @@ -204,9 +204,9 @@ | ||
| 204 | 204 | |
| 205 | 205 | //FixIn: 2.0.11.5 |
| 206 | 206 | $replace_array['BOOKING_LINK'] = htmlspecialchars_decode( |
| 207 | 207 | // '<a href="' . |
| 208 | - esc_url( wpbc_get_bookings_url() . '&view_mode=vm_listing&tab=actions&wh_booking_id=' . $my_booking_id ) | |
| 208 | + esc_url( wpbc_get_bookings_url() . '&tab=vm_booking_listing&wh_booking_id=' . $my_booking_id ) | |
| 209 | 209 | // . '">' . __('here', 'booking') . '</a>' |
| 210 | 210 | ); |
| 211 | 211 | } |
| 212 | 212 | |
| @@ -223,40 +223,40 @@ | ||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | if ( ! empty( $replace_array['DATES'] ) ) |
| 226 | 226 | $replace_array['DATES'] = wpbm_get_dates_short_format( $replace_array['DATES'] ); |
| 227 | - | |
| 227 | + | |
| 228 | 228 | $echo_row = wpbm_replace_shortcodes( $row_template, $replace_array ); |
| 229 | - | |
| 229 | + | |
| 230 | 230 | return $echo_row; |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
| 234 | - | |
| 234 | + | |
| 235 | 235 | /** Sort events by Check In days |
| 236 | - * | |
| 236 | + * | |
| 237 | 237 | * @param array $ics_events_arr |
| 238 | 238 | * @param string $sort_key - Default: '_BOOKING_DATES' |
| 239 | 239 | * @return array |
| 240 | - */ | |
| 240 | + */ | |
| 241 | 241 | function wpbm_sort_events_by( $ics_events_arr, $sort_key = '_BOOKING_DATES' ) { |
| 242 | - | |
| 242 | + | |
| 243 | 243 | // Get array with check in date |
| 244 | - $check_in_arr = array(); | |
| 244 | + $check_in_arr = array(); | |
| 245 | 245 | foreach ( $ics_events_arr as $key => $event_arr) { |
| 246 | 246 | $event_dates = $event_arr[ $sort_key ]; |
| 247 | 247 | sort( $event_dates ); |
| 248 | 248 | $check_in_arr[ $key ] = $event_dates[ 0 ]; |
| 249 | 249 | } |
| 250 | - | |
| 250 | + | |
| 251 | 251 | asort( $check_in_arr, SORT_STRING ); // Sort an array and maintain index association |
| 252 | - | |
| 252 | + | |
| 253 | 253 | // Sort inpur arr, by keys from previous check in array |
| 254 | 254 | $sorted_events_arr = array(); |
| 255 | 255 | foreach ( $check_in_arr as $key => $event_check_in) { |
| 256 | 256 | $sorted_events_arr[] = $ics_events_arr[ $key ]; |
| 257 | 257 | } |
| 258 | - | |
| 258 | + | |
| 259 | 259 | return $sorted_events_arr; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | |
| @@ -261,5 +261,5 @@ | ||
| 261 | 261 | |
| 262 | 262 | |
| 263 | 263 | |
| 264 | 264 | // TODO: |
| 265 | -// - list events by days and not events ??? currently if (0) {...} | |
| 265 | +// - list events by days and not events ??? currently if (0) {...} | |