PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
wiloke-listing-tools
/
app
/
Controllers
<?php namespace WilokeListingTools\Controllers; use WilokeListingTools\Framework\Helpers\GetSettings; use WilokeListingTools\Framework\Helpers\GetWilokeSubmission; use WilokeListingTools\Models\FavoriteStatistic; use WilokeListingTools\Models\ListingModel; use WilokeListingTools\Models\PaymentModel; use WilokeListingTools\Models\PlanRelationshipModel; use WilokeListingTools\Models\SharesStatistic; use WilokeListingTools\Models\ViewStatistic; trait SingleJsonSkeleton { public function getPromotions() { if (empty($aRawResults)) { return false; } $aPromotions = []; foreach ($aRawResults as $aData) { if (!empty($aData['meta_value'])) { $aPromotions[] = $aData['meta_value']; } } if (empty($aPromotions)) { return false; } return $aPromotions; } public function getGeneralFeaturedImg($imgSize = 'thumbnail') { $aThemeOptions = \Wiloke::getThemeOptions(); if (isset($aThemeOptions['listing_featured_image']) && isset($aThemeOptions['listing_featured_image']['id'])) { $featuredImg = wp_get_attachment_image_url($aThemeOptions['listing_featured_image']['id'], $imgSize); return $featuredImg; } return ''; } public function json($post) { $aListing['postID'] = absint($post->ID); $aListing['title'] = get_the_title($post->ID); $aListing['postStatus'] = $post->post_status; $aListing['link'] = get_permalink($post->ID); $aListing['featuredImage'] = get_the_post_thumbnail_url($post->ID, 'thumbnail'); if (empty($aListing['featuredImage'])) { $aListing['featuredImage'] = $this->getGeneralFeaturedImg(); } $aListing['tagLine'] = GetSettings::getPostMeta($post->ID, 'tagLine'); $togglePromotion = GetSettings::getOptions('toggle_promotion'); $aPromotion = $this->getPromotions(); $aListing['views'] = ViewStatistic::countViews($post->ID); $aListing['shares'] = SharesStatistic::countShared($post->ID); $aListing['favorites'] = FavoriteStatistic::countFavorites($post->ID); $aListing['isNonRecurringPayment'] = GetWilokeSubmission::isNonRecurringPayment() ? 'yes' : 'no'; $aListing['isEnabledPromotion'] = $togglePromotion == 'enable' ? 'yes' : 'no'; $aListing['hasPromotion'] = empty($aPromotion) ? 'no' : 'yes'; $aListing['aPromotions'] = ListingModel::listingBelongsToPromotion($post->ID); $expiryDate = GetSettings::getPostMeta($post->ID, 'post_expiry'); $aListing['listingExpiry'] = empty($expiryDate) ? $expiryDate : date_i18n(get_option('date_format').' '.get_option('time_format'), $expiryDate); $belongsToPlanID = GetSettings::getPostMeta($post->ID, 'belongs_to'); if (!empty($belongsToPlanID)) { $aListing['belongsToPlan'] = get_the_title($belongsToPlanID); $aListing['planID'] = $belongsToPlanID; } else { $aListing['belongsToPlan'] = ''; } if (!empty($aListing['belongsToPlan'])) { $paymentID = PlanRelationshipModel::getPaymentIDByPlanIDAndObjectID($belongsToPlanID, $post->ID); if (!empty($paymentID)) { $aListing['paymentID'] = $paymentID; $aListing['gateway'] = PaymentModel::getField('gateway', $paymentID); } } $aListing['postType'] = $post->post_type; return $aListing; } }
[+]
..
[-] PermalinksController.php
[edit]
[-] MessageController.php
[edit]
[-] SetListingBelongsToPlanID.php
[edit]
[-] BelongsToTags.php
[edit]
[-] PrintAddListingSettings.php
[edit]
[-] InsertGallery.php
[edit]
[-] ViewStatisticController.php
[edit]
[-] TermsAndPolicyController.php
[edit]
[-] AddListingButtonController.php
[edit]
[-] SetSinglePrice.php
[edit]
[-] SetCustomButton.php
[edit]
[-] WooCommerceBookingController.php
[edit]
[-] SetMyPosts.php
[edit]
[-] SetVideo.php
[edit]
[-] Validation.php
[edit]
[-] PrintAddListingFields.php
[edit]
[-] NoticeController.php
[edit]
[-] SharesStatisticController.php
[edit]
[-] TraitAddListingSettings.php
[edit]
[-] SetListingRelationship.php
[edit]
[-] EmailController.php
[edit]
[-] SetMyRoom.php
[edit]
[-] SessionController.php
[edit]
[-] DashboardController.php
[edit]
[-] EventController.php
[edit]
[-] AppleLoginController.php
[edit]
[-] TraitSetEventData.php
[edit]
[-] PayPalController.php
[edit]
[-] TranslationController.php
[edit]
[-] PostController.php
[edit]
[-] DokanController.php
[edit]
[-] TermController.php
[edit]
[-] FavoriteStatisticController.php
[edit]
[-] SetSocialNetworks.php
[edit]
[-] SetCustomGroup.php
[edit]
[-] SetCustomSections.php
[edit]
[-] AuthorPageController.php
[edit]
[-] AddBookingComBannerCreator.php
[edit]
[-] PlanRelationshipController.php
[edit]
[-] ProfileController.php
[edit]
[-] MapListingController.php
[edit]
[-] UserController.php
[edit]
[-] BillingControllers.php
[edit]
[-] InsertAddress.php
[edit]
[-] PaymentStatusController.php
[edit]
[-] BelongsToCategories.php
[edit]
[-] InsertCoverImage.php
[edit]
[-] SetPriceRange.php
[edit]
[-] SetPlanRelationship.php
[edit]
[-] ListingController.php
[edit]
[-] SetGeneral.php
[edit]
[-] GridItemController.php
[edit]
[-] PaymentController.php
[edit]
[+]
TransformAddListingData
[-] ContactFormController.php
[edit]
[-] InsertFeaturedImg.php
[edit]
[-] AddListingController.php
[edit]
[-] BelongsToLocation.php
[edit]
[-] RestaurantMenuController.php
[edit]
[-] AjaxUploadImgController.php
[edit]
[-] NotificationsController.php
[edit]
[-] SingleJsonSkeleton.php
[edit]
[-] GalleryController.php
[edit]
[-] IsMyPaymentID.php
[edit]
[-] InsertImg.php
[edit]
[-] ModalController.php
[edit]
[-] PaymentGatewaysController.php
[edit]
[-] ShareController.php
[edit]
[-] RetrieveController.php
[edit]
[-] ModifyQueryController.php
[edit]
[-] TraitHostedBy.php
[edit]
[-] ChangePlanStatusController.php
[edit]
[-] TaxonomiesControllers.php
[edit]
[-] WebhookController.php
[edit]
[-] SearchFormController.php
[edit]
[-] FreePlanController.php
[edit]
[-] BelongsToCustomTaxonomies.php
[edit]
[-] PromotionController.php
[edit]
[-] RunUpdateDBToLatestVersionController.php
[edit]
[-] UserPlanController.php
[edit]
[-] SetContactInfo.php
[edit]
[-] InsertLogo.php
[edit]
[+]
Retrieve
[+]
Map
[-] VerifyPurchaseCode.php
[edit]
[-] StripeController.php
[edit]
[-] NextBillingPaymentController.php
[edit]
[-] SchemaController.php
[edit]
[-] IconController.php
[edit]
[-] AddMorePhotosVideosController.php
[edit]
[-] SetPostDuration.php
[edit]
[-] GuardController.php
[edit]
[-] ReviewController.php
[edit]
[-] OptimizeScripts.php
[edit]
[-] PaymentMetaController.php
[edit]
[-] GetWilokeToolSettings.php
[edit]
[-] SetCoupon.php
[edit]
[-] CouponController.php
[edit]
[-] AddListingPaymentController.php
[edit]
[-] FacebookLoginController.php
[edit]
[-] SingleController.php
[edit]
[-] BookingComController.php
[edit]
[-] SetGroupData.php
[edit]
[-] InvoiceController.php
[edit]
[-] SetProductsToListing.php
[edit]
[-] ReportController.php
[edit]
[-] PayPalExecuteAddListingPayment.php
[edit]
[-] HandleSubmit.php
[edit]
[-] WooCommerceController.php
[edit]
[-] FollowController.php
[edit]
[-] PrintSidebarItems.php
[edit]
[-] .Controllers.php
[edit]
[-] DirectBankTransferController.php
[edit]
[-] ClaimController.php
[edit]
[-] GetSingleImage.php
[edit]
[-] SetRestaurantMenu.php
[edit]
[-] MergingSettingValues.php
[edit]
[-] GoogleReCaptchaController.php
[edit]
[-] RegisterLoginController.php
[edit]
[-] TagsBelongsToCatController.php
[edit]