Changeset 3195443
- Timestamp:
- 11/23/2024 10:12:22 AM (17 months ago)
- Location:
- office-locator
- Files:
-
- 114 added
- 9 edited
-
tags/1.3.0 (added)
-
tags/1.3.0/LICENSE.txt (added)
-
tags/1.3.0/README.txt (added)
-
tags/1.3.0/admin (added)
-
tags/1.3.0/admin/class-admin.php (added)
-
tags/1.3.0/admin/class-field-functions.php (added)
-
tags/1.3.0/admin/class-office-locator-custom-setting.php (added)
-
tags/1.3.0/admin/class-setting.php (added)
-
tags/1.3.0/admin/css (added)
-
tags/1.3.0/admin/css/admin-setting.css (added)
-
tags/1.3.0/admin/css/admin.css (added)
-
tags/1.3.0/admin/css/all.min.css (added)
-
tags/1.3.0/admin/css/jquery-theme-ui.css (added)
-
tags/1.3.0/admin/css/jquery-ui.min.css (added)
-
tags/1.3.0/admin/css/select2.min.css (added)
-
tags/1.3.0/admin/images (added)
-
tags/1.3.0/admin/images/checkbox-icon.png (added)
-
tags/1.3.0/admin/images/chevron-down.svg (added)
-
tags/1.3.0/admin/images/logo.svg (added)
-
tags/1.3.0/admin/images/map-styles (added)
-
tags/1.3.0/admin/images/map-styles/Layout-1.png (added)
-
tags/1.3.0/admin/images/map-styles/Layout-2.png (added)
-
tags/1.3.0/admin/images/map-styles/Layout-3.png (added)
-
tags/1.3.0/admin/images/map-styles/Layout-4.png (added)
-
tags/1.3.0/admin/images/map-styles/Layout-5.png (added)
-
tags/1.3.0/admin/images/map-styles/Layout-6.png (added)
-
tags/1.3.0/admin/images/map-styles/Layout-7.png (added)
-
tags/1.3.0/admin/images/map-styles/Layout-8.png (added)
-
tags/1.3.0/admin/images/map-styles/aubergine.png (added)
-
tags/1.3.0/admin/images/map-styles/basic.png (added)
-
tags/1.3.0/admin/images/map-styles/dark.png (added)
-
tags/1.3.0/admin/images/map-styles/night.png (added)
-
tags/1.3.0/admin/images/map-styles/retro.png (added)
-
tags/1.3.0/admin/images/map-styles/silver.png (added)
-
tags/1.3.0/admin/images/map-styles/staticmap.png (added)
-
tags/1.3.0/admin/images/menu.svg (added)
-
tags/1.3.0/admin/images/office-sample.csv (added)
-
tags/1.3.0/admin/images/palette-solid.svg (added)
-
tags/1.3.0/admin/images/user-marker (added)
-
tags/1.3.0/admin/images/user-marker/blue.png (added)
-
tags/1.3.0/admin/images/user-marker/green.png (added)
-
tags/1.3.0/admin/images/user-marker/orange.png (added)
-
tags/1.3.0/admin/images/user-marker/purple.png (added)
-
tags/1.3.0/admin/images/user-marker/red.png (added)
-
tags/1.3.0/admin/images/user-marker/yellow.png (added)
-
tags/1.3.0/admin/includes (added)
-
tags/1.3.0/admin/includes/class-extra-field-functions.php (added)
-
tags/1.3.0/admin/includes/class-offices-functions.php (added)
-
tags/1.3.0/admin/index.php (added)
-
tags/1.3.0/admin/js (added)
-
tags/1.3.0/admin/js/admin-setting.js (added)
-
tags/1.3.0/admin/js/admin.js (added)
-
tags/1.3.0/admin/js/all.min.js (added)
-
tags/1.3.0/admin/js/select2.min.js (added)
-
tags/1.3.0/admin/webfonts (added)
-
tags/1.3.0/admin/webfonts/fa-brands-400.ttf (added)
-
tags/1.3.0/admin/webfonts/fa-brands-400.woff2 (added)
-
tags/1.3.0/admin/webfonts/fa-regular-400.ttf (added)
-
tags/1.3.0/admin/webfonts/fa-regular-400.woff2 (added)
-
tags/1.3.0/admin/webfonts/fa-solid-900.ttf (added)
-
tags/1.3.0/admin/webfonts/fa-solid-900.woff2 (added)
-
tags/1.3.0/admin/webfonts/fa-v4compatibility.ttf (added)
-
tags/1.3.0/admin/webfonts/fa-v4compatibility.woff2 (added)
-
tags/1.3.0/includes (added)
-
tags/1.3.0/includes/class-activator.php (added)
-
tags/1.3.0/includes/class-deactivator.php (added)
-
tags/1.3.0/includes/class-i18n.php (added)
-
tags/1.3.0/includes/index.php (added)
-
tags/1.3.0/includes/packages.php (added)
-
tags/1.3.0/index.php (added)
-
tags/1.3.0/languages (added)
-
tags/1.3.0/languages/office-locator.pot (added)
-
tags/1.3.0/office-locator.php (added)
-
tags/1.3.0/public (added)
-
tags/1.3.0/public/class-public.php (added)
-
tags/1.3.0/public/css (added)
-
tags/1.3.0/public/css/public.css (added)
-
tags/1.3.0/public/css/swiper-bundle.min.css (added)
-
tags/1.3.0/public/fonts (added)
-
tags/1.3.0/public/fonts/ProximaNova-Bold.eot (added)
-
tags/1.3.0/public/fonts/ProximaNova-Bold.ttf (added)
-
tags/1.3.0/public/fonts/ProximaNova-Bold.woff (added)
-
tags/1.3.0/public/fonts/ProximaNova-Bold.woff2 (added)
-
tags/1.3.0/public/fonts/ProximaNova-Regular.eot (added)
-
tags/1.3.0/public/fonts/ProximaNova-Regular.ttf (added)
-
tags/1.3.0/public/fonts/ProximaNova-Regular.woff (added)
-
tags/1.3.0/public/fonts/ProximaNova-Regular.woff2 (added)
-
tags/1.3.0/public/includes (added)
-
tags/1.3.0/public/includes/office-locator-ajax-functions.php (added)
-
tags/1.3.0/public/index.php (added)
-
tags/1.3.0/public/js (added)
-
tags/1.3.0/public/js/office-locator-public.js (added)
-
tags/1.3.0/public/js/swiper-bundle.min.js (added)
-
tags/1.3.0/public/map-style-json (added)
-
tags/1.3.0/public/map-style-json/aubergine.json (added)
-
tags/1.3.0/public/map-style-json/dark.json (added)
-
tags/1.3.0/public/map-style-json/night.json (added)
-
tags/1.3.0/public/map-style-json/retro.json (added)
-
tags/1.3.0/public/map-style-json/silver.json (added)
-
tags/1.3.0/public/map-style-json/standard.json (added)
-
tags/1.3.0/public/template-parts (added)
-
tags/1.3.0/public/template-parts/layout (added)
-
tags/1.3.0/public/template-parts/layout/global (added)
-
tags/1.3.0/public/template-parts/layout/global/office-locator-filter.php (added)
-
tags/1.3.0/public/template-parts/layout/office-locator-layout-1.php (added)
-
tags/1.3.0/public/template-parts/layout/office-locator-layout-2.php (added)
-
tags/1.3.0/public/template-parts/layout/office-locator-layout-3.php (added)
-
tags/1.3.0/public/template-parts/layout/office-locator-layout-4.php (added)
-
tags/1.3.0/public/template-parts/layout/office-locator-layout-5.php (added)
-
tags/1.3.0/public/template-parts/layout/office-locator-layout-6.php (added)
-
tags/1.3.0/public/template-parts/layout/office-locator-layout-7.php (added)
-
tags/1.3.0/public/template-parts/layout/office-locator-layout-8.php (added)
-
tags/1.3.0/public/template-parts/single-offices.php (added)
-
tags/1.3.0/uninstall.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/admin/class-office-locator-custom-setting.php (modified) (6 diffs)
-
trunk/admin/includes/class-offices-functions.php (modified) (5 diffs)
-
trunk/languages/office-locator.pot (modified) (42 diffs)
-
trunk/office-locator.php (modified) (2 diffs)
-
trunk/public/class-public.php (modified) (3 diffs)
-
trunk/public/css/public.css (modified) (5 diffs)
-
trunk/public/includes/office-locator-ajax-functions.php (modified) (4 diffs)
-
trunk/public/template-parts/layout/global/office-locator-filter.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
office-locator/trunk/README.txt
r3009822 r3195443 1 1 === Office Locator === 2 2 Plugin URI: https://office-locator.webbytemplate.com/ 3 Contributors: webbytemplate,soniakash,rohit-ghoghari 3 Contributors: webbytemplate,soniakash,rohit-ghoghari,webbycrown 4 4 Donate link: https://webbytemplate.com/ 5 5 Tags: office locator, offices, office locations, office find locator, find office locator, google maps, office addresses, wp office locator, google maps, geocode, gmaps, google map, map locations, geocoding, map addresses 6 6 Requires at least: 3.0.1 7 7 Requires PHP: 7.0 or higher 8 Tested up to: 6. 4.29 Stable tag: 1. 2.08 Tested up to: 6.7.1 9 Stable tag: 1.3.0 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html 12 12 13 Looking for a reliable and easy-to-use office locator plugin to enhance your business website? Look no further! Our office locator plugin allows your customers to easily find the nearest office location, providing them with a seamless and efficient experience. Improve your customer's experience and streamline your business operations with our top-notch office locator plugin today! 13 Looking for a reliable and easy-to-use office locator plugin to enhance your business website? Look no further! Our office locator plugin allows your customers to easily find the nearest office location, providing them with a seamless and efficient experience. Improve your customer's experience and streamline your business operations with our top-notch office locator plugin today!. 14 14 15 15 == Description == 16 16 17 An office locator is a software application that helps you find office locations in a given area. It uses various data sources, including Google Maps and geocoding, to display a map of available offices and their addresses. 17 An office locator is a software application that helps you find office locations in a given area. It uses various data sources, including Google Maps and geocoding, to display a map of available offices and their addresses. It Similar to the Multi Store Locator WordPress plugin, it allows users to search for offices based on location, distance, or other filters. 18 18 19 19 In this article, we'll explore the features of an office locator and how it can benefit your business. … … 119 119 == Changelog == 120 120 121 = 1.3.0 = 122 * Add Office Category Features. 123 121 124 = 1.2.0 = 122 125 * Add Map Language & Map Region Control. … … 126 129 = 1.1.0 = 127 130 * Add Map Layout Settings. 128 * Add StoresFillter control.131 * Add Office Fillter control. 129 132 * Add 8 Different Layout Of Map. 130 133 * Add Start Location Marker Width & Height. 131 134 * Add Store Location Marker Width & Height. 132 * Add StoresOffices Control.135 * Add Offices Control. 133 136 * Add Start Location Marker Control. 134 137 * Add Store Location Marker Control. -
office-locator/trunk/admin/class-office-locator-custom-setting.php
r3009822 r3195443 123 123 "BOTTOM_RIGHT" => __( "BOTTOM RIGHT", 'office-locator' ), 124 124 ); 125 126 $officecategoryList = get_terms([ 127 'taxonomy' => 'office_category', 128 'hide_empty' => false, 129 ]); 130 $default_office_category_list = array( 0 => __( "Select Category", 'office-locator' ) ); 131 if( is_array($officecategoryList) && count($officecategoryList) > 0 ){ 132 foreach ( $officecategoryList as $olc_cat_key => $olc_cat_value ) { 133 $default_office_category_list[$olc_cat_value->term_id] = $olc_cat_value->name; 134 } 135 } 125 136 126 137 $map_language = array( … … 784 795 array( 785 796 'type' => 'select', 797 'title' => __( 'Default Office Category', 'office-locator' ), 798 'name' => 'map_office_category', 799 'options' => $default_office_category_list, 800 ), 801 array( 802 'type' => 'select', 786 803 'title' => __( 'Map Office Results', 'office-locator' ), 787 804 'name' => 'map_office_results', … … 801 818 array( 802 819 'type' => 'switch', 820 'name' => 'office_category_filter', 821 'title' => __( 'Enable Office Category Filter', 'office-locator' ), 822 'desc' => '', 823 'field_desc' => '', 824 'default' => 'unable' 825 ), 826 array( 827 'type' => 'switch', 803 828 'name' => 'enable_store_filter', 804 'title' => __( 'Enable StoresFilter Control', 'office-locator' ),829 'title' => __( 'Enable Office Filter Control', 'office-locator' ), 805 830 'desc' => '', 806 831 'field_desc' => '', … … 810 835 'type' => 'switch', 811 836 'name' => 'enable_store_office', 812 'title' => __( 'Enable StoresOffices Control', 'office-locator' ),837 'title' => __( 'Enable Offices Control', 'office-locator' ), 813 838 'desc' => '', 814 839 'field_desc' => '', … … 826 851 'type' => 'switch', 827 852 'name' => 'enable_store_location_marker_control', 828 'title' => __( 'Enable Store Location Marker Control', 'office-locator' ),853 'title' => __( 'Enable Office Location Marker Control', 'office-locator' ), 829 854 'desc' => '', 830 855 'field_desc' => '', … … 842 867 'type' => 'switch', 843 868 'name' => 'enable_store_location_marker_pop_up_control', 844 'title' => __( 'Enable Store Location Marker Pop-Up Control', 'office-locator' ),869 'title' => __( 'Enable Office Location Marker Pop-Up Control', 'office-locator' ), 845 870 'desc' => '', 846 871 'field_desc' => '', -
office-locator/trunk/admin/includes/class-offices-functions.php
r3009822 r3195443 150 150 register_post_type( 'offices', $args ); 151 151 152 $cat_labels = array( 153 'name' => __( 'Office Categories', 'office-locator' ), 154 'singular_name' => __( 'Office Category', 'office-locator' ), 155 'search_items' => __( 'Search Office Categories', 'office-locator' ), 156 'all_items' => __( 'All Office Categories', 'office-locator' ), 157 'parent_item' => __( 'Parent Office Category', 'office-locator' ), 158 'parent_item_colon' => __( 'Parent Office Category:', 'office-locator' ), 159 'edit_item' => __( 'Edit Office Category', 'office-locator' ), 160 'update_item' => __( 'Update Office Category', 'office-locator' ), 161 'add_new_item' => __( 'Add New Office Category', 'office-locator' ), 162 'new_item_name' => __( 'New Office Category Name', 'office-locator' ), 163 'menu_name' => __( 'Office Categories', 'office-locator' ), 164 ); 165 166 $cat_args = array( 167 'labels' => $cat_labels, 168 'public' => false, 169 'hierarchical' => true, 170 'show_ui' => true, 171 'show_admin_column' => true, 172 'query_var' => true, 173 'show_in_rest' => true, 174 ); 175 register_taxonomy( 'office_category', 'offices', $cat_args ); 176 152 177 } 153 178 … … 200 225 </table> 201 226 <?php 227 wp_nonce_field( basename( __FILE__ ), 'olcMetaNonce' ); 202 228 } 203 229 … … 263 289 264 290 public function save_offices_meta_boxes( $post_id ) { 291 292 if ( !isset( $_POST['olcMetaNonce'] ) || !wp_verify_nonce( $_POST['olcMetaNonce'], basename( __FILE__ ) ) ){ 293 return; 294 } 265 295 266 296 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){ … … 508 538 'Office State' => $office_state, 509 539 'Office Country' => $office_country, 510 'Office Postal _code' => $office_postal_code540 'Office Postal Code' => $office_postal_code 511 541 ); 512 542 } … … 518 548 519 549 if( $post_data_arr ){ 520 $this->download_send_headers("office-" . date("Y-m-d") . ".csv"); 550 $this->download_send_headers("office-" . date("Y-m-d") . ".csv"); 521 551 echo $this->array2csv($post_data_arr); 522 552 } else { 523 echo "No data Found!"; 553 $this->download_send_headers("office-" . date("Y-m-d") . ".csv"); 554 $post_data_arr[0] = array( 555 'Unique ID' => '', 556 'Name' => '', 557 'Office Name' => '', 558 'Office Phone' => '', 559 'Office Fax' => '' , 560 'Office E-mail' => '', 561 'Office Address' => '', 562 'Office City' => '', 563 'Office State' => '', 564 'Office Country' => '', 565 'Office Postal Code' => '' 566 ); 567 echo $this->array2csv($post_data_arr); 524 568 } 525 569 die(); -
office-locator/trunk/languages/office-locator.pot
r3009822 r3195443 4 4 "Project-Id-Version: Office locator\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 202 3-12-13 11:49+0000\n"6 "POT-Creation-Date: 2024-11-22 06:07+0000\n" 7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 8 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 18 18 #: admin/class-office-locator-custom-setting.php:607 19 19 #: admin/class-office-locator-custom-setting.php:638 20 #: admin/class-office-locator-custom-setting.php:89 120 #: admin/class-office-locator-custom-setting.php:899 21 21 msgid "%" 22 22 msgstr "" … … 37 37 msgstr "" 38 38 39 #: admin/includes/class-offices-functions.php:164 40 #: admin/includes/class-offices-functions.php:226 39 #: admin/includes/class-offices-functions.php:161 40 msgid "Add New Office Category" 41 msgstr "" 42 43 #: admin/includes/class-offices-functions.php:189 44 #: admin/includes/class-offices-functions.php:251 41 45 msgid "Address" 42 46 msgstr "" … … 54 58 msgstr "" 55 59 60 #: admin/includes/class-offices-functions.php:156 61 msgid "All Office Categories" 62 msgstr "" 63 56 64 #: admin/includes/class-offices-functions.php:69 57 65 msgid "All Offices" … … 302 310 msgstr "" 303 311 304 #: admin/includes/class-offices-functions.php:2 30312 #: admin/includes/class-offices-functions.php:255 305 313 msgid "City" 306 314 msgstr "" … … 334 342 msgstr "" 335 343 336 #: admin/class-office-locator-custom-setting.php:86 1344 #: admin/class-office-locator-custom-setting.php:869 337 345 msgid "Container" 338 346 msgstr "" … … 346 354 msgstr "" 347 355 348 #: admin/includes/class-offices-functions.php:2 38356 #: admin/includes/class-offices-functions.php:263 349 357 msgid "Country" 350 358 msgstr "" … … 366 374 msgstr "" 367 375 368 #: admin/class-office-locator-custom-setting.php:9 43376 #: admin/class-office-locator-custom-setting.php:951 369 377 msgid "Custom Start Location Marker" 370 378 msgstr "" 371 379 372 #: admin/class-office-locator-custom-setting.php:9 65380 #: admin/class-office-locator-custom-setting.php:973 373 381 msgid "Custom Store Location Marker" 374 382 msgstr "" 375 383 376 #: admin/class-office-locator-custom-setting.php:92 1384 #: admin/class-office-locator-custom-setting.php:929 377 385 msgid "Custom Style" 378 386 msgstr "" … … 410 418 msgstr "" 411 419 412 #: public/includes/office-locator-ajax-functions.php:1 65420 #: public/includes/office-locator-ajax-functions.php:178 413 421 msgid "Direction" 414 422 msgstr "" … … 442 450 msgstr "" 443 451 444 #: admin/includes/class-offices-functions.php: 197452 #: admin/includes/class-offices-functions.php:222 445 453 msgid "E-Mail" 446 454 msgstr "" … … 454 462 msgstr "" 455 463 464 #: admin/includes/class-offices-functions.php:159 465 msgid "Edit Office Category" 466 msgstr "" 467 456 468 #: admin/class-office-locator-custom-setting.php:256 457 469 msgid "Egypt" … … 474 486 msgstr "" 475 487 476 #: admin/class-office-locator-custom-setting.php:998 488 #: admin/class-office-locator-custom-setting.php:804 489 msgid "Enable Office Category Filter" 490 msgstr "" 491 492 #: admin/class-office-locator-custom-setting.php:812 493 msgid "Enable Office Filter Control" 494 msgstr "" 495 496 #: admin/class-office-locator-custom-setting.php:836 497 msgid "Enable Office Location Marker Control" 498 msgstr "" 499 500 #: admin/class-office-locator-custom-setting.php:852 501 msgid "Enable Office Location Marker Pop-Up Control" 502 msgstr "" 503 504 #: admin/class-office-locator-custom-setting.php:820 505 msgid "Enable Offices Control" 506 msgstr "" 507 508 #: admin/class-office-locator-custom-setting.php:1006 477 509 msgid "Enable Permalink" 478 510 msgstr "" … … 482 514 msgstr "" 483 515 484 #: admin/class-office-locator-custom-setting.php:82 0516 #: admin/class-office-locator-custom-setting.php:828 485 517 msgid "Enable Start Location Marker Control" 486 518 msgstr "" 487 519 488 #: admin/class-office-locator-custom-setting.php:8 36520 #: admin/class-office-locator-custom-setting.php:844 489 521 msgid "Enable Start Location Marker Pop-Up Control" 490 msgstr ""491 492 #: admin/class-office-locator-custom-setting.php:828493 msgid "Enable Store Location Marker Control"494 msgstr ""495 496 #: admin/class-office-locator-custom-setting.php:844497 msgid "Enable Store Location Marker Pop-Up Control"498 msgstr ""499 500 #: admin/class-office-locator-custom-setting.php:804501 msgid "Enable Stores Filter Control"502 msgstr ""503 504 #: admin/class-office-locator-custom-setting.php:812505 msgid "Enable Stores Offices Control"506 522 msgstr "" 507 523 … … 550 566 msgstr "" 551 567 552 #: admin/class-office-locator-custom-setting.php:11 04568 #: admin/class-office-locator-custom-setting.php:1112 553 569 msgid "Export Office Address" 554 570 msgstr "" … … 566 582 msgstr "" 567 583 568 #: admin/includes/class-offices-functions.php: 193584 #: admin/includes/class-offices-functions.php:218 569 585 msgid "Fax" 570 586 msgstr "" … … 586 602 msgstr "" 587 603 588 #: public/template-parts/layout/global/office-locator-filter.php: 47604 #: public/template-parts/layout/global/office-locator-filter.php:72 589 605 msgid "Find Stores" 590 606 msgstr "" … … 622 638 msgstr "" 623 639 624 #: admin/class-office-locator-custom-setting.php:8 62640 #: admin/class-office-locator-custom-setting.php:870 625 641 msgid "Full Width" 626 642 msgstr "" … … 781 797 782 798 #: admin/class-office-locator-custom-setting.php:79 783 #: admin/class-office-locator-custom-setting.php:10 88799 #: admin/class-office-locator-custom-setting.php:1096 784 800 msgid "Import / Export" 785 801 msgstr "" 786 802 787 #: admin/class-office-locator-custom-setting.php:1 096803 #: admin/class-office-locator-custom-setting.php:1104 788 804 msgid "Import Office Address" 789 805 msgstr "" … … 1017 1033 msgstr "" 1018 1034 1019 #: admin/class-office-locator-custom-setting.php:90 01035 #: admin/class-office-locator-custom-setting.php:908 1020 1036 msgid "Map Background Color" 1021 1037 msgstr "" 1022 1038 1023 #: admin/class-office-locator-custom-setting.php:90 11039 #: admin/class-office-locator-custom-setting.php:909 1024 1040 msgid "Map Background Color Colours." 1025 1041 msgstr "" 1026 1042 1027 #: admin/class-office-locator-custom-setting.php:87 01043 #: admin/class-office-locator-custom-setting.php:878 1028 1044 msgid "Map Container Max Width" 1029 1045 msgstr "" 1030 1046 1031 #: admin/class-office-locator-custom-setting.php:8 581047 #: admin/class-office-locator-custom-setting.php:866 1032 1048 msgid "Map Container Size" 1033 1049 msgstr "" … … 1041 1057 msgstr "" 1042 1058 1043 #: admin/class-office-locator-custom-setting.php:9 751059 #: admin/class-office-locator-custom-setting.php:983 1044 1060 msgid "Map Layout" 1045 1061 msgstr "" … … 1061 1077 msgstr "" 1062 1078 1063 #: admin/class-office-locator-custom-setting.php:9 081079 #: admin/class-office-locator-custom-setting.php:916 1064 1080 msgid "Map Styles" 1065 1081 msgstr "" … … 1149 1165 msgstr "" 1150 1166 1151 #: admin/includes/class-offices-functions.php: 1851167 #: admin/includes/class-offices-functions.php:210 1152 1168 msgid "Name" 1153 1169 msgstr "" … … 1179 1195 #: admin/includes/class-offices-functions.php:73 1180 1196 msgid "New Office" 1197 msgstr "" 1198 1199 #: admin/includes/class-offices-functions.php:162 1200 msgid "New Office Category Name" 1181 1201 msgstr "" 1182 1202 … … 1250 1270 msgstr "" 1251 1271 1272 #: admin/includes/class-offices-functions.php:153 1252 1273 #: admin/includes/class-offices-functions.php:163 1274 msgid "Office Categories" 1275 msgstr "" 1276 1277 #: admin/includes/class-offices-functions.php:154 1278 #: public/template-parts/layout/global/office-locator-filter.php:42 1279 msgid "Office Category" 1280 msgstr "" 1281 1282 #: admin/includes/class-offices-functions.php:188 1253 1283 msgid "Office Information" 1254 1284 msgstr "" 1255 1285 1256 #: admin/includes/class-offices-functions.php:2 501286 #: admin/includes/class-offices-functions.php:275 1257 1287 msgid "Office Latitude" 1258 1288 msgstr "" … … 1267 1297 msgstr "" 1268 1298 1269 #: admin/includes/class-offices-functions.php:2 461299 #: admin/includes/class-offices-functions.php:271 1270 1300 msgid "Office Longitude" 1271 1301 msgstr "" … … 1299 1329 msgstr "" 1300 1330 1301 #: admin/class-office-locator-custom-setting.php:10 461302 #: admin/class-office-locator-custom-setting.php:10 521331 #: admin/class-office-locator-custom-setting.php:1054 1332 #: admin/class-office-locator-custom-setting.php:1060 1303 1333 #: admin/includes/class-offices-functions.php:66 1304 1334 #: admin/includes/class-offices-functions.php:101 … … 1326 1356 msgstr "" 1327 1357 1328 #: admin/class-office-locator-custom-setting.php:10 041358 #: admin/class-office-locator-custom-setting.php:1012 1329 1359 msgid "Open Office New Tab" 1330 1360 msgstr "" … … 1371 1401 msgstr "" 1372 1402 1403 #: admin/includes/class-offices-functions.php:157 1404 msgid "Parent Office Category" 1405 msgstr "" 1406 1407 #: admin/includes/class-offices-functions.php:158 1408 msgid "Parent Office Category:" 1409 msgstr "" 1410 1373 1411 #: admin/class-office-locator-custom-setting.php:74 1374 #: admin/class-office-locator-custom-setting.php: 9921412 #: admin/class-office-locator-custom-setting.php:1000 1375 1413 msgid "Permalink" 1376 1414 msgstr "" … … 1384 1422 msgstr "" 1385 1423 1386 #: admin/includes/class-offices-functions.php: 1891424 #: admin/includes/class-offices-functions.php:214 1387 1425 msgid "Phone" 1388 1426 msgstr "" … … 1392 1430 msgstr "" 1393 1431 1394 #: public/template-parts/layout/office-locator-layout-8.php:32 1432 #: public/template-parts/layout/office-locator-layout-5.php:47 1433 #: public/template-parts/layout/office-locator-layout-7.php:41 1434 #: public/template-parts/layout/office-locator-layout-4.php:50 1435 #: public/template-parts/layout/office-locator-layout-6.php:47 1395 1436 #: public/template-parts/layout/office-locator-layout-1.php:45 1396 #: public/template-parts/layout/office-locator-layout-6.php:471397 #: public/template-parts/layout/office-locator-layout-7.php:411398 #: public/template-parts/layout/office-locator-layout-5.php:471399 1437 #: public/template-parts/layout/office-locator-layout-3.php:51 1400 1438 #: public/template-parts/layout/office-locator-layout-2.php:45 1401 #: public/template-parts/layout/office-locator-layout- 4.php:501439 #: public/template-parts/layout/office-locator-layout-8.php:32 1402 1440 msgid "Please Enter Google API First to Load Google Map" 1403 1441 msgstr "" … … 1427 1465 msgstr "" 1428 1466 1429 #: admin/includes/class-offices-functions.php:2 421467 #: admin/includes/class-offices-functions.php:267 1430 1468 msgid "Postal Code" 1431 1469 msgstr "" … … 1445 1483 #: admin/class-office-locator-custom-setting.php:729 1446 1484 #: admin/class-office-locator-custom-setting.php:759 1447 #: admin/class-office-locator-custom-setting.php:89 01485 #: admin/class-office-locator-custom-setting.php:898 1448 1486 msgid "PX" 1449 1487 msgstr "" … … 1543 1581 #: admin/class-admin.php:178 1544 1582 msgid "Save" 1583 msgstr "" 1584 1585 #: admin/includes/class-offices-functions.php:155 1586 msgid "Search Office Categories" 1545 1587 msgstr "" 1546 1588 … … 1555 1597 #: admin/class-office-locator-custom-setting.php:726 1556 1598 #: admin/class-office-locator-custom-setting.php:756 1557 #: admin/class-office-locator-custom-setting.php:8 871599 #: admin/class-office-locator-custom-setting.php:895 1558 1600 msgid "Select" 1601 msgstr "" 1602 1603 #: public/template-parts/layout/global/office-locator-filter.php:44 1604 msgid "Select Category" 1559 1605 msgstr "" 1560 1606 … … 1591 1637 msgstr "" 1592 1638 1593 #: admin/class-office-locator-custom-setting.php:10 661594 #: admin/class-office-locator-custom-setting.php:10 731639 #: admin/class-office-locator-custom-setting.php:1074 1640 #: admin/class-office-locator-custom-setting.php:1081 1595 1641 msgid "Shortcode" 1596 1642 msgstr "" … … 1668 1714 msgstr "" 1669 1715 1670 #: admin/class-office-locator-custom-setting.php:93 11716 #: admin/class-office-locator-custom-setting.php:939 1671 1717 msgid "Start Location Marker" 1672 1718 msgstr "" … … 1684 1730 msgstr "" 1685 1731 1686 #: admin/includes/class-offices-functions.php:2 341732 #: admin/includes/class-offices-functions.php:259 1687 1733 msgid "State" 1688 1734 msgstr "" 1689 1735 1690 #: admin/class-office-locator-custom-setting.php:9 531736 #: admin/class-office-locator-custom-setting.php:961 1691 1737 msgid "Store Location Marker" 1692 1738 msgstr "" … … 1700 1746 msgstr "" 1701 1747 1702 #: admin/class-office-locator-custom-setting.php:101 01748 #: admin/class-office-locator-custom-setting.php:1018 1703 1749 msgid "Store Slug" 1704 1750 msgstr "" … … 1708 1754 msgstr "" 1709 1755 1710 #: admin/class-office-locator-custom-setting.php:8 521756 #: admin/class-office-locator-custom-setting.php:860 1711 1757 msgid "Styles" 1712 1758 msgstr "" … … 1780 1826 msgstr "" 1781 1827 1782 #: admin/class-office-locator-custom-setting.php:10 121828 #: admin/class-office-locator-custom-setting.php:1020 1783 1829 msgid "The <b>permalink slugs</b> must be unique on your site" 1784 1830 msgstr "" … … 1876 1922 msgstr "" 1877 1923 1924 #: admin/includes/class-offices-functions.php:160 1925 msgid "Update Office Category" 1926 msgstr "" 1927 1878 1928 #: admin/includes/class-offices-functions.php:86 1879 1929 msgid "Uploaded to this Office" … … 1935 1985 #: admin/class-office-locator-custom-setting.php:657 1936 1986 #: admin/class-office-locator-custom-setting.php:718 1937 #: admin/class-office-locator-custom-setting.php:8 791987 #: admin/class-office-locator-custom-setting.php:887 1938 1988 msgid "Width" 1939 1989 msgstr "" -
office-locator/trunk/office-locator.php
r3009822 r3195443 4 4 * Plugin URI: https://office-locator.webbytemplate.com/ 5 5 * Description: A fully featured office locator plugin that allows to add multiples office on your custom page, customizable style for maps and office makers that suits your site. 6 * Version: 1. 2.06 * Version: 1.3.0 7 7 * Author: webbytemplate 8 8 * Author URI: https://webbytemplate.com/ … … 21 21 * Currently plugin name ,version. 22 22 */ 23 define( 'OFFICE_LOCATOR_VERSION', '1. 2.0' );23 define( 'OFFICE_LOCATOR_VERSION', '1.3.0' ); 24 24 define( 'OFFICE_LOCATOR_NAME', 'office-locator' ); 25 25 define( 'OFFICE_LOCATOR_PLUGIN_FILE', __FILE__ ); -
office-locator/trunk/public/class-public.php
r3009822 r3195443 9 9 class Office_Locator_Public { 10 10 11 /** 12 * The ID of this plugin. 13 * 14 * @since 1.0.0 15 * @access private 16 * @var string $plugin_name The ID of this plugin. 17 */ 18 private $plugin_name; 19 20 /** 21 * The version of this plugin. 22 * 23 * @since 1.0.0 24 * @access private 25 * @var string $version The current version of this plugin. 26 */ 27 private $version; 28 29 /** 30 * Initialize the class and set its properties. 31 * 32 * @since 1.0.0 33 * @param string $plugin_name The name of the plugin. 34 * @param string $version The version of this plugin. 35 */ 36 public function __construct( $plugin_name, $version ) { 37 38 $this->plugin_name = $plugin_name; 39 $this->version = $version; 40 41 $this->load_public_dependencies(); 42 $this->init_hooks(); 43 44 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); 45 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 46 add_action( 'init', array( $this, 'set_ofc_global_variables' ), 9 ); 47 add_filter( 'body_class',array( $this, 'add_office_locator_classes' ) ); 48 add_action( 'wp_head',array( $this, 'add_office_locator_variables' ) ); 49 add_filter( 'template_include', array( $this, 'offices_locator_set_template' ) ); 50 51 } 52 53 /** 54 * Hook into actions and filters. 55 * 56 * @since 1.0.0 57 */ 58 private function init_hooks() { 59 add_action( 'after_setup_theme', array( $this, 'include_office_locators_template_functions' ), 11 ); 60 } 61 62 /** 63 * That function including the functions files. 64 * 65 * @since 1.0.0 66 */ 67 public function include_office_locators_template_functions() { 68 69 include 'includes/office-locator-ajax-functions.php'; 70 $Office_Locator_Ajax_Functons = new Office_Locator_Ajax_Functons( $this->plugin_name, $this->version ); 71 72 } 73 74 /** 75 * Register the stylesheets for the public-facing side of the site. 76 * 77 * @since 1.0.0 78 */ 79 public function enqueue_styles() { 80 81 wp_enqueue_style( 'wt-font-awesome', plugin_dir_url( __DIR__ ) . '/admin/css/all.min.css', array(), $this->version, 'all' ); 82 wp_enqueue_style( 'wt-swiper-style', plugin_dir_url( __FILE__ ) . 'css/swiper-bundle.min.css', array(), $this->version, 'all' ); 83 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/public.css', array(), $this->version, 'all' ); 84 } 85 86 /** 87 * Register the JavaScript for the public-facing side of the site. 88 * 89 * @since 1.0.0 90 */ 91 public function enqueue_scripts() { 92 93 global $olc_map_markers, $olc_map_styles; 94 $tab = 'general'; 95 $option_name = str_replace('-', '_', $this->plugin_name) .'_'.$tab; 96 $options = get_option($option_name); 97 $key = ( isset( $options['map_api_key'] ) && !empty( $options['map_api_key'] ) ) ? '&key='.$options['map_api_key'] : ''; 98 $map_language = ( isset( $options['map_language'] ) && !empty( $options['map_language'] ) ) ? '&language='.$options['map_language'] : ''; 99 $map_region = ( isset( $options['map_region'] ) && !empty( $options['map_region'] ) ) ? '®ion='.$options['map_region'] : ''; 100 wp_enqueue_script( 'wt-font-awesome', plugin_dir_url( __DIR__ ) . '/admin/js/all.min.js', array( 'jquery' ), $this->version, true ); 101 wp_enqueue_script( 'wt-swiper-script', plugin_dir_url( __FILE__ ) . 'js/swiper-bundle.min.js', array( 'jquery' ), $this->version, true ); 102 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/office-locator-public.js', array( 'jquery' ), $this->version, true ); 103 wp_localize_script( $this->plugin_name, 'ofcAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) )); 104 wp_enqueue_script( 'olc-google-map', 'https://maps.googleapis.com/maps/api/js?callback=ofcMpInitialize'.$key.''.$map_language.''.$map_region.'&libraries=places&sensor=false', array( 'jquery' ), $this->version, true ); 105 } 106 107 /** 108 * Make Office Locator Javascript Varibles. 109 * 110 * @since 1.0.0 111 */ 112 113 public function add_office_locator_variables(){ 114 ?> 115 <script type="text/javascript"> 116 var ofcMapObj = <?php echo esc_js( '[]' ); ?> 117 </script> 118 <?php 119 } 120 121 122 /** 123 * Creat Office Locator Set template Parts. 124 * 125 * @since 1.0.0 126 */ 127 128 public function offices_locator_set_template( $offices_template ){ 129 130 if( is_singular( 'offices' ) && 'single-offices.php' != $offices_template ){ 131 $offices_template = plugin_dir_path( dirname( __FILE__ ) ) . 'public/template-parts/single-offices.php'; 132 } 133 134 $offices_template = apply_filters( 'single_office_template_override' , $offices_template ); 135 136 return $offices_template; 137 } 138 139 /** 140 * Make Office Locator Global Varibles. 141 * 142 * @since 1.0.0 143 */ 144 145 public function set_ofc_global_variables(){ 146 147 global $olc_map_markers, $olc_map_styles; 148 $map_options = str_replace( '-', '_', $this->plugin_name ) .'_map'; 149 $ofcMapData = get_option( $map_options ); 150 $ofcMapData['no_result_msg'] = __( "No offices found.", 'office-locator' ); 151 $ofcMapData['start_location_marker_msg'] = __( 'Your Start Office Location', 'office-locator' ); 152 $ofcMapData['back_btn_text'] = __( 'Back', 'office-locator' ); 153 154 $general_options = str_replace( '-', '_', $this->plugin_name ) .'_general'; 155 $ofcGeneralData = get_option( $general_options ); 156 157 $olc_start_point = isset( $ofcMapData['olc_start_point'] ) ? $ofcMapData['olc_start_point'] : array(); 158 $olc_lat_long = isset($olc_start_point['lat_long']) ? $olc_start_point['lat_long'] : array(); 159 if( $olc_lat_long ){ 160 $olc_lat_long = explode( ',' , $olc_lat_long ); 161 } 162 $ofcMapData['olc_lat_long'] = $olc_lat_long; 163 164 $ofcRadiusList = array( 10, 25, 50, 100, 200, 500, 1000 ); 165 $ofcResultList = array( 10, 25, 50, 75, 100 ); 166 167 $ofcRadiusList = apply_filters( 'office_store_radius_list', $ofcRadiusList ); 168 $ofcResultList = apply_filters( 'office_store_result_list', $ofcResultList ); 169 170 $GLOBALS['ofcMapData'] = $ofcMapData; 171 $GLOBALS['ofcGeneralData'] = $ofcGeneralData; 172 $GLOBALS['ofcResultList'] = $ofcResultList; 173 $GLOBALS['ofcRadiusList'] = $ofcRadiusList; 174 } 175 176 /** 177 * Return Value Office Locator Map Settings Varibles. 178 * 179 * @since 1.0.0 180 */ 181 182 public function set_olc_map_setting( $olcMapAttr ){ 183 184 global $olc_map_markers, $olc_map_styles, $olc_map_layout; 185 186 if( empty( $olcMapAttr ) ){ 187 $olcMapAttr = (object)array(); 188 }else{ 189 190 $marker_img = ''; 191 if( isset( $olcMapAttr['custom_store_marker']) && !empty( trim( $olcMapAttr['custom_store_marker'] ) ) ){ 192 $marker_img = wp_get_attachment_url( $olcMapAttr['custom_store_marker'], 'thumbnail' ); 193 } 194 if( empty($marker_img) ){ 195 if( isset( $olcMapAttr['store_marker']) && !empty( trim( $olcMapAttr['store_marker'] ) ) ){ 196 $marker_img = isset($olc_map_markers[$olcMapAttr['store_marker']]['img']) ? $olc_map_markers[$olcMapAttr['store_marker']]['img'] : ''; 197 } 198 } 199 $olcMapAttr['store_marker'] = $marker_img; 200 201 $start_marker_img = ''; 202 if( isset( $olcMapAttr['custom_start_location_marker']) && !empty( trim( $olcMapAttr['custom_start_location_marker'] ) ) ){ 203 $start_marker_img = wp_get_attachment_url( $olcMapAttr['custom_start_location_marker'], 'thumbnail' ); 204 } 205 if( empty($start_marker_img) ){ 206 if( isset( $olcMapAttr['start_location_marker']) && !empty( trim( $olcMapAttr['start_location_marker'] ) ) ){ 207 $start_marker_img = isset($olc_map_markers[$olcMapAttr['start_location_marker']]['img']) ? $olc_map_markers[$olcMapAttr['start_location_marker']]['img'] : ''; 208 } 209 } 210 $olcMapAttr['start_location_marker'] = $start_marker_img; 211 212 $olc_map_style = ''; 213 if( isset( $olcMapAttr['custom_style'] ) && !empty( trim( $olcMapAttr['custom_style'] ) ) ){ 214 $olc_map_style_valid = ( is_string( $olcMapAttr['custom_style'] ) && is_array( json_decode( $olcMapAttr['custom_style'], true ) ) ) ? true : false; 215 if( $olc_map_style_valid == true ){ 216 $olc_map_style = $olcMapAttr['custom_style']; 217 } 218 } 219 220 if( empty( $olc_map_style ) ){ 221 $map_style = isset($olcMapAttr['map_style']) ? $olcMapAttr['map_style'] : ''; 222 if( $map_style ){ 223 $map_style_url = plugin_dir_path( __FILE__ ).'map-style-json/'.$map_style.'.json'; 224 $olc_map_style = file_get_contents( $map_style_url ); 225 if( $olc_map_style ){ 226 $olc_map_style = json_decode( $olc_map_style ); 227 } 228 } 229 } 230 231 $olcMapAttr['map_style'] = $olc_map_style; 232 } 233 return $olcMapAttr; 234 } 235 236 /** 237 * That function including the public dependencies. 238 * 239 * @since 1.0.0 240 */ 241 public function load_public_dependencies() { 242 243 add_shortcode( 'office_locator', array( $this, 'office_locators' ) ); 244 245 } 246 247 /** 248 * Displaying office locators. 249 * 250 * @since 1.0.0 251 */ 252 public function office_locators( $atts ) { 253 254 ob_start(); 255 global $olc_map_markers, $olc_map_layout, $olc_map_styles, $ofcMapData, $ofcGeneralData; 256 257 if( isset($atts['lat_long']) && !empty( trim( $atts['lat_long'] ) ) ){ 258 $atts['olc_lat_long'] = explode( ',', trim( $atts['lat_long'] ) ); 259 } 260 261 $default_attr = array( 262 'offices' => '', 263 'custom_store_marker' => isset( $ofcMapData['custom_store_marker'] ) ? $ofcMapData['custom_store_marker'] : '', 264 'custom_start_location_marker' => isset( $ofcMapData['custom_start_location_marker'] ) ? $ofcMapData['custom_start_location_marker'] : '', 265 'custom_style' => isset( $ofcMapData['custom_style'] ) ? $ofcMapData['custom_style'] : '', 266 'map_width' => $ofcMapData['map_width']['width'].$ofcMapData['map_width']['value'], 267 'map_height' => $ofcMapData['map_height']['height'].$ofcMapData['map_height']['value'], 268 'map_view_type' => $ofcMapData['map_view_type'], 269 'map_style' => $ofcMapData['map_style'], 270 'store_marker' => $ofcMapData['store_marker'], 271 'start_location_marker' => $ofcMapData['start_location_marker'], 272 'no_result_msg' => $ofcMapData['no_result_msg'], 273 'start_location_marker_msg' => $ofcMapData['start_location_marker_msg'], 274 'back_btn_text' => $ofcMapData['back_btn_text'], 275 'load_olc_stores' => array(), 276 'olc_zoom_map' => $ofcMapData['outer_zoom_level'], 277 'olc_inner_map' => $ofcMapData['inner_zoom_level'], 278 'street_view_control' => $ofcMapData['street_view_control'], 279 'map_type_control' => $ofcMapData['map_type_control'], 280 'wheel_zooming' => $ofcMapData['wheel_zooming'], 281 'full_screen_control' => $ofcMapData['full_screen_control'], 282 'zoom_control' => $ofcMapData['zoom_control'], 283 'zoom_position' => $ofcMapData['zoom_position'], 284 'full_screen_ctlr_pos' => $ofcMapData['full_screen_ctlr_pos'], 285 'street_view_ctlr_pos' => $ofcMapData['street_view_ctlr_pos'], 286 'olc_lat_long' => $ofcMapData['olc_lat_long'], 287 'map_type_ctlr_pos' => $ofcMapData['map_type_ctlr_pos'], 288 'map_layout' => isset( $ofcMapData['map_layout'] ) ? $ofcMapData['map_layout'] : 'layout-1', 289 'enable_store_filter' => isset( $ofcMapData['enable_store_filter'] ) ? $ofcMapData['enable_store_filter'] : 'yes', 290 'enable_store_office' => isset( $ofcMapData['enable_store_office'] ) ? $ofcMapData['enable_store_office'] : 'yes', 291 'enable_start_location_marker_control' => isset( $ofcMapData['enable_start_location_marker_control'] ) ? $ofcMapData['enable_start_location_marker_control'] : 'yes', 292 'enable_store_location_marker_control' => isset( $ofcMapData['enable_store_location_marker_control'] ) ? $ofcMapData['enable_store_location_marker_control'] : 'yes', 293 'enable_start_location_marker_pop_up_control' => isset( $ofcMapData['enable_start_location_marker_pop_up_control'] ) ? $ofcMapData['enable_start_location_marker_pop_up_control'] : 'yes', 294 'enable_store_location_marker_pop_up_control' => isset( $ofcMapData['enable_store_location_marker_pop_up_control'] ) ? $ofcMapData['enable_store_location_marker_pop_up_control'] : 'yes', 295 'start_location_marker_width' => isset( $ofcMapData['start_location_marker_width']['width'] ) ? $ofcMapData['start_location_marker_width']['width'] : '25', 296 'start_location_marker_height' => isset( $ofcMapData['start_location_marker_height']['height'] ) ? $ofcMapData['start_location_marker_height']['height'] : '35', 297 'store_location_marker_width' => isset( $ofcMapData['store_location_marker_width']['width'] ) ? $ofcMapData['store_location_marker_width']['width'] : '25', 298 'store_location_marker_height' => isset( $ofcMapData['store_location_marker_height']['height'] ) ? $ofcMapData['store_location_marker_height']['height'] : '35', 299 'map_container_max_width' => isset( $ofcMapData['map_container_max_width']['width'] ) ? $ofcMapData['map_container_max_width']['width'].$ofcMapData['map_container_max_width']['value'] : '1650px', 300 'map_container_size' => isset( $ofcMapData['map_container_size'] ) ? $ofcMapData['map_container_size'] : 'container', 301 'map_background_color' => isset( $ofcMapData['map_background_color'] ) ? $ofcMapData['map_background_color'] : '#f9f9f9', 302 'map_office_radius' => isset( $ofcMapData['map_office_radius'] ) ? $ofcMapData['map_office_radius'] : 10, 303 'map_office_results' => isset( $ofcMapData['map_office_results'] ) ? $ofcMapData['map_office_results'] : 10, 304 'map_office_unit' => isset( $ofcMapData['map_office_unit'] ) ? $ofcMapData['map_office_unit'] : 'km', 305 'load_olc_markers' => array(), 306 'olc_view' => '', 307 'olc_panel' => '', 308 'olc_map' => '' 309 ); 11 /** 12 * The ID of this plugin. 13 * 14 * @since 1.0.0 15 * @access private 16 * @var string $plugin_name The ID of this plugin. 17 */ 18 private $plugin_name; 19 20 /** 21 * The version of this plugin. 22 * 23 * @since 1.0.0 24 * @access private 25 * @var string $version The current version of this plugin. 26 */ 27 private $version; 28 29 /** 30 * Initialize the class and set its properties. 31 * 32 * @since 1.0.0 33 * @param string $plugin_name The name of the plugin. 34 * @param string $version The version of this plugin. 35 */ 36 public function __construct( $plugin_name, $version ) { 37 38 $this->plugin_name = $plugin_name; 39 $this->version = $version; 40 41 $this->load_public_dependencies(); 42 $this->init_hooks(); 43 44 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); 45 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 46 add_action( 'init', array( $this, 'set_ofc_global_variables' ), 9 ); 47 add_filter( 'body_class',array( $this, 'add_office_locator_classes' ) ); 48 add_action( 'wp_head',array( $this, 'add_office_locator_variables' ) ); 49 add_filter( 'template_include', array( $this, 'offices_locator_set_template' ) ); 50 51 } 52 53 /** 54 * Hook into actions and filters. 55 * 56 * @since 1.0.0 57 */ 58 private function init_hooks() { 59 add_action( 'after_setup_theme', array( $this, 'include_office_locators_template_functions' ), 11 ); 60 } 61 62 /** 63 * That function including the functions files. 64 * 65 * @since 1.0.0 66 */ 67 public function include_office_locators_template_functions() { 68 69 include 'includes/office-locator-ajax-functions.php'; 70 $Office_Locator_Ajax_Functons = new Office_Locator_Ajax_Functons( $this->plugin_name, $this->version ); 71 72 } 73 74 /** 75 * Register the stylesheets for the public-facing side of the site. 76 * 77 * @since 1.0.0 78 */ 79 public function enqueue_styles() { 80 81 wp_enqueue_style( 'wt-font-awesome', plugin_dir_url( __DIR__ ) . '/admin/css/all.min.css', array(), $this->version, 'all' ); 82 wp_enqueue_style( 'wt-swiper-style', plugin_dir_url( __FILE__ ) . 'css/swiper-bundle.min.css', array(), $this->version, 'all' ); 83 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/public.css', array(), $this->version, 'all' ); 84 } 85 86 /** 87 * Register the JavaScript for the public-facing side of the site. 88 * 89 * @since 1.0.0 90 */ 91 public function enqueue_scripts() { 92 93 global $olc_map_markers, $olc_map_styles; 94 $tab = 'general'; 95 $option_name = str_replace('-', '_', $this->plugin_name) .'_'.$tab; 96 $options = get_option($option_name); 97 $key = ( isset( $options['map_api_key'] ) && !empty( $options['map_api_key'] ) ) ? '&key='.$options['map_api_key'] : ''; 98 $map_language = ( isset( $options['map_language'] ) && !empty( $options['map_language'] ) ) ? '&language='.$options['map_language'] : ''; 99 $map_region = ( isset( $options['map_region'] ) && !empty( $options['map_region'] ) ) ? '®ion='.$options['map_region'] : ''; 100 wp_enqueue_script( 'wt-font-awesome', plugin_dir_url( __DIR__ ) . '/admin/js/all.min.js', array( 'jquery' ), $this->version, true ); 101 wp_enqueue_script( 'wt-swiper-script', plugin_dir_url( __FILE__ ) . 'js/swiper-bundle.min.js', array( 'jquery' ), $this->version, true ); 102 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/office-locator-public.js', array( 'jquery' ), $this->version, true ); 103 wp_localize_script( $this->plugin_name, 'ofcAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) )); 104 wp_enqueue_script( 'olc-google-map', 'https://maps.googleapis.com/maps/api/js?callback=ofcMpInitialize'.$key.''.$map_language.''.$map_region.'&libraries=places&sensor=false', array( 'jquery' ), $this->version, true ); 105 } 106 107 /** 108 * Make Office Locator Javascript Varibles. 109 * 110 * @since 1.0.0 111 */ 112 113 public function add_office_locator_variables(){ 114 ?> 115 <script type="text/javascript"> 116 var ofcMapObj = <?php echo esc_js( '[]' ); ?> 117 </script> 118 <?php 119 } 120 121 122 /** 123 * Creat Office Locator Set template Parts. 124 * 125 * @since 1.0.0 126 */ 127 128 public function offices_locator_set_template( $offices_template ){ 129 130 if( is_singular( 'offices' ) && 'single-offices.php' != $offices_template ){ 131 $offices_template = plugin_dir_path( dirname( __FILE__ ) ) . 'public/template-parts/single-offices.php'; 132 } 133 134 $offices_template = apply_filters( 'single_office_template_override' , $offices_template ); 135 136 return $offices_template; 137 } 138 139 /** 140 * Make Office Locator Global Varibles. 141 * 142 * @since 1.0.0 143 */ 144 145 public function set_ofc_global_variables(){ 146 147 global $olc_map_markers, $olc_map_styles; 148 $map_options = str_replace( '-', '_', $this->plugin_name ) .'_map'; 149 $ofcMapData = get_option( $map_options ); 150 $ofcMapData['no_result_msg'] = __( "No offices found.", 'office-locator' ); 151 $ofcMapData['start_location_marker_msg'] = __( 'Your Start Office Location', 'office-locator' ); 152 $ofcMapData['back_btn_text'] = __( 'Back', 'office-locator' ); 153 154 $general_options = str_replace( '-', '_', $this->plugin_name ) .'_general'; 155 $ofcGeneralData = get_option( $general_options ); 156 157 $olc_start_point = isset( $ofcMapData['olc_start_point'] ) ? $ofcMapData['olc_start_point'] : array(); 158 $olc_lat_long = isset($olc_start_point['lat_long']) ? $olc_start_point['lat_long'] : array(); 159 if( $olc_lat_long ){ 160 $olc_lat_long = explode( ',' , $olc_lat_long ); 161 } 162 $ofcMapData['olc_lat_long'] = $olc_lat_long; 163 164 $ofcRadiusList = array( 10, 25, 50, 100, 200, 500, 1000 ); 165 $ofcResultList = array( 10, 25, 50, 75, 100 ); 166 167 $ofcRadiusList = apply_filters( 'office_store_radius_list', $ofcRadiusList ); 168 $ofcResultList = apply_filters( 'office_store_result_list', $ofcResultList ); 169 170 $GLOBALS['ofcMapData'] = $ofcMapData; 171 $GLOBALS['ofcGeneralData'] = $ofcGeneralData; 172 $GLOBALS['ofcResultList'] = $ofcResultList; 173 $GLOBALS['ofcRadiusList'] = $ofcRadiusList; 174 } 175 176 /** 177 * Return Value Office Locator Map Settings Varibles. 178 * 179 * @since 1.0.0 180 */ 181 182 public function set_olc_map_setting( $olcMapAttr ){ 183 184 global $olc_map_markers, $olc_map_styles, $olc_map_layout; 185 186 if( empty( $olcMapAttr ) ){ 187 $olcMapAttr = (object)array(); 188 }else{ 189 190 $marker_img = ''; 191 if( isset( $olcMapAttr['custom_store_marker']) && !empty( trim( $olcMapAttr['custom_store_marker'] ) ) ){ 192 $marker_img = wp_get_attachment_url( $olcMapAttr['custom_store_marker'], 'thumbnail' ); 193 } 194 if( empty($marker_img) ){ 195 if( isset( $olcMapAttr['store_marker']) && !empty( trim( $olcMapAttr['store_marker'] ) ) ){ 196 $marker_img = isset($olc_map_markers[$olcMapAttr['store_marker']]['img']) ? $olc_map_markers[$olcMapAttr['store_marker']]['img'] : ''; 197 } 198 } 199 $olcMapAttr['store_marker'] = $marker_img; 200 201 $start_marker_img = ''; 202 if( isset( $olcMapAttr['custom_start_location_marker']) && !empty( trim( $olcMapAttr['custom_start_location_marker'] ) ) ){ 203 $start_marker_img = wp_get_attachment_url( $olcMapAttr['custom_start_location_marker'], 'thumbnail' ); 204 } 205 if( empty($start_marker_img) ){ 206 if( isset( $olcMapAttr['start_location_marker']) && !empty( trim( $olcMapAttr['start_location_marker'] ) ) ){ 207 $start_marker_img = isset($olc_map_markers[$olcMapAttr['start_location_marker']]['img']) ? $olc_map_markers[$olcMapAttr['start_location_marker']]['img'] : ''; 208 } 209 } 210 $olcMapAttr['start_location_marker'] = $start_marker_img; 211 212 $olc_map_style = ''; 213 if( isset( $olcMapAttr['custom_style'] ) && !empty( trim( $olcMapAttr['custom_style'] ) ) ){ 214 $olc_map_style_valid = ( is_string( $olcMapAttr['custom_style'] ) && is_array( json_decode( $olcMapAttr['custom_style'], true ) ) ) ? true : false; 215 if( $olc_map_style_valid == true ){ 216 $olc_map_style = $olcMapAttr['custom_style']; 217 } 218 } 219 220 if( empty( $olc_map_style ) ){ 221 $map_style = isset($olcMapAttr['map_style']) ? $olcMapAttr['map_style'] : ''; 222 if( $map_style ){ 223 $map_style_url = plugin_dir_path( __FILE__ ).'map-style-json/'.$map_style.'.json'; 224 $olc_map_style = file_get_contents( $map_style_url ); 225 if( $olc_map_style ){ 226 $olc_map_style = json_decode( $olc_map_style ); 227 } 228 } 229 } 230 231 $olcMapAttr['map_style'] = $olc_map_style; 232 } 233 return $olcMapAttr; 234 } 235 236 /** 237 * That function including the public dependencies. 238 * 239 * @since 1.0.0 240 */ 241 public function load_public_dependencies() { 242 243 add_shortcode( 'office_locator', array( $this, 'office_locators' ) ); 244 245 } 246 247 /** 248 * Displaying office locators. 249 * 250 * @since 1.0.0 251 */ 252 public function office_locators( $atts ) { 253 254 ob_start(); 255 global $olc_map_markers, $olc_map_layout, $olc_map_styles, $ofcMapData, $ofcGeneralData; 256 257 if( isset($atts['lat_long']) && !empty( trim( $atts['lat_long'] ) ) ){ 258 $atts['olc_lat_long'] = explode( ',', trim( $atts['lat_long'] ) ); 259 } 260 261 $default_attr = array( 262 'offices' => '', 263 'custom_store_marker' => isset( $ofcMapData['custom_store_marker'] ) ? $ofcMapData['custom_store_marker'] : '', 264 'custom_start_location_marker' => isset( $ofcMapData['custom_start_location_marker'] ) ? $ofcMapData['custom_start_location_marker'] : '', 265 'custom_style' => isset( $ofcMapData['custom_style'] ) ? $ofcMapData['custom_style'] : '', 266 'map_width' => $ofcMapData['map_width']['width'].$ofcMapData['map_width']['value'], 267 'map_height' => $ofcMapData['map_height']['height'].$ofcMapData['map_height']['value'], 268 'map_view_type' => $ofcMapData['map_view_type'], 269 'map_style' => $ofcMapData['map_style'], 270 'store_marker' => $ofcMapData['store_marker'], 271 'start_location_marker' => $ofcMapData['start_location_marker'], 272 'no_result_msg' => $ofcMapData['no_result_msg'], 273 'start_location_marker_msg' => $ofcMapData['start_location_marker_msg'], 274 'back_btn_text' => $ofcMapData['back_btn_text'], 275 'load_olc_stores' => array(), 276 'olc_zoom_map' => $ofcMapData['outer_zoom_level'], 277 'olc_inner_map' => $ofcMapData['inner_zoom_level'], 278 'street_view_control' => $ofcMapData['street_view_control'], 279 'map_type_control' => $ofcMapData['map_type_control'], 280 'wheel_zooming' => $ofcMapData['wheel_zooming'], 281 'full_screen_control' => $ofcMapData['full_screen_control'], 282 'zoom_control' => $ofcMapData['zoom_control'], 283 'zoom_position' => $ofcMapData['zoom_position'], 284 'full_screen_ctlr_pos' => $ofcMapData['full_screen_ctlr_pos'], 285 'street_view_ctlr_pos' => $ofcMapData['street_view_ctlr_pos'], 286 'olc_lat_long' => $ofcMapData['olc_lat_long'], 287 'map_type_ctlr_pos' => $ofcMapData['map_type_ctlr_pos'], 288 'map_layout' => isset( $ofcMapData['map_layout'] ) ? $ofcMapData['map_layout'] : 'layout-1', 289 'enable_store_filter' => isset( $ofcMapData['enable_store_filter'] ) ? $ofcMapData['enable_store_filter'] : 'yes', 290 'enable_store_office' => isset( $ofcMapData['enable_store_office'] ) ? $ofcMapData['enable_store_office'] : 'yes', 291 'office_category_filter' => isset( $ofcMapData['office_category_filter'] ) ? $ofcMapData['office_category_filter'] : 'no', 292 'enable_start_location_marker_control' => isset( $ofcMapData['enable_start_location_marker_control'] ) ? $ofcMapData['enable_start_location_marker_control'] : 'yes', 293 'enable_store_location_marker_control' => isset( $ofcMapData['enable_store_location_marker_control'] ) ? $ofcMapData['enable_store_location_marker_control'] : 'yes', 294 'enable_start_location_marker_pop_up_control' => isset( $ofcMapData['enable_start_location_marker_pop_up_control'] ) ? $ofcMapData['enable_start_location_marker_pop_up_control'] : 'yes', 295 'enable_store_location_marker_pop_up_control' => isset( $ofcMapData['enable_store_location_marker_pop_up_control'] ) ? $ofcMapData['enable_store_location_marker_pop_up_control'] : 'yes', 296 'start_location_marker_width' => isset( $ofcMapData['start_location_marker_width']['width'] ) ? $ofcMapData['start_location_marker_width']['width'] : '25', 297 'start_location_marker_height' => isset( $ofcMapData['start_location_marker_height']['height'] ) ? $ofcMapData['start_location_marker_height']['height'] : '35', 298 'store_location_marker_width' => isset( $ofcMapData['store_location_marker_width']['width'] ) ? $ofcMapData['store_location_marker_width']['width'] : '25', 299 'store_location_marker_height' => isset( $ofcMapData['store_location_marker_height']['height'] ) ? $ofcMapData['store_location_marker_height']['height'] : '35', 300 'map_container_max_width' => isset( $ofcMapData['map_container_max_width']['width'] ) ? $ofcMapData['map_container_max_width']['width'].$ofcMapData['map_container_max_width']['value'] : '1650px', 301 'map_container_size' => isset( $ofcMapData['map_container_size'] ) ? $ofcMapData['map_container_size'] : 'container', 302 'map_background_color' => isset( $ofcMapData['map_background_color'] ) ? $ofcMapData['map_background_color'] : '#f9f9f9', 303 'map_office_radius' => isset( $ofcMapData['map_office_radius'] ) ? $ofcMapData['map_office_radius'] : 10, 304 'map_office_category' => isset( $ofcMapData['map_office_category'] ) ? $ofcMapData['map_office_category'] : 0, 305 'map_office_results' => isset( $ofcMapData['map_office_results'] ) ? $ofcMapData['map_office_results'] : 10, 306 'map_office_unit' => isset( $ofcMapData['map_office_unit'] ) ? $ofcMapData['map_office_unit'] : 'km', 307 'load_olc_markers' => array(), 308 'olc_view' => '', 309 'olc_panel' => '', 310 'olc_map' => '' 311 ); 310 312 311 313 if( isset( $atts['map_style'] ) && !empty( $atts['map_style'] ) ){ 312 $default_attr['custom_style'] = ''; 314 $default_attr['custom_style'] = ''; 313 315 } 314 316 … … 320 322 321 323 if( !empty( $olcMapAttr['map_layout'] ) ){ 322 include 'template-parts/layout/office-locator-'.$olcMapAttr['map_layout'].'.php';324 include 'template-parts/layout/office-locator-'.$olcMapAttr['map_layout'].'.php'; 323 325 } 324 326 … … 326 328 } 327 329 328 /** 329 * Adding Office Locator Class. 330 * 331 * @since 1.0.0 332 */ 333 public function add_office_locator_classes() { 334 $classes[] = 'store-locater'; 335 336 return $classes; 337 } 330 /** 331 * Adding Office Locator Class. 332 * 333 * @since 1.0.0 334 */ 335 public function add_office_locator_classes( $classes ) { 336 $classes[] = 'store-locater'; 337 return $classes; 338 } 338 339 } -
office-locator/trunk/public/css/public.css
r3009822 r3195443 544 544 height: 100%; 545 545 } 546 546 .olc-layout .olc-storelocator-filter.office-category-layout .olc-location-search > .olc-input.olc-location-search-box { 547 width: 50%; 548 } 547 549 /* Fix for Google map More info details*/ 548 550 … … 730 732 width: 420px; 731 733 } 734 .olc-layout.layout-5 .olc-results .olc-input.olc-input-category,.olc-layout.layout-6 .olc-results .olc-input.olc-input-category { 735 flex-direction: column; 736 flex-grow: 1; 737 } 738 739 .olc-layout.layout-5 .olc-results .olc-input.olc-input,.olc-layout.layout-6 .olc-results .olc-input.olc-input { 740 width: calc( 50% - 12.5px ); 741 } 742 743 .olc-layout.layout-5 .olc-results,.olc-layout.layout-6 .olc-results { 744 flex-wrap: wrap; 745 } 746 .olc-layout.layout-5 .olc-storelocator-filter.office-category-layout .olc-location-search > .olc-input.olc-location-search-box,.olc-layout.layout-6 .olc-storelocator-filter.office-category-layout .olc-location-search > .olc-input.olc-location-search-box{ 747 width:100%; 748 } 749 732 750 /*====================================== 733 751 end---olc-map-layout-5 css … … 851 869 /*<------------ media css ----------->*/ 852 870 @media only screen and (max-width: 991px) { 871 .olc-layout .olc-storelocator-filter.office-category-layout .olc-location-search > .olc-input.olc-location-search-box { 872 width: 100%; 873 } 853 874 .office-panel { 854 875 width: 400px; … … 903 924 left: -8px; 904 925 } 926 .olc-layout .olc-results .olc-input.olc-input { 927 width: calc( 50% - 7.5px ) !important; 928 } 929 .olc-layout .olc-results { 930 flex-wrap: wrap; 931 } 932 .olc-layout .olc-results .olc-input.olc-input-category { 933 flex-direction: column; 934 flex-grow: 1; 935 } 936 937 .olc-layout .olc-storelocator-filter .olc-location-search .olc-results { 938 gap: 15px; 939 row-gap: 15px; 940 width: 100%; 941 } 942 .olc-layout form.olc-storelocator-filter .olc-input .olc-submit-btn{ 943 margin-top: 0 !important; 944 } 945 .olc-layout .olc-storelocator-filter .olc-location-search { 946 gap: 15px; 947 } 948 905 949 } 906 950 907 951 @media only screen and (max-width: 575px) { 952 953 908 954 .olc-layout{ 909 955 padding: 8px; … … 925 971 flex-wrap: wrap; 926 972 } 927 .olc-layout .olc-storelocator-filter .olc-location-search .olc-results { 928 gap: 15px; 929 row-gap: 15px; 930 width: 100%; 931 } 973 932 974 .olc-layout .olc-col-1 form.olc-storelocator-filter .olc-input .olc-submit-btn{ 933 975 margin-top: 0; -
office-locator/trunk/public/includes/office-locator-ajax-functions.php
r3009822 r3195443 63 63 $distance_unit = ( $olc_distance_unit == 'km' ) ? 6371 : 3959; 64 64 $olc_where = ''; 65 $olc_category = isset($_POST['olc_category']) ? sanitize_text_field( $_POST['olc_category'] ) : 0; 66 if ( $olc_category != 0 ) { 67 $cat_filter = "INNER JOIN $wpdb->term_relationships AS term_rel ON p.ID = term_rel.object_id 68 INNER JOIN $wpdb->term_taxonomy AS term_tax ON term_rel.term_taxonomy_id = term_tax.term_taxonomy_id 69 AND term_tax.taxonomy = 'office_category' 70 AND term_tax.term_id IN (" .$olc_category .")"; 71 }else { 72 $cat_filter = ''; 73 } 74 65 75 if( $olc_office_ids ){ 66 76 $olc_where = " AND p.ID IN ( ". $olc_office_ids ." ) "; … … 68 78 69 79 $option_name = str_replace( '-', '_', $this->plugin_name ) .'_permalink'; 70 $general_data = get_option( $option_name ); 80 $general_data = get_option( $option_name ); 81 82 $map_option_name = str_replace( '-', '_', $this->plugin_name ) .'_map'; 83 $map_general_data = get_option( $map_option_name ); 71 84 72 85 $store_sql = "SELECT p.ID, ( ".$distance_unit." * acos( cos( radians(".$olc_latitude.") ) * cos( radians( olc_lat.meta_value ) ) * cos( radians( olc_lng.meta_value ) - radians(".$olc_longitude.") ) + sin( radians(".$olc_latitude.") ) * sin( radians( olc_lat.meta_value ) ) ) ) AS calculated_distance FROM ".$wpdb->posts." as … … 74 87 INNER JOIN ".$wpdb->postmeta." AS olc_lat ON olc_lat.post_id = p.ID AND olc_lat.meta_key = 'office_latitude' 75 88 INNER JOIN ".$wpdb->postmeta." AS olc_lng ON olc_lng.post_id = p.ID AND olc_lng.meta_key = 'office_longitude' 89 $cat_filter 76 90 WHERE p.post_type = 'offices' 77 91 AND p.post_status = 'publish' … … 89 103 } 90 104 } 91 $office_address = $this->set_office_store_html( $office_address, $olc_layout, $general_data );105 $office_address = $this->set_office_store_html( $office_address, $olc_layout, $general_data, $map_general_data ); 92 106 } 93 107 wp_send_json( $office_address ); 94 95 108 } 96 109 -
office-locator/trunk/public/template-parts/layout/global/office-locator-filter.php
r3009822 r3195443 1 <form class="olc-storelocator-filter <?php echo esc_attr( $class ); ?> " method="post">1 <form class="olc-storelocator-filter <?php echo esc_attr( $class ); ?> <?php echo (isset($olcMapAttr['office_category_filter']) && $olcMapAttr['office_category_filter'] == 'yes') ? "office-category-layout": ""; ?>" method="post"> 2 2 <div class="olc-location-search"> 3 <div class="olc-input ">3 <div class="olc-input olc-location-search-box"> 4 4 <label for="olc-location-search-input"><?php echo __( 'Office Locations', 'office-locator' ); ?></label> 5 5 <input class="olc-location-search-input" name="location_search" placeholder="<?php echo __( 'Enter office locations', 'office-locator' ); ?>" autocomplete="off"> 6 6 </div> 7 7 <div class="olc-results"> 8 <div class="olc-input ">8 <div class="olc-input olc-input-radius"> 9 9 <label for="olc_radius"><?php echo __( 'Office Radius', 'office-locator' ); ?></label> 10 10 <select id="olc_radius" name="olc_radius" class="olc_radius"> … … 22 22 </select> 23 23 </div> 24 <div class="olc-input ">24 <div class="olc-input olc-input-results"> 25 25 <label for="olc_results"><?php echo __( 'Office Results', 'office-locator' ); ?></label> 26 26 <select class="olc_results" id="olc_results" name="olc_results"> … … 36 36 </select> 37 37 </div> 38 <?php 39 if( isset($olcMapAttr['office_category_filter']) && $olcMapAttr['office_category_filter'] == 'yes'){ 40 ?> 41 <div class="olc-input olc-input-category"> 42 <label for="olc_category"><?php _e( 'Office Category', 'office-locator' ); ?></label> 43 <select class="olc_category" name="olc_category"> 44 <option value="0"><?php _e( 'Select Category', 'office-locator' ); ?></option> 45 <?php 46 $officecategoryList = get_terms([ 47 'taxonomy' => 'office_category', 48 'hide_empty' => false, 49 ]); 50 if( $officecategoryList ){ 51 ?> 52 <?php 53 foreach ( $officecategoryList as $officecategory ) { 54 ?> 55 <option value="<?php echo esc_attr($officecategory->term_id ); ?>" <?php echo ( ( $officecategory->term_id == $olcMapAttr['map_office_category'] ) ? 'selected' : '' ); ?>><?php echo esc_html( $officecategory->name ); ?></option> 56 <?php 57 } 58 } 59 ?> 60 </select> 61 </div> 62 <?php } ?> 38 63 </div> 39 64 <div class="olc-input">
Note: See TracChangeset
for help on using the changeset viewer.