-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiHomefinderLayoutManager.php
More file actions
168 lines (146 loc) · 3.39 KB
/
iHomefinderLayoutManager.php
File metadata and controls
168 lines (146 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
if( !class_exists('IHomefinderLayoutManager')) {
/**
* This class is handle rules related to
* different virtual page layouts
*
* @author ihomefinder
*/
class IHomefinderLayoutManager {
private static $instance ;
private function __construct(){
}
public function isResponsive(){
$result=false;
if( $this->getLayoutType() == IHomefinderConstants::OPTION_LAYOUT_TYPE_RESPONSIVE){
$result=true;
}
return $result;
}
public function getLayoutType(){
$result = get_option(IHomefinderConstants::OPTION_LAYOUT_TYPE);
return $result;
}
public static function getInstance(){
if( !isset(self::$instance)){
self::$instance = new IHomefinderLayoutManager();
}
return self::$instance;
}
public function getExternalUrl(){
$result = '';
if( $this->isResponsive()){
$result = IHomefinderConstants::RESPONSIVE_EXTERNAL_URL ;
}
else{
$result = IHomefinderConstants::LEGACY_EXTERNAL_URL ;
}
return $result;
}
public function supportsMultipleQuickSearchLayouts(){
$result=false;
if( $this->isResponsive()){
$result=true;
}
return $result;
}
public function supportsMapSearchCenterLatLong(){
$result=false;
if( $this->isResponsive()){
$result=false;
} else {
$result=true;
}
return $result;
}
public function supportsMapSearchCenterAddress(){
$result=false;
if( $this->isResponsive()){
$result=true;
}
return $result;
}
public function supportsMapSearchResponsiveness(){
$result=false;
if( $this->isResponsive()){
$result=true;
}
return $result;
}
public function supportsColorScheme(){
$result=false;
if( $this->isResponsive()){
$result=true;
}
return $result;
}
public function supportsListingGallery(){
$result=true;
return $result;
}
public function supportsListingGalleryResponsiveness(){
$result=false;
if( $this->isResponsive()){
$result=true;
}
return $result;
}
/**
*
* Legacy widgets were surrounded by <br> tags.
* We want to remove these for the new responsive
* version for layout reasons.
* @return boolean
*/
public function hasExtraLineBreaksInWidget(){
$result=true;
if( $this->isResponsive()){
$result=false;
}
return $result;
}
public function hasItemInSearchFormData(){
$result=false;
if( $this->isResponsive()){
$result=true;
}
return $result;
}
/**
* New responsive map search can take all of the space (width=100%
* or if user passes width (for short code) can use that width)
* For traditional map search width=595 is passed to map search virtual page
*/
public function supportsMapSearchWithMultipleWidths(){
$result=false;
if( $this->isResponsive()){
$result=true;
}
return $result;
}
/**
* The QuickSearch short code is handled differently for responsive
*
* The legacy version uses the QuickSearchVirtualPage
*/
public function supportsQuickSearchVirtualPage(){
$result=true;
if( $this->isResponsive()){
$result=false;
}
return $result;
}
/**
* Logout is handled differently for responsive layout
* We need to kill the session on java servers for subscriber logout
*/
public function isSubscriberSessionOnJavaServers(){
$result=false;
if($this->isResponsive()){
$result=true;
}
return $result;
}
}
}
?>