Changeset 2747456
- Timestamp:
- 06/24/2022 08:54:51 AM (4 years ago)
- Location:
- immotoolbox-connect/trunk
- Files:
-
- 6 edited
-
admin/js/block.js (modified) (4 diffs)
-
immotoolbox-connect.php (modified) (2 diffs)
-
public/ITBConnectPublic.php (modified) (2 diffs)
-
public/partials/base/search.html.twig (modified) (1 diff)
-
readme.md (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
immotoolbox-connect/trunk/admin/js/block.js
r2746279 r2747456 725 725 type: 'boolean' 726 726 }, 727 hide_district: { 728 type: 'boolean' 729 }, 727 730 728 731 type: { … … 794 797 label: i18n.__("City", "immotoolbox-connect"), 795 798 onChange: function (newValue) { props.setAttributes( { hide_city: newValue } ) }, 799 } 800 ), 801 el( 802 ToggleControl, 803 { 804 checked: props.attributes.hide_district, 805 label: i18n.__("District", "immotoolbox-connect"), 806 onChange: function (newValue) { props.setAttributes( { hide_district: newValue } ) }, 796 807 } 797 808 ), … … 975 986 props.attributes.hide_country?el("span", {className: "itbconnect_label"}, i18n.__("Country", "immotoolbox-connect")):null, 976 987 props.attributes.hide_city?el("span", {className: "itbconnect_label"}, i18n.__("City", "immotoolbox-connect")):null, 988 props.attributes.hide_district?el("span", {className: "itbconnect_label"}, i18n.__("District", "immotoolbox-connect")):null, 977 989 props.attributes.search_price_max?el("span", {className: "itbconnect_label"}, i18n.__("Max. price", "immotoolbox-connect")):null, 978 990 props.attributes.hide_rooms?el("span", {className: "itbconnect_label"}, i18n.__("Nb. rooms", "immotoolbox-connect")):null, … … 1042 1054 code+=' hide_city="1"'; 1043 1055 } 1056 if (props.attributes.hide_district) { 1057 code+=' hide_district="1"'; 1058 } 1044 1059 if (props.attributes.hide_type) code+=' hide_type="1"'; 1045 1060 if (props.attributes.hide_price_max) code+=' hide_price_max="1"'; -
immotoolbox-connect/trunk/immotoolbox-connect.php
r2746279 r2747456 4 4 Plugin URI: https://www.immotoolbox.com/ 5 5 Description: Displays ImmoToolBox real estate listings in your website 6 Version: 1.2.2 36 Version: 1.2.24 7 7 Author: ZebraSoft Monaco 8 8 Author URI: https://www.zebrasoft.mc … … 24 24 along with ImmoToolBox Connect. If not, see https://www.gnu.org/licenses/gpl.html. 25 25 */ 26 define('ITBCONNECT_VERSION', '1.2.2 3');26 define('ITBCONNECT_VERSION', '1.2.24'); 27 27 28 28 /** -
immotoolbox-connect/trunk/public/ITBConnectPublic.php
r2746279 r2747456 577 577 $data_view['countries'] = $this->getCountries(); 578 578 $data_view['cities'] = $this->getCities(); 579 $data_view['districts'] = $this->getDistricts(); 579 580 580 581 $twig = self::getTwig(); … … 752 753 return null; 753 754 } 755 static $districts = []; 756 public function getDistricts () 757 { 758 if (!empty(self::$districts)) return self::$districts; 759 $option = get_option(ITBCONNECT_OPTION_NAME, array()); 760 761 $url = ITBCONNECT_API_BASEURL.'/districts'; 762 $headers = [ 763 'X-AUTH-TOKEN: '.$option['private_key'] 764 , 'accept: application/ld+json' 765 ]; 766 $get['locale'] = current(explode('_', get_locale())); 767 $get['country'] = 'MC'; 768 $get['all'] = 1; 769 $get['nbpp'] = 1000; 770 $response = ITBConnect::getRemoteUrl($url, $get, [], $headers, 60*60, isset($option['nocheck_ssl'])&&$option['nocheck_ssl']); 771 772 if ($response) { 773 $data = json_decode( $response, true ); 774 if (isset($data['hydra:member'])) return self::$districts = $data['hydra:member']; 775 } 776 return null; 777 } 754 778 755 779 public function format_property($property, $locale) -
immotoolbox-connect/trunk/public/partials/base/search.html.twig
r2453844 r2747456 48 48 </div> 49 49 {% endblock %} 50 50 {% block search_district %} 51 <div class="form-group {{ col_class }}"> 52 {% if not atts.hide_district|default(true) %} 53 {% block search_district_label %} 54 <label for="district">{{ __("district", "immotoolbox-connect") }} {{ locale }}</label> 55 {% endblock %} 56 {% block search_district_select %} 57 <select name="nsearch[district][]" multiple id="district" class="form-control selectpicker" 58 title="{{ __("district", "immotoolbox-connect") }}..." data-live-search="true"> 59 {% block search_district_options %} 60 {% for district in districts %} 61 <option value="{{ district.id }}" {{ district.id in search.district?"selected" }}>{{ district.name }}</option> 62 {% endfor %} 63 {% endblock %} 64 </select> 65 {% endblock %} 66 {% endif %} 67 </div> 68 {% endblock %} 51 69 {% block search_type %} 52 70 {% if not hide_type|default %} -
immotoolbox-connect/trunk/readme.md
r2746279 r2747456 6 6 Tested up to: 5.9 7 7 Requires PHP: 5.9 8 Stable tag: 1.2.2 38 Stable tag: 1.2.24 9 9 License: GPL3 10 10 License URI: https://www.gnu.org/licenses/gpl.html … … 47 47 * Option to disable SSL verification 48 48 * Add function `do_shortcode($content, $ignore_html = false)` in Twig to render shortcode from template 49 * Add search by district 49 50 50 51 -
immotoolbox-connect/trunk/readme.txt
r2746279 r2747456 6 6 Tested up to: 5.9 7 7 Requires PHP: 5.9 8 Stable tag: 1.2.2 38 Stable tag: 1.2.24 9 9 License: GPL3 10 10 License URI: https://www.gnu.org/licenses/gpl.html … … 47 47 * Option to disable SSL verification 48 48 * Add function `do_shortcode($content, $ignore_html = false)` in Twig to render shortcode from template 49 * Add search by district 49 50 50 51
Note: See TracChangeset
for help on using the changeset viewer.