| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
class FrmTransLiteEntriesController { |
| 7 |
|
| 8 |
/** |
| 9 |
* Include payment details in the entry sidebar. |
| 10 |
* |
| 11 |
* @param stdClass $entry |
| 12 |
* @return void |
| 13 |
*/ |
| 14 |
public static function sidebar_list( $entry ) { |
| 15 |
if ( FrmTransLiteAppHelper::should_fallback_to_paypal() ) { |
| 16 |
return; |
| 17 |
} |
| 18 |
|
| 19 |
// This line removes PayPal actions from the entries sidebar. |
| 20 |
remove_action( 'frm_show_entry_sidebar', 'FrmPaymentsController::sidebar_list' ); |
| 21 |
add_action( 'frm_entry_shared_sidebar_middle', __CLASS__ . '::show_sidebar_list' ); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Show the payment details in the entry sidebar. |
| 26 |
* |
| 27 |
* @param stdClass $entry |
| 28 |
* @return void |
| 29 |
*/ |
| 30 |
public static function show_sidebar_list( $entry ) { |
| 31 |
$frm_payment = new FrmTransLitePayment(); |
| 32 |
$payments = $frm_payment->get_all_for_entry( $entry->id ); |
| 33 |
if ( ! $payments ) { |
| 34 |
return; |
| 35 |
} |
| 36 |
|
| 37 |
$frm_sub = new FrmTransLiteSubscription(); |
| 38 |
$subscriptions = $frm_sub->get_all_for_entry( $entry->id ); |
| 39 |
$entry_total = 0; |
| 40 |
$date_format = get_option( 'date_format' ); |
| 41 |
|
| 42 |
FrmTransLiteActionsController::actions_js(); |
| 43 |
|
| 44 |
include FrmTransLiteAppHelper::plugin_path() . '/views/payments/sidebar_list.php'; |
| 45 |
} |
| 46 |
} |
| 47 |
|