function widget($args, $instance) { extract($args); extract($instance); $options = get_option(DSIDXWIDGETS_OPTION_NAME); $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5); $income = htmlspecialchars($instance["income"]); $downPayment = htmlspecialchars($instance["downPayment"]); $monthlyDebts = htmlspecialchars($instance["monthlyDebts"]); $state = htmlspecialchars($instance["state"]); $city = htmlspecialchars($instance["city"]); $zip = htmlspecialchars($instance["zip"]); $priceMin = htmlspecialchars($instance["priceMin"]); $propType = ''; $imagesStub = dsWidgets_Service_Base::$widgets_images_stub; $apiStub = dsWidgets_Service_Base::$widgets_api_stub; $curURL = get_home_url(); $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME); if (!empty($idxpress_options["AccountID"])) { $aid = $idxpress_options["AccountID"]; } else { $aid = $options["AccountID"]; } if (!empty($idxpress_options["SearchSetupID"])) { $ssid = $idxpress_options["SearchSetupID"]; } else { $ssid = $options["SearchSetupID"]; } echo $before_widget; if (defined('ZPRESS_API') && ZPRESS_API != '') { $widget_header = call_user_func('\\zpress\\themes\\Options::GetOption', 'theme_widgets_require_header'); if (!empty($widget_header->meta) && $widget_header->meta == 'true') { echo $before_title; echo 'Affordability'; echo $after_title; } } echo <<<HTML <div> <script type="text/javascript" id="divLocal{$randString}_"> \t\t\t\twindow.affordabilityHasDependency = true; LaunchBase{$randString} = function(){ var affordabilityScript, _ds_midx; CreateObject{$randString} = function () { _ds_midx = {currentURL: '{$curURL}', curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"], accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,income: '{$income}',downPayment: '{$downPayment}',monthlyDebts: '{$monthlyDebts}',state: '{$state}',city: '{$city}',zip: '{$zip}',priceMin: '{$priceMin}',curDivID: 'divLocal{$randString}_',querySchema: '12dGTTViUjEzC1rrNlw6Lq6A6wZQlgBarlIcucpGTkQrUP3gCimYF6deRFaavu2IbPpaOkZ9I4K42QaAhLVEcA==',productType: '0' }; } AddJavaScriptToDOM{$randString}=function(c,d,e){if(1!=d){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.async=!0;a.src=c;a.onload=function(){ window[e] = 1;};b.parentNode.insertBefore(a,b)}return 1}; CreateWidget{$randString} = function () { (window.affordabilityFinished == 1) ? (window["ds.widget.view.affordability"].isProcessing = true, CreateObject{$randString}(), new window["ds.widget.view.affordability"](_ds_midx), window["ds.widget.view.affordability"].isProcessing = false, window.affordabilityHasDependency = false) : window.setTimeout("CreateWidget{$randString}(false)", 20); } if (affordabilityScript != 1) { affordabilityScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/Affordability_v1_1.js", affordabilityScript, 'affordabilityFinished') }; CreateWidget{$randString}(); } GetToken{$randString}=function(){if(!window.zpress_widget_domain_token&&1!=window.zpress_widget_domain_token_progress){window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1;if(c)rr=document.createElement("script"),rr.async=!0,rr.id="domainScript",rr.type="text/javascript",rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain="+ window.location.hostname+"&objectName_=error",rr.onload=rr.onreadystatechange=function(){"undefined"!=typeof window.error?alert("We had a problem authenticating this domain"):(window.zpress_widget_domain_token=window.encrypted_domain,LaunchBase{$randString}())},document.getElementsByTagName("head")[0].appendChild(rr);else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token= eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()}}else window.zpress_widget_domain_token?LaunchBase{$randString}(): window.setTimeout("GetToken{$randString}()",20)};GetToken{$randString}(); </script> </div> HTML; echo $after_widget; }
function widget($args, $instance) { extract($args); extract($instance); $error_message = dsWidgets_Service_Base::getWidgetErrorMsg($before_widget . $before_title . $title . $after_title, $after_widget); if ($error_message) { echo $error_message; return; } $options = get_option(DSIDXWIDGETS_OPTION_NAME); $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5); $title = htmlspecialchars($instance["title"]); $rowCount = htmlspecialchars($instance["rowCount"]); $community = htmlspecialchars($instance["community"]); $state = htmlspecialchars($instance["state"]); $city = htmlspecialchars($instance["city"]); $zip = htmlspecialchars($instance["zip"]); $linkTitle = htmlspecialchars($instance["linkTitle"]); $statusType = htmlspecialchars($instance["statusType"]); $imagesStub = dsWidgets_Service_Base::$widgets_images_stub; $apiStub = dsWidgets_Service_Base::$widgets_api_stub; $width = htmlspecialchars($instance["width"]); $curURL = get_home_url(); $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME); if (!empty($idxpress_options["AccountID"])) { $aid = $idxpress_options["AccountID"]; } else { $aid = $options["AccountID"]; } if (!empty($idxpress_options["SearchSetupID"])) { $ssid = $idxpress_options["SearchSetupID"]; } else { $ssid = $options["SearchSetupID"]; } echo $before_widget; echo $before_title . $title . $after_title; echo <<<HTML <script type="text/javascript" id="divLocal{$randString}_"> \t\t\t\twindow.recentStatusHasDependency = true; LaunchBase{$randString} = function(){ var recentStatusScript, _ds_midx; CreateObject{$randString} = function () { _ds_midx = { currentURL: '{$curURL}', curWidth: '{$width}', showHeader: false, productType: '0', curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"], accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,curTitle: '{$title}',rowCount: '{$rowCount}',community: '{$community}',state: '{$state}',city: '{$city}',zip: '{$zip}',linkTitle: '{$linkTitle}',curDivID: 'divLocal{$randString}_',querySchema: 'MmZDz28oMETkfu/J7uVDj5me5CwqyWZUYbd0g3HEW8Ar73U98rI41MBxO894vgPN',status: '{$statusType}' }; } AddJavaScriptToDOM{$randString}=function(c,d,e){if(1!=d){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.async=!0;a.src=c;a.onload=function(){ window[e] = 1;};b.parentNode.insertBefore(a,b)}return 1}; CreateWidget{$randString} = function () { (window.recentStatusFinished == 1) ? (window["ds.widget.view.recentstatus"].isProcessing = true, CreateObject{$randString}(), new window["ds.widget.view.recentstatus"](_ds_midx), window["ds.widget.view.recentstatus"].isProcessing = false, window.recentStatusHasDependency = false) : window.setTimeout("CreateWidget{$randString}(false)", 20); } if (recentStatusScript != 1) { recentStatusScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/RecentStatus_v1_1.js", recentStatusScript, 'recentStatusFinished') }; CreateWidget{$randString}(); } GetToken{$randString}=function(){if(!window.zpress_widget_domain_token&&1!=window.zpress_widget_domain_token_progress){window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1;if(c)rr=document.createElement("script"),rr.async=!0,rr.id="domainScript",rr.type="text/javascript",rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain="+ window.location.hostname+"&objectName_=error",rr.onload=rr.onreadystatechange=function(){"undefined"!=typeof window.error?alert("We had a problem authenticating this domain"):(window.zpress_widget_domain_token=window.encrypted_domain,LaunchBase{$randString}())},document.getElementsByTagName("head")[0].appendChild(rr);else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token= eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()}}else window.zpress_widget_domain_token?LaunchBase{$randString}(): window.setTimeout("GetToken{$randString}()",20)};GetToken{$randString}(); </script> HTML; echo $after_widget; }
function widget($args, $instance) { extract($args); extract($instance); $options = get_option(DSIDXWIDGETS_OPTION_NAME); $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5); $widgetType = htmlspecialchars($instance["widgetType"]); $imagesStub = dsWidgets_Service_Base::$widgets_images_stub; $apiStub = dsWidgets_Service_Base::$widgets_api_stub; $curURL = get_home_url(); $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME); if (!empty($idxpress_options["AccountID"])) { $aid = $idxpress_options["AccountID"]; } else { $aid = $options["AccountID"]; } if (!empty($idxpress_options["SearchSetupID"])) { $ssid = $idxpress_options["SearchSetupID"]; } else { $ssid = $options["SearchSetupID"]; } echo $before_widget; if (defined('ZPRESS_API') && ZPRESS_API != '') { $widget_header = call_user_func('\\zpress\\themes\\Options::GetOption', 'theme_widgets_require_header'); if (!empty($widget_header->meta) && $widget_header->meta == 'true') { echo $before_title; echo 'Quick Search'; echo $after_title; } } echo <<<HTML <script type="text/javascript" id="divLocal{$randString}_"> LaunchBase{$randString} = function(){ \t\t\t\twindow.quickSearchHasDependency = true; var quickSearchScript, _ds_midx; CreateObject{$randString} = function () { _ds_midx = { currentURL: '{$curURL}', widgetType: '{$widgetType}', curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"], accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,location: 0,fields: '0123',city: '', community: '', curDivID: 'divLocal{$randString}_',product: '0' }; } AddJavaScriptToDOM{$randString}=function(c,d,e){if(1!=d){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.async=!0;a.src=c;a.onload=function(){ window[e] = 1;};b.parentNode.insertBefore(a,b)}return 1}; CreateWidget{$randString} = function () { (window.quickSearchFinished == 1) ? (window["ds.widget.view.quicksearch"].isProcessing = true, CreateObject{$randString}(), new window["ds.widget.view.quicksearch"](_ds_midx), window["ds.widget.view.quicksearch"].isProcessing = false, window.quickSearchHasDependency = false) : window.setTimeout("CreateWidget{$randString}(false)", 20); } if (quickSearchScript != 1) { quickSearchScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/QuickSearch_v1_1.js", quickSearchScript, 'quickSearchFinished') }; CreateWidget{$randString}(); } GetToken{$randString}=function(){if(!window.zpress_widget_domain_token&&1!=window.zpress_widget_domain_token_progress){window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1;if(c)rr=document.createElement("script"),rr.async=!0,rr.id="domainScript",rr.type="text/javascript",rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain="+ window.location.hostname+"&objectName_=error",rr.onload=rr.onreadystatechange=function(){"undefined"!=typeof window.error?alert("We had a problem authenticating this domain"):(window.zpress_widget_domain_token=window.encrypted_domain,LaunchBase{$randString}())},document.getElementsByTagName("head")[0].appendChild(rr);else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token= eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()}}else window.zpress_widget_domain_token?LaunchBase{$randString}(): window.setTimeout("GetToken{$randString}()",20)};GetToken{$randString}(); </script> HTML; echo $after_widget; dsidx_footer::ensure_disclaimer_exists("search"); }
function form($instance) { wp_enqueue_script('dsidxwidgets_widget_service_admin', DSIDXWIDGETS_PLUGIN_URL . 'js/widget-service-admin.js', array('jquery'), false, true); $personal_info = stripslashes_deep(get_option('personal_info')); $city = empty($personal_info['city']) ? 'Irvine' : $personal_info['city']; $state = empty($personal_info['state']) ? 'CA' : $personal_info['state']; $instance = wp_parse_args($instance, array("title" => "Area Statistics", "tract" => "", "community" => "", "state" => $state, "city" => $city, "zip" => "", "propType" => "", "periodType" => "1", "statusType" => "1", "eDomain" => "")); $title = htmlspecialchars($instance["title"]); $titleFieldId = $this->get_field_id("title"); $titleFieldName = $this->get_field_name("title"); $tract = htmlspecialchars($instance["tract"]); $tractFieldId = $this->get_field_id("tract"); $tractFieldName = $this->get_field_name("tract"); $community = htmlspecialchars($instance["community"]); $communityFieldId = $this->get_field_id("community"); $communityFieldName = $this->get_field_name("community"); $state = htmlspecialchars($instance["state"]); $stateFieldId = $this->get_field_id("state"); $stateFieldName = $this->get_field_name("state"); $city = htmlspecialchars($instance["city"]); $cityFieldId = $this->get_field_id("city"); $cityFieldName = $this->get_field_name("city"); $zip = htmlspecialchars($instance["zip"]); $zipFieldId = $this->get_field_id("zip"); $zipFieldName = $this->get_field_name("zip"); $propType = htmlspecialchars($instance["propType"]); $propTypeFieldId = $this->get_field_id("propType"); $propTypeFieldName = $this->get_field_name("propType"); $period = $instance["periodType"]; $periodFieldId = $this->get_field_id("periodType"); $periodFieldName = $this->get_field_name("periodType"); $status = $instance["statusType"]; $statusFieldId = $this->get_field_id("statusType"); $statusFieldName = $this->get_field_name("statusType"); $eDomain = htmlspecialchars($instance["eDomain"]); $eDomainFieldId = $this->get_field_id("eDomain"); $eDomainFieldName = $this->get_field_name("eDomain"); $baseFieldId = $this->get_field_id("areastatsOptions"); $baseFieldName = $this->get_field_name("areastatsOptions"); $apiStub = dsWidgets_Service_Base::$widgets_admin_api_stub; $property_types = dsWidgetAgent_ApiRequest::FetchData('AccountPropertyTypes', array(), false, 60 * 60 * 24); $checked_html = $propType == '' ? 'selected' : ''; $property_types_html = '<option value="-1" {$checked_html} >Select Property Type</option>'; $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5); $options = get_option(DSIDXWIDGETS_OPTION_NAME); $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME); if (!empty($idxpress_options["AccountID"])) { $aid = $idxpress_options["AccountID"]; } else { $aid = $options["AccountID"]; } if (!empty($idxpress_options["SearchSetupID"])) { $ssid = $idxpress_options["SearchSetupID"]; } else { $ssid = $options["SearchSetupID"]; } if (!empty($property_types)) { $property_types = json_decode($property_types["body"]); foreach ($property_types as $property_type) { $checked_html = ''; $name = htmlentities($property_type->DisplayName); $id = $property_type->PropertyTypeID; if ($id == $propType) { $checked_html = 'selected'; } $property_types_html .= <<<HTML <option value="{$id}" {$checked_html} >{$name}</option> HTML; } } echo <<<HTML \t\t\t<input type='hidden' id='ds_widgets_area_stats_domain' value='{$eDomain}' name="ds_widgets_area_stats_domain" /> \t<p> \t\t\t\t<label for="{$titleFieldId}">Title</label> \t\t\t\t<input id="{$titleFieldId}" name="{$titleFieldName}" value="{$title}" class="widefat" type="text" /> \t\t\t</p> <p> \t\t\t\t<label for="{$tractFieldId}">Tract</label> \t\t\t\t<input id="{$tractFieldId}" name="{$tractFieldName}" value="{$tract}" class="widefat" type="text" /> \t\t\t</p> <p> \t\t\t\t<label for="{$communityFieldId}">Community</label> \t\t\t\t<input id="{$communityFieldId}" name="{$communityFieldName}" value="{$community}" class="widefat" type="text" /> \t\t\t</p> <p> \t\t\t\t<label for="{$cityFieldId}">City</label> \t\t\t\t<input id="{$cityFieldId}" name="{$cityFieldName}" value="{$city}" class="widefat" type="text" /> \t\t\t</p> <p> \t\t\t\t<label for="{$stateFieldId}">State</label> \t\t\t\t<input id="{$stateFieldId}" name="{$stateFieldName}" value="{$state}" class="widefat" type="text" /> \t\t\t</p> <p> \t\t\t\t<label for="{$zipFieldId}">Zip Code</label> \t\t\t\t<input id="{$zipFieldId}" name="{$zipFieldName}" value="{$zip}" class="widefat" type="text" /> \t\t\t</p> <p> \t\t\t\t<label for="{$propTypeFieldId}">Property Type</label> \t\t\t\t<select id="{$propTypeFieldId}" name="{$propTypeFieldName}" class="widefat" type="text" onchange="jQuery(zWidgets_Area_Listener(this))"> {$property_types_html} </select> \t\t\t</p> <p> <label for="{$periodFieldId}">Period</label> \t\t\t\t<select class="widefat" id="{$periodFieldId}" name="{$periodFieldName}" onchange="jQuery(zWidgets_Area_Listener(this))"> \t\t\t\t\t<option HTML; if ($period == '1') { echo 'selected'; } echo <<<HTML value="1">Weekly</option> <option HTML; if ($period == '2') { echo 'selected'; } echo <<<HTML value="2" >Monthly</option> \t\t\t\t</select> \t\t\t</p> <p> <label for="{$statusFieldId}">Status</label> \t\t\t\t<select class="widefat" id="{$statusFieldId}" name="{$statusFieldName}" onchange="jQuery(zWidgets_Area_Listener(this))"> \t\t\t\t\t<option HTML; if ($status == '1') { echo 'selected'; } echo <<<HTML value="1">Active</option> <option HTML; if ($status == '2') { echo 'selected'; } echo <<<HTML value="2" >Pending</option> <option HTML; if ($status == '3') { echo 'selected'; } echo <<<HTML value="3" >Expired</option> <option HTML; if ($status == '4') { echo 'selected'; } echo <<<HTML value="4" >Sold</option> \t\t\t\t</select> \t\t\t</p> <script> jQuery(function(){ var a = document.getElementById('ds_widgets_area_stats_domain'); if(a.value == ''){ zWidgetsAdmin.fetchEncryptedValue(window.location.hostname, 'domain', a, '{$apiStub}'); } }) zWidgets_Area_Listener = function (event){ zWidgetsAdmin.checkForAreaData_(event, '{$randString}', document.getElementById('ds_widgets_area_stats_domain').value, '{$apiStub}', {$aid}, {$ssid} ) }; </script> HTML; }
function widget($args, $instance) { if (!$this->instance) { $this->instance = true; } else { return; } extract($args); extract($instance); $error_message = dsWidgets_Service_Base::getWidgetErrorMsg($before_widget, $after_widget); if ($error_message) { echo $error_message; return; } $capabilities = dsWidgets_Service_Base::getCapabilities(); $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5); wp_enqueue_script('googlemaps3', 'http://maps.googleapis.com/maps/api/js?sensor=false', array('jquery'), false, true); $options = get_option(DSIDXWIDGETS_OPTION_NAME); $state = htmlspecialchars($instance["state"]); $city = str_replace(" \r\n ", ",", htmlspecialchars($instance["city"])); $city = str_replace(" \r\n", ",", $city); $city = str_replace("\r\n ", ",", $city); $city = str_replace("\r\n", ",", $city); if (empty($capabilities->MinPrice)) { $instance['priceMin'] = ''; } if (empty($capabilities->MaxPrice)) { $instance['priceMax'] = ''; } if (empty($capabilities->MinImprovedSqFt)) { $instance['sqftMin'] = ''; } $instance = wp_parse_args($instance, array("state" => $state, "city" => $city, "zip" => "", "priceMin" => "250000", "priceMax" => "550000", "priceFloor" => "100000", "priceCeiling" => "1000000", "bedsMin" => "2", "bathsMin" => "2", "sqftMin" => "1500", "statusType" => "1", "rowCountType" => "25", "sortType" => "0", "eDomain" => "", "height" => "494", "width" => "548")); $zip = htmlspecialchars($instance["zip"]); $priceMin = htmlspecialchars($instance["priceMin"]); $priceMax = htmlspecialchars($instance["priceMax"]); $priceFloor = htmlspecialchars($instance["priceFloor"]); $priceCeiling = htmlspecialchars($instance["priceCeiling"]); $bedsMin = htmlspecialchars($instance["bedsMin"]); $bathsMin = htmlspecialchars($instance["bathsMin"]); $sqftMin = htmlspecialchars($instance["sqftMin"]); $statusType = htmlspecialchars($instance["statusType"]); $rowCountType = htmlspecialchars($instance["rowCountType"]); $sortType = htmlspecialchars($instance["sortType"]); $imagesStub = dsWidgets_Service_Base::$widgets_images_stub; $apiStub = dsWidgets_Service_Base::$widgets_api_stub; $height = htmlspecialchars($instance["height"]); $width = htmlspecialchars($instance["width"]); $curURL = get_home_url(); $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME); if (!empty($idxpress_options["AccountID"])) { $aid = $idxpress_options["AccountID"]; } else { $aid = $options["AccountID"]; } if (!empty($idxpress_options["SearchSetupID"])) { $ssid = $idxpress_options["SearchSetupID"]; } else { $ssid = $options["SearchSetupID"]; } echo $before_widget; if (defined('ZPRESS_API') && ZPRESS_API != '') { $widget_header = call_user_func('\\zpress\\themes\\Options::GetOption', 'theme_widgets_require_header'); if (!empty($widget_header->meta) && $widget_header->meta == 'true') { echo $before_title; echo 'Map Search'; echo $after_title; } } echo <<<HTML <script type="text/javascript" id="divLocal{$randString}_"> \t\t\twindow.mapSearchHasDependency = true; var launchBaseCalled = false; var mapSearchDep1Finished = 1; LaunchBase{$randString} = function(){ var mapSearchScript,mapSearchDep1RevScript, _ds_midx, mapSearchProgress; CreateObject{$randString} = function () { _ds_midx = { currentURL: '{$curURL}', curHeight: '{$height}', curWidth: '{$width}', productType: '0', curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"],accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,state: '{$state}',city: '{$city}',zip: '{$zip}',priceMin: '{$priceMin}',priceMax: '{$priceMax}',priceFloor: '{$priceFloor}',priceCeiling: '{$priceCeiling}',bedsMin: '{$bedsMin}',bathsMin: '{$bathsMin}',sqftMin: '{$sqftMin}',curDivID: 'divLocal{$randString}_',querySchema: 'HNIPilgrh/9PwdKmimpgPE05NfSeqIkyvHeXiSh+gUIUzKp3KXDCFoWJ/DzaOsYlntCSXtSk36hbB76URZk1Sirc9iLz3tiLPAN0SK/EbNCrr6XWxD7hAYVJcDwXtpN4',status: '{$statusType}',rowCount: '{$rowCountType}',sort: '{$sortType}' }; } AddJavaScriptToDOM{$randString}=function(c,d,e){ if(d!=1){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.id=e;a.type='text/javascript';a.async=true;a.src=c;a.onload=a.onreadystatechange=function(){ if(a.readyState){ if (a.readyState == "loaded" || a.readyState == "complete") {window[e] = 1;}}else{window[e] = 1;}};b.parentNode.insertBefore(a,b)}return 1}; CreateWidget{$randString} = function () { (window.mapSearchFinished == 1 && mapSearchDep1Finished == 1) ? (window["ds.widget.view.mapsearch"].isProcessing = true, CreateObject{$randString}(), new window["ds.widget.view.mapsearch"](_ds_midx), window["ds.widget.view.mapsearch"].isProcessing = false, window.mapSearchHasDependency = false, DetectMapScripts{$randString}()) : window.setTimeout("CreateWidget{$randString}(false)", 20); } if (mapSearchScript != 1 && mapSearchProgress != 1) {mapSearchProgress=1, mapSearchScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/MapSearch_v1_1.js", mapSearchScript, 'mapSearchFinished') }; CreateWidget{$randString}(); } \t\t\tDetectMapScripts{$randString} = function(){ \t\t\t\tif (typeof google === 'object' && typeof google.maps === 'object') { \t\t\t\t\tMapSearchMapCallback(); \t\t\t\t} \t\t\t\telse{ \t\t\t\t\twindow.setTimeout("DetectMapScripts{$randString}()", 20) \t\t\t\t} \t\t\t} GetToken{$randString}=function(){ if(!window.zpress_widget_domain_token && window.zpress_widget_domain_token_progress!=1){ window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1; if(c){ rr=document.createElement("script"); rr.async=1; rr.id="domainScript"; rr.type="text/javascript"; rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain=" + window.location.hostname+"&objectName_=error"; rr.onload=rr.onreadystatechange=function(){ if("undefined"!=typeof window.error){ alert("We had a problem authenticating this domain"); } else{ window.zpress_widget_domain_token=window.encrypted_domain; if(rr.readyState && (rr.readyState == "loaded" || rr.readyState == "complete")){ if(launchBaseCalled != true){ LaunchBase{$randString}(); } launchBaseCalled = true; } else{ window.setTimeout("GetToken{$randString}()",20); } } }; document.getElementsByTagName("head")[0].appendChild(rr); } else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token= eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()} } else{ if(window.zpress_widget_domain_token && launchBaseCalled != true) { LaunchBase{$randString}(); launchBaseCalled = true; } else{ if(launchBaseCalled != true){ window.setTimeout("GetToken{$randString}()",20); } } } } GetToken{$randString}(); </script> HTML; echo $after_widget; dsidx_footer::ensure_disclaimer_exists("search"); }