DeprecateOldTemplateHook.php
5 years ago
HookCommandInterface.php
5 years ago
SetupFieldConfirmation.php
5 years ago
SetupFieldEmailTag.php
5 years ago
SetupFieldPersistance.php
5 years ago
SetupFieldReceipt.php
5 years ago
SetupFieldValidation.php
5 years ago
SetupNewTemplateHook.php
5 years ago
SetupPaymentDetailsDisplay.php
5 years ago
SetupPaymentDetailsDisplay.php
64 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Form\LegacyConsumer\Commands; |
| 4 | |
| 5 | use Give\Framework\FieldsAPI\FormField; |
| 6 | use Give\Framework\FieldsAPI\FieldCollection; |
| 7 | use Give\Form\LegacyConsumer\FieldView; |
| 8 | |
| 9 | /** |
| 10 | * @since 2.10.2 |
| 11 | */ |
| 12 | class SetupPaymentDetailsDisplay { |
| 13 | |
| 14 | /** |
| 15 | * @since 2.10.2 |
| 16 | * |
| 17 | * @param int $donationID |
| 18 | */ |
| 19 | public function __construct( $donationID ) { |
| 20 | $this->donationID = $donationID; |
| 21 | } |
| 22 | |
| 23 | |
| 24 | /** |
| 25 | * @since 2.10.2 |
| 26 | * |
| 27 | * @param string $hook |
| 28 | * |
| 29 | * @return void |
| 30 | */ |
| 31 | public function __invoke( $hook ) { |
| 32 | |
| 33 | $fieldCollection = new FieldCollection( 'root' ); |
| 34 | do_action( "give_fields_{$hook}", $fieldCollection, get_the_ID() ); |
| 35 | |
| 36 | $fieldCollection->walk( [ $this, 'render' ] ); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * @since 2.10.2 |
| 41 | * |
| 42 | * @param FormField $field |
| 43 | * |
| 44 | * @return void |
| 45 | */ |
| 46 | public function render( FormField $field ) { |
| 47 | if ( $field->shouldStoreAsDonorMeta() ) { |
| 48 | return; |
| 49 | } |
| 50 | ?> |
| 51 | <div class="referral-data postbox" style="padding-bottom: 15px;"> |
| 52 | <h3 class="hndle"> |
| 53 | <?php echo $field->getLabel(); ?> |
| 54 | </h3> |
| 55 | <div class="inside"> |
| 56 | <p> |
| 57 | <?php echo give_get_meta( $this->donationID, $field->getName(), true ); ?> |
| 58 | </p> |
| 59 | </div> |
| 60 | </div> |
| 61 | <?php |
| 62 | } |
| 63 | } |
| 64 |