Changeset 2191985
- Timestamp:
- 11/13/2019 05:42:15 PM (6 years ago)
- Location:
- locatoraid/trunk
- Files:
-
- 3 added
- 15 edited
-
config/_common.php (modified) (1 diff)
-
happ2/hsystem/database/wordpress/engine.php (modified) (1 diff)
-
happ2/hsystem/parts/profiler.php (modified) (1 diff)
-
happ2/modules/maps_google/assets/js/gmaps.js (modified) (1 diff)
-
locatoraid.php (modified) (2 diffs)
-
modules/front/assets/js/front.js (modified) (11 diffs)
-
modules/front/view_form.php (modified) (2 diffs)
-
modules/front/view_list.php (modified) (3 diffs)
-
modules/front/view_map.php (modified) (2 diffs)
-
modules/geocode/view.php (modified) (1 diff)
-
modules/geocodebulk/view.php (modified) (1 diff)
-
modules/locations.coordinates/index/view.php (modified) (1 diff)
-
modules/locations/bulk (added)
-
modules/locations/bulk/controller.php (added)
-
modules/locations/bulk/form.php (added)
-
modules/locations/index/view.php (modified) (5 diffs)
-
modules/search/controller.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
locatoraid/trunk/config/_common.php
r2143317 r2191985 1 1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly 2 $config['app_version'] = '3.6. 7';2 $config['app_version'] = '3.6.8'; 3 3 // $config['dbprefix_version'] = 'v1'; 4 4 -
locatoraid/trunk/happ2/hsystem/database/wordpress/engine.php
r1807089 r2191985 22 22 23 23 if( $is_select ){ 24 return$this->wpdb->get_results( $sql, ARRAY_A );24 $return = $this->wpdb->get_results( $sql, ARRAY_A ); 25 25 } 26 26 else { 27 27 // echo "NOT SELECT: '$sql'<br>"; 28 28 $return = $this->wpdb->query( $sql ); 29 return $return;30 29 } 30 31 return $return; 31 32 } 32 33 -
locatoraid/trunk/happ2/hsystem/parts/profiler.php
r1925696 r2191985 162 162 163 163 $hide_queries = (count($db->queries()) > $this->_query_toggle_count) ? ' display:none' : ''; 164 $hide_queries = ''; 164 165 165 166 $show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.'profiler_section_hide'.'\'?\''.'profiler_section_show'.'\':\''.'profiler_section_hide'.'\';">'.'profiler_section_hide'.'</span>)'; -
locatoraid/trunk/happ2/modules/maps_google/assets/js/gmaps.js
r2027391 r2191985 46 46 var valid_options = hc2_try_parse_json( more_options ); 47 47 if( valid_options ){ 48 console.log( valid_options );48 // console.log( valid_options ); 49 49 map.setOptions( valid_options ); 50 50 } -
locatoraid/trunk/locatoraid.php
r2143317 r2191985 4 4 Plugin URI: https://www.locatoraid.com/ 5 5 Description: Store locator plugin 6 Version: 3.6. 76 Version: 3.6.8 7 7 Author: hitcode.com 8 8 Author URI: https://www.locatoraid.com/ … … 12 12 13 13 if( ! defined('LC3_VERSION') ){ 14 define( 'LC3_VERSION', 36 7);14 define( 'LC3_VERSION', 368 ); 15 15 } 16 16 -
locatoraid/trunk/modules/front/assets/js/front.js
r2127805 r2191985 1 1 // (function($) { 2 2 var lctr = {}; 3 4 var locatoraidEvent = function( eventName, payload ){ 5 var event; 6 7 if( document.createEvent ){ 8 event = document.createEvent("HTMLEvents"); 9 event.initEvent( eventName, true, true ); 10 } 11 else { 12 event = document.createEventObject(); 13 event.eventType = eventName; 14 } 15 event.eventName = eventName; 16 event.payload = payload; 17 18 if( document.createEvent ){ 19 document.dispatchEvent( event ); 20 } 21 else { 22 document.fireEvent( "on" + event.eventType, event ); 23 } 24 } 25 3 26 var locatoraidFront = (function($) { 4 27 var self = this; … … 15 38 this.notify = function( what, payload ) 16 39 { 40 new locatoraidEvent( 'locatoraid-' + what, payload ); 17 41 for( var ii = 0; ii < observers.length; ii++ ){ 18 42 observers[ii].trigger( what, payload ); … … 21 45 } 22 46 23 this.form = function( html_id ) 47 // document.addEventListener('DOMContentLoaded', function(){ 48 // jQuery('#hclc_search_form').on( 'submit', function(){ 49 // var searchString = jQuery(this).find('input[name=hc-search]').val(); 50 // console.log( searchString ); 51 // }); 52 // }); 53 54 55 // this.form = function( html_id ) 56 this.form = function( $this ) 24 57 { 58 var html_id = $this.attr('id'); 59 // alert( html_id ); 60 // var $this = jQuery( '#' + html_id ); 61 25 62 var self = this; 26 63 this.observers = new observers; 27 var $this = jQuery( '#' + html_id );28 64 29 65 this.next_links = []; … … 135 171 self.observers.notify( 'get-results', {} ); 136 172 hc2_unset_loader( $this ); 173 174 137 175 } 138 176 } … … 330 368 } 331 369 332 this.list = function( html_id ) 370 // this.list = function( html_id ) 371 this.list = function( $this ) 333 372 { 373 var html_id = $this.attr('id'); 374 // var $this = jQuery( '#' + html_id ); 334 375 var self = this; 335 376 this.observers = new observers; 336 var $this = jQuery( '#' + html_id );337 377 338 378 this.params = { … … 444 484 445 485 // var $this_loc_view = jQuery( this_loc_view ); 446 var $this _loc_view = jQuery('<div>').html( this_loc_view );447 $this _loc_view486 var $thisLocView = jQuery('<div>').html( this_loc_view ); 487 $thisLocView 448 488 .data( 'location-id', this_loc['id'] ) 449 489 ; 450 490 451 self.entries[ this_loc['id'] ] = $this _loc_view;452 $this.append( $this _loc_view );453 454 $this _loc_view.on('click', function(e){491 self.entries[ this_loc['id'] ] = $thisLocView; 492 $this.append( $thisLocView ); 493 494 $thisLocView.on('click', function(e){ 455 495 var location_id = jQuery(this).data('location-id'); 456 496 self.highlight( location_id ); 457 497 self.observers.notify( 'select-location', location_id ); 458 498 }); 499 500 $thisLocView.render = function(){ 501 }; 502 503 new locatoraidEvent( 'locatoraid-render-in-list', $thisLocView ); 459 504 } 460 505 } … … 506 551 } 507 552 508 this.map = function( html_id ) 553 this.map = function( $this ) 554 // this.map = function( html_id ) 509 555 { 556 var html_id = $this.attr('id'); 557 // var $this = jQuery( '#' + html_id ); 510 558 var self = this; 511 559 this.observers = new observers; 512 var $this = jQuery( '#' + html_id );513 560 $this.hide(); 514 561 … … 772 819 var templateVars = thisLoc; 773 820 var thisLocView = template.render( templateVars ); 774 thisLocsView.push( '<div>' + thisLocView + '</div>' ); 775 } 776 777 thisLocsView = thisLocsView.join(''); 778 this.infowindow.setContent( thisLocsView ); 821 822 var $thisLocView = jQuery('<div>').html( thisLocView ); 823 $thisLocView 824 .data( 'location-id', thisThisId ) 825 ; 826 827 $thisLocView.render = function(){ 828 var locsView = []; 829 for( var jj = 0; jj < thisLocsView.length; jj++ ){ 830 locsView.push( thisLocsView[jj].html() ); 831 } 832 locsView = locsView.join(''); 833 self.infowindow.setContent( locsView ); 834 }; 835 836 thisLocsView.push( $thisLocView ); 837 // thisLocsView.push( thisLocView ); 838 new locatoraidEvent( 'locatoraid-render-on-map', $thisLocView ); 839 } 840 841 // thisLocsView = thisLocsView.join(''); 842 // this.infowindow.setContent( thisLocsView ); 843 $thisLocView.render(); 779 844 this.infowindow.open( self.map, thisMarker ); 780 845 } … … 785 850 var thisLocView = template.render( templateVars ); 786 851 787 this.infowindow.setContent( thisLocView ); 852 var $thisLocView = jQuery('<div>').html( thisLocView ); 853 $thisLocView 854 .data( 'location-id', thisId ) 855 ; 856 857 $thisLocView.render = function(){ 858 self.infowindow.setContent( $thisLocView.html() ); 859 } 860 861 $thisLocView.render(); 862 863 // this.infowindow.setContent( $thisLocView ); 864 // this.infowindow.setContent( thisLocView ); 865 788 866 this.infowindow.open( self.map, thisMarker ); 867 new locatoraidEvent( 'locatoraid-render-on-map', $thisLocView ); 789 868 } 790 869 } … … 793 872 jQuery(document).on('hc2-gmaps-loaded', function() 794 873 { 795 var form = new self.form( 'hclc_search_form' ); 796 var list = new self.list( 'hclc_list' ); 797 var map = new self.map( 'hclc_map' ); 798 799 form.observers.add( list ); 800 form.observers.add( map ); 801 802 list.observers.add( map ); 803 map.observers.add( list ); 804 805 var $map = jQuery( '#hclc_map' ); 806 var start_map_address = $map.data('start-address'); 807 if( start_map_address ){ 808 var start_map_zoom = $map.data('start-zoom'); 809 if( ! start_map_zoom ){ 810 start_map_zoom = 5; 811 } 812 map.map_start( start_map_address, start_map_zoom ); 874 var ii = 0; 875 var forms = jQuery( '.hclc_search_form_class' ); 876 var lists = jQuery( '.hclc_list_class' ); 877 var maps = jQuery( '.hclc_map_class' ); 878 879 for( ii = 0; ii < forms.length; ii++ ){ 880 var form = new self.form( jQuery(forms[ii]) ); 881 var list = new self.list( jQuery(lists[ii]) ); 882 var map = new self.map( jQuery(maps[ii]) ); 883 884 form.observers.add( list ); 885 form.observers.add( map ); 886 887 list.observers.add( map ); 888 map.observers.add( list ); 889 890 var $map = jQuery( jQuery(maps[ii]) ); 891 var start_map_address = $map.data('start-address'); 892 if( start_map_address ){ 893 var start_map_zoom = $map.data('start-zoom'); 894 if( ! start_map_zoom ){ 895 start_map_zoom = 5; 896 } 897 map.map_start( start_map_address, start_map_zoom ); 898 } 813 899 } 814 900 }); … … 824 910 // }); 825 911 // }); 912 913 // document.addEventListener('locatoraid-get-results', function(event){ 914 // var results = event.payload.hasOwnProperty('results') ? event.payload.results : []; 915 // alert( results.length ); 916 // console.log( results ); 917 // }); -
locatoraid/trunk/modules/front/view_form.php
r2143317 r2191985 41 41 } 42 42 43 $search_form_id = 'hclc_search_form'; 43 $search_form_id = 'hclc_search_form' . '_' . rand( 100, 999 ); 44 $search_form_class = 'hclc_search_form_class'; 44 45 45 46 $link_params = array( … … 110 111 'action' => $link, 111 112 'data-radius-link' => $radius_link, 112 'class' => 'hc-mb2 ',113 'class' => 'hc-mb2 ' . $search_form_class, 113 114 ); 114 115 if( isset($params['start']) && ($params['start'] != 'no') ){ -
locatoraid/trunk/modules/front/view_list.php
r2143317 r2191985 5 5 { 6 6 $style = array_key_exists('list-style', $params) ? $params['list-style'] : NULL; 7 $holder_id = 'hclc_list'; 7 $holder_id = 'hclc_list' . '_' . rand( 100, 999 ); 8 $holder_class = 'hclc_list_class'; 8 9 $div = $this->app->make('/html/element')->tag('div') 9 10 ->add_attr('id', $holder_id) 11 ->add_attr('class', $holder_class) 10 12 ->add_attr('class', 'hc-mb3-xs') 11 13 ->add_attr('class', 'hc-relative') … … 26 28 $template = $this->app->make('/html/element')->tag('script') 27 29 ->add_attr('type', 'text/template') 28 ->add_attr('id', 'hclc_list_template')30 ->add_attr('id', $holder_id . '_template') 29 31 ->add( $template ) 30 32 ; … … 41 43 $no_results_template = $this->app->make('/html/element')->tag('script') 42 44 ->add_attr('type', 'text/template') 43 ->add_attr('id', 'hclc_list_template_no_results')45 ->add_attr('id', $holder_id . '_template_no_results') 44 46 ->add( $no_results_template ) 45 47 ; -
locatoraid/trunk/modules/front/view_map.php
r1985774 r2191985 5 5 { 6 6 $style = array_key_exists('map-style', $params) ? $params['map-style'] : NULL; 7 $map_id = 'hclc_map'; 7 $map_id = 'hclc_map' . '_' . rand( 100, 999 ); 8 $map_class = 'hclc_map_class'; 8 9 $div = $this->app->make('/html/element')->tag('div') 9 10 ->add_attr('id', $map_id) 11 ->add_attr('class', $map_class) 10 12 ->add_attr('class', 'hc-mb3-xs') 11 13 ->add_attr('class', 'hc-border') … … 37 39 $template = $this->app->make('/html/element')->tag('script') 38 40 ->add_attr('type', 'text/template') 39 ->add_attr('id', 'hclc_map_template')41 ->add_attr('id', $map_id . '_template') 40 42 ->add( $template ) 41 43 ; -
locatoraid/trunk/modules/geocode/view.php
r1726376 r2191985 30 30 31 31 $map_id = 'hclc_map'; 32 $map_class = 'hclc_map_class'; 32 33 $map = $this->app->make('/html/element')->tag('div') 33 34 ->add_attr('id', $map_id) 35 ->add_attr('class', $map_class) 34 36 ->add_attr('style', 'height: 15em;') 35 37 -
locatoraid/trunk/modules/geocodebulk/view.php
r1726376 r2191985 19 19 20 20 $map_id = 'hclc_map'; 21 $map_class = 'hclc_map_class'; 21 22 $map = $this->app->make('/html/element')->tag('div') 22 23 ->add_attr('id', $map_id) 24 ->add_attr('class', $map_class) 23 25 ->add_attr('class', 'hc-p1') 24 26 ->add_attr('class', 'hc-b1') -
locatoraid/trunk/modules/locations.coordinates/index/view.php
r1740734 r2191985 30 30 // map 31 31 $map_id = 'hclc_map'; 32 $map_class = 'hclc_map_class'; 32 33 $map = $this->app->make('/html/element')->tag('div') 33 34 ->add_attr('id', $map_id) 35 ->add_attr('class', $map_class) 34 36 ->add_attr('class', 'hc-border') 35 37 ; -
locatoraid/trunk/modules/locations/index/view.php
r1783284 r2191985 32 32 } 33 33 34 $search_view = $this->app->make('/modelsearch/view'); 35 $submenu 36 ->add( $search_view->render($search) ) 37 ; 34 if( $rows ){ 35 $helper = $this->app->make('/form/helper'); 36 $bulk_form = $this->bulk_form(); 37 $submenu 38 ->add( $bulk_form ) 39 ; 40 } 38 41 39 42 $out … … 64 67 } 65 68 69 // add bulk form 70 if( $rows ){ 71 // $helper = $this->app->make('/form/helper'); 72 // $bulk_form = $this->bulk_form(); 73 74 // $out = $this->app->make('/html/list') 75 // ->set_gutter(1) 76 // ->add( $bulk_form ) 77 // ->add( $out ) 78 // ; 79 80 $link = $this->app->make('/http/uri') 81 ->url('/locations/bulk') 82 ; 83 $out = $helper 84 ->render( array('action' => $link) ) 85 ->add( $out ) 86 ; 87 } 88 89 $search_view = $this->app->make('/modelsearch/view'); 90 91 $out = $this->app->make('/html/list') 92 ->set_gutter(1) 93 ->add( $search_view ) 94 ->add( $out ) 95 ; 96 97 // $submenu 98 // ->add( $search_view->render($search) ) 99 // ; 100 66 101 return $out; 67 102 } 68 103 104 public function bulk_form() 105 { 106 $form = $this->app->make('/locations/bulk/form'); 107 108 $helper = $this->app->make('/form/helper'); 109 $inputs_view = $helper->prepare_render( $form->inputs() ); 110 111 $btn = $this->app->make('/html/element')->tag('input') 112 ->add_attr('type', 'submit') 113 ->add_attr('title', HCM::__('Apply') ) 114 ->add_attr('value', HCM::__('Apply') ) 115 ->add_attr('class', 'hc-theme-btn-submit') 116 ; 117 118 $out = $this->app->make('/html/list-inline') 119 ->set_gutter(1) 120 ->add( $inputs_view['action'] ) 121 ->add( $btn ) 122 ; 123 124 return $out; 125 } 126 69 127 public function header() 70 128 { 129 $title_view = HCM::__('Location'); 130 131 // add checkbox 132 $checkbox = $this->app->make('/form/checkbox') 133 ->render('') 134 ->add_attr('class', 'hcj2-all-checker') 135 ->add_attr('data-collect', 'hc-id[]') 136 ; 137 138 $title_view = $this->app->make('/html/list-inline') 139 ->set_gutter(1) 140 ->add( $checkbox ) 141 ->add( $title_view ) 142 ; 143 71 144 $return = array( 72 'title' => HCM::__('Location'), 145 // 'id' => $checkbox, 146 'title' => $title_view, 73 147 // 'address' => HCM::__('Address'), 74 148 ); … … 98 172 ->add_attr('class', 'hc-fs4') 99 173 ->add_attr('class', 'hc-decoration-none') 100 ; 101 102 $return['id'] = $e['id']; 174 ->add_attr('title', htmlspecialchars($title_view)) 175 ; 176 177 $return['id'] = $e['id']; 103 178 $id_view = $this->app->make('/html/element')->tag('span') 104 179 ->add_attr('class', 'hc-fs2') … … 109 184 $address_view = $p->present_address( $e ); 110 185 186 // add checkbox 187 $checkbox = $this->app->make('/form/checkbox') 188 ->set_value( $e['id'] ) 189 ->render( 'id[]' ) 190 ; 191 192 $title_view = $this->app->make('/html/list-inline') 193 ->set_gutter(1) 194 ->add( $checkbox ) 195 ->add( $title_view ) 196 ; 197 111 198 $title_view = $this->app->make('/html/list') 112 199 ->set_gutter(0) … … 116 203 ; 117 204 118 $return['id_view'] = $id_view; 205 // add checkbox 206 // $checkbox = $this->app->make('/form/checkbox') 207 // ->set_value( $e['id'] ) 208 // ->render( 'id[]' ) 209 // ; 210 211 // $title_view = $this->app->make('/html/list-inline') 212 // ->set_gutter(1) 213 // ->add( $checkbox ) 214 // ->add( $title_view ) 215 // ; 216 217 $title_view = $this->app->make('/html/element')->tag('div') 218 ->add( $title_view ) 219 ->add_attr('class', 'hc-nowrap') 220 ; 221 222 // $return['id'] = $checkbox; 223 $return['id_view'] = $id_view; 119 224 $return['title'] = $title_view; 120 225 $return['address'] = $address_view; -
locatoraid/trunk/modules/search/controller.php
r2127805 r2191985 69 69 $command_args[] = array('priority', '<>', '-1'); 70 70 } 71 72 $command_args['osearch'] = array('osearch', $search);73 71 $command_args[] = array('with', '-all-'); 72 74 73 if( $id ){ 75 74 $command_args[] = $id; … … 119 118 } 120 119 121 $ match_results = NULL;120 $exact_results = array(); 122 121 if( strlen($search) ){ 123 $match_args = $command_args; 124 // $match_args[] = array('name', '=', $search); 125 $match_args[] = array('with', '-all-'); 126 $match_args[] = array('search', $search); 127 128 $match_results = $command->execute( $match_args ); 122 $exact_search_in = array( 'name', 'zip', 'state', 'city', 'country' ); 123 foreach( $exact_search_in as $search_in ){ 124 $exact_args = $command_args; 125 $exact_args[] = array($search_in, '=', $search); 126 $exact_args[] = array('with', '-all-'); 127 $this_exact_results = $command->execute( $exact_args ); 128 if( $this_exact_results ){ 129 $exact_results = $exact_results + $this_exact_results; 130 } 131 } 132 } 133 134 $command_args['osearch'] = array('osearch', $search); 135 136 if( ! $exact_results ){ 137 $match_results = NULL; 138 if( strlen($search) ){ 139 $match_args = $command_args; 140 // $match_args[] = array('name', '=', $search); 141 $match_args[] = array('with', '-all-'); 142 $match_args[] = array('search', $search); 143 144 $match_results = $command->execute( $match_args ); 145 } 129 146 } 130 147 … … 134 151 } 135 152 136 if( $match_results ){ 153 if( $exact_results ){ 154 $results = $exact_results; 155 } 156 elseif( $match_results ){ 137 157 $results = $match_results; 138 158 } … … 185 205 $results = $results + $geoResults; 186 206 187 if( $results && $limit && ($limit == 1) ){ 188 $results = array( $results['id'] => $results ); 207 if( $results && $limit ){ 208 if( $limit == 1 ){ 209 $results = array( $results['id'] => $results ); 210 } 211 else { 212 if( $limit < count($results) ){ 213 $results = array_slice( $results, 0, $limit, TRUE ); 214 } 215 } 189 216 } 190 217 -
locatoraid/trunk/readme.txt
r2143317 r2191985 85 85 == Changelog == 86 86 87 = 3.6.8 = 88 * BUG: the "limit" shortcode parameter may have worked incorrectly. 89 * BUG: an attempt to fix an error when custom fields module was not properly installed itself. 90 * The upload file can now include id column (Pro Version). 91 * Added bulk actions for locations in the admin area. 92 87 93 = 3.6.7 = 88 94 * Useful for multi language websites: front end text configuration is now translation ready. For example, enter "Search" in the settings form, then translate it in the language file.
Note: See TracChangeset
for help on using the changeset viewer.