PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Controllers
<?php namespace WilokeListingTools\Controllers; use WilokeListingTools\Framework\Helpers\General; use WilokeListingTools\Framework\Helpers\GetSettings; use WilokeListingTools\Framework\Routing\Controller; use WilokeListingTools\Models\BookingCom; class BookingComController extends Controller { protected $bookingComID = null; public function __construct() { add_action('wilcity/deleted/listing', [$this, 'deleteRelatedBookingComCreator']); add_action('after_delete_post', [$this, 'updateBookingComCreatorDependsOnListingStatus'], 10, 1); add_action('wp_enqueue_scripts', [$this, 'printBannerSettings']); } protected function isIncludeBookingDotCom($postID) { $this->bookingComID = BookingCom::getCreatorIDByParentID($postID); if (empty($this->bookingComID)) { return false; } if (!GetSettings::isPlanAvailableInListing($postID, 'bookingcombannercreator')) { return false; } return true; } public function printBannerSettings() { if (!is_singular()) { return false; } global $post; if (!$this->isIncludeBookingDotCom($post->ID)) { return false; } $bcCopyColor = get_post_meta($this->bookingComID, '_bdotcom_bc_mbe_copy_colour', true); $bcCopyColor = empty($bcCopyColor) ? $bcCopyColor : BDOTCOM_BC_DEFAULT_COPY_COLOUR; $mceButton = get_post_meta($this->bookingComID, '_bdotcom_bc_mbe_button', true); $mceButton = (!empty($mceButton) && ($mceButton == 'yes' || $mceButton == 1 || $mceButton == 'on')) ? true : false; $mceBorderColor = get_post_meta($this->bookingComID, '_bdotcom_bc_mbe_button_border_colour', true); $mceBorderColor = empty($mceBorderColor) ? BDOTCOM_BC_DEFAULT_BUTTON_BORDER_COLOUR : $mceBorderColor; $mceButtonCopyColor = get_post_meta($this->bookingComID, '_bdotcom_bc_mbe_copy_colour', true); $mceButtonCopyColor = empty($mceButtonCopyColor) ? BDOTCOM_BC_DEFAULT_COPY_COLOUR : $mceButtonCopyColor; $mceButtonBg = get_post_meta($this->bookingComID, '_bdotcom_bc_mbe_button_bg', true); $mceButtonBg = empty($mceButtonBg) ? BDOTCOM_BC_DEFAULT_BUTTON_BG : $mceButtonBg; $bdotcom_bc_mbe_edit_css = get_post_meta($this->bookingComID, '_bdotcom_bc_mbe_edit_css', true); $bookingPath = get_post_meta($this->bookingComID, '_bdotcom_bc_mbe_img_path', true); $mceThemes = get_post_meta($this->bookingComID, '_bdotcom_bc_mbe_themes', true); $bannerImg = ''; if (!empty($mceThemes) && $mceThemes == 'custom_theme') { $bannerImg = $bookingPath; } elseif ($mceThemes != BDOTCOM_BC_DEFAULT_THEME && $mceThemes != 'custom_theme') { $aDefaultImgs = bdotcom_bc_default_image_paths(); foreach ($aDefaultImgs as $aDefImg) { if ($mceThemes == $aDefImg[0]) { $bannerImg = $aDefImg[2]; } } } else {// default image when no other image is chosen $bannerImg = BDOTCOM_BC_DEFAULT_THEME; } $style = ''; $style .= '#bdotcom_bc_mbe_banner_'.$this->bookingComID.' { background-image: url("'.$bannerImg.'");}'; $style .= '#bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy, #bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy h1, #bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy h2, #bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy h3, #bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy h4, #bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy h5, #bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy h6, #bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy p, #bdotcom_bc_mbe_banner_'.$this->bookingComID. ' .bdotcom_bc_copy_wrapper .bdotcom_bc_copy div { color: '.$bcCopyColor.';}'; if ($mceButton) { $style .= '#bdotcom_bc_mbe_banner_'.$this->bookingComID.' .bdotcom_bc_mbe_button {'; if (!empty($mceButton_border_width) && is_numeric($mceButton_border_width)) { $style .= 'border:'.$mceButton_border_width.'px '.$mceBorderColor.' solid;'; } $style .= 'color:'.$mceButtonCopyColor.' ;'; $style .= 'background:'.$mceButtonBg.' ; }'; } $style .= $bdotcom_bc_mbe_edit_css;// custom css to refine the banner if needed wp_add_inline_style('bdotcom_bc_general_css', $style); } public function updateBookingComCreatorDependsOnListingStatus($postID) { $aPostTypes = General::getPostTypeKeys(false, false); $postStatus = get_post_status($postID); if (!in_array($postStatus, $aPostTypes)) { return false; } $bookingID = BookingCom::getCreatorIDByParentID($postID); if (empty($bookingID)) { return false; } wp_delete_post($bookingID, true); } public function deleteRelatedBookingComCreator($listingID) { $bookingID = BookingCom::getCreatorIDByParentID($listingID); if (!empty($bookingID)) { wp_delete_post($bookingID, true); } } }
[+]
..
[-] WebhookController.php
[edit]
[-] SetCoupon.php
[edit]
[-] TermController.php
[edit]
[-] PostController.php
[edit]
[-] SetMyPosts.php
[edit]
[-] NotificationsController.php
[edit]
[-] AjaxUploadImgController.php
[edit]
[-] TaxonomiesControllers.php
[edit]
[-] FavoriteStatisticController.php
[edit]
[-] BelongsToCustomTaxonomies.php
[edit]
[-] DashboardController.php
[edit]
[-] ModifyQueryController.php
[edit]
[-] SetCustomGroup.php
[edit]
[+]
Map
[-] TraitHostedBy.php
[edit]
[-] SearchFormController.php
[edit]
[-] InsertFeaturedImg.php
[edit]
[-] PaymentGatewaysController.php
[edit]
[-] PaymentController.php
[edit]
[-] DokanController.php
[edit]
[-] SchemaController.php
[edit]
[-] UserController.php
[edit]
[-] BelongsToLocation.php
[edit]
[-] WooCommerceBookingController.php
[edit]
[-] IsMyPaymentID.php
[edit]
[-] StripeController.php
[edit]
[-] ContactFormController.php
[edit]
[-] AddListingButtonController.php
[edit]
[-] Validation.php
[edit]
[-] GalleryController.php
[edit]
[-] SetListingRelationship.php
[edit]
[-] AddListingController.php
[edit]
[-] MergingSettingValues.php
[edit]
[-] GoogleReCaptchaController.php
[edit]
[-] CouponController.php
[edit]
[-] InvoiceController.php
[edit]
[-] SingleJsonSkeleton.php
[edit]
[-] SingleController.php
[edit]
[-] InsertImg.php
[edit]
[-] EmailController.php
[edit]
[-] BelongsToCategories.php
[edit]
[-] ReviewController.php
[edit]
[-] SetSinglePrice.php
[edit]
[-] PrintSidebarItems.php
[edit]
[-] SetPlanRelationship.php
[edit]
[-] BookingComController.php
[edit]
[-] WooCommerceController.php
[edit]
[-] FacebookLoginController.php
[edit]
[-] EventController.php
[edit]
[-] SetRestaurantMenu.php
[edit]
[-] SetProductsToListing.php
[edit]
[-] UserPlanController.php
[edit]
[-] FollowController.php
[edit]
[+]
Retrieve
[-] SetGeneral.php
[edit]
[-] VerifyPurchaseCode.php
[edit]
[-] PlanRelationshipController.php
[edit]
[-] FreePlanController.php
[edit]
[-] AddBookingComBannerCreator.php
[edit]
[-] ReportController.php
[edit]
[-] RetrieveController.php
[edit]
[-] SetCustomButton.php
[edit]
[-] GetWilokeToolSettings.php
[edit]
[-] PaymentMetaController.php
[edit]
[-] RegisterLoginController.php
[edit]
[-] TermsAndPolicyController.php
[edit]
[-] AppleLoginController.php
[edit]
[-] ChangePlanStatusController.php
[edit]
[-] NextBillingPaymentController.php
[edit]
[-] AddListingPaymentController.php
[edit]
[-] PromotionController.php
[edit]
[-] PrintAddListingSettings.php
[edit]
[-] PayPalExecuteAddListingPayment.php
[edit]
[-] ClaimController.php
[edit]
[-] ViewStatisticController.php
[edit]
[-] SessionController.php
[edit]
[-] SharesStatisticController.php
[edit]
[-] TraitSetEventData.php
[edit]
[-] PrintAddListingFields.php
[edit]
[-] GuardController.php
[edit]
[+]
TransformAddListingData
[-] MessageController.php
[edit]
[-] OptimizeScripts.php
[edit]
[-] InsertLogo.php
[edit]
[-] SetPostDuration.php
[edit]
[-] GridItemController.php
[edit]
[-] SetVideo.php
[edit]
[-] AddMorePhotosVideosController.php
[edit]
[-] TraitAddListingSettings.php
[edit]
[-] InsertGallery.php
[edit]
[-] BillingControllers.php
[edit]
[-] GetSingleImage.php
[edit]
[-] BelongsToTags.php
[edit]
[-] PermalinksController.php
[edit]
[-] RunUpdateDBToLatestVersionController.php
[edit]
[-] SetListingBelongsToPlanID.php
[edit]
[-] NoticeController.php
[edit]
[-] DirectBankTransferController.php
[edit]
[-] SetPriceRange.php
[edit]
[-] TagsBelongsToCatController.php
[edit]
[-] PayPalController.php
[edit]
[-] InsertAddress.php
[edit]
[-] MapListingController.php
[edit]
[-] ListingController.php
[edit]
[-] AuthorPageController.php
[edit]
[-] RestaurantMenuController.php
[edit]
[-] PaymentStatusController.php
[edit]
[-] SetSocialNetworks.php
[edit]
[-] SetCustomSections.php
[edit]
[-] TranslationController.php
[edit]
[-] IconController.php
[edit]
[-] SetGroupData.php
[edit]
[-] SetContactInfo.php
[edit]
[-] ProfileController.php
[edit]
[-] ShareController.php
[edit]
[-] InsertCoverImage.php
[edit]
[-] HandleSubmit.php
[edit]
[-] SetMyRoom.php
[edit]
[-] ModalController.php
[edit]