Plugin Directory

Changeset 2191985


Ignore:
Timestamp:
11/13/2019 05:42:15 PM (6 years ago)
Author:
hitcode
Message:

3.6.8

Location:
locatoraid/trunk
Files:
3 added
15 edited

Legend:

Unmodified
Added
Removed
  • locatoraid/trunk/config/_common.php

    r2143317 r2191985  
    11<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
    2 $config['app_version'] = '3.6.7';
     2$config['app_version'] = '3.6.8';
    33// $config['dbprefix_version'] = 'v1';
    44
  • locatoraid/trunk/happ2/hsystem/database/wordpress/engine.php

    r1807089 r2191985  
    2222
    2323        if( $is_select ){
    24             return $this->wpdb->get_results( $sql, ARRAY_A );
     24            $return = $this->wpdb->get_results( $sql, ARRAY_A );
    2525        }
    2626        else {
    2727            // echo "NOT SELECT: '$sql'<br>";
    2828            $return = $this->wpdb->query( $sql );
    29             return $return;
    3029        }
     30
     31        return $return;
    3132    }
    3233
  • locatoraid/trunk/happ2/hsystem/parts/profiler.php

    r1925696 r2191985  
    162162
    163163            $hide_queries = (count($db->queries()) > $this->_query_toggle_count) ? ' display:none' : '';
     164            $hide_queries = '';
    164165
    165166            $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  
    4646        var valid_options = hc2_try_parse_json( more_options );
    4747        if( valid_options ){
    48             console.log( valid_options );
     48            // console.log( valid_options );
    4949            map.setOptions( valid_options );
    5050        }
  • locatoraid/trunk/locatoraid.php

    r2143317 r2191985  
    44Plugin URI: https://www.locatoraid.com/
    55Description: Store locator plugin
    6 Version: 3.6.7
     6Version: 3.6.8
    77Author: hitcode.com
    88Author URI: https://www.locatoraid.com/
     
    1212
    1313if( ! defined('LC3_VERSION') ){
    14     define( 'LC3_VERSION', 367 );
     14    define( 'LC3_VERSION', 368 );
    1515}
    1616
  • locatoraid/trunk/modules/front/assets/js/front.js

    r2127805 r2191985  
    11// (function($) {
    22var lctr = {};
     3
     4var 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
    326var locatoraidFront = (function($) {
    427var self = this;
     
    1538    this.notify = function( what, payload )
    1639    {
     40        new locatoraidEvent( 'locatoraid-' + what, payload );
    1741        for( var ii = 0; ii < observers.length; ii++ ){
    1842            observers[ii].trigger( what, payload );
     
    2145}
    2246
    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 )
     56this.form = function( $this )
    2457{
     58    var html_id = $this.attr('id');
     59    // alert( html_id );
     60    // var $this = jQuery( '#' + html_id );
     61
    2562    var self = this;
    2663    this.observers = new observers;
    27     var $this = jQuery( '#' + html_id );
    2864
    2965    this.next_links = [];
     
    135171                    self.observers.notify( 'get-results', {} );
    136172                    hc2_unset_loader( $this );
     173
     174
    137175                }
    138176            }
     
    330368}
    331369
    332 this.list = function( html_id )
     370// this.list = function( html_id )
     371this.list = function( $this )
    333372{
     373    var html_id = $this.attr('id');
     374    // var $this = jQuery( '#' + html_id );
    334375    var self = this;
    335376    this.observers = new observers;
    336     var $this = jQuery( '#' + html_id );
    337377
    338378    this.params = {
     
    444484
    445485                // var $this_loc_view = jQuery( this_loc_view );
    446                 var $this_loc_view = jQuery('<div>').html( this_loc_view );
    447                 $this_loc_view
     486                var $thisLocView = jQuery('<div>').html( this_loc_view );
     487                $thisLocView
    448488                    .data( 'location-id', this_loc['id'] )
    449489                    ;
    450490
    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){
    455495                    var location_id = jQuery(this).data('location-id');
    456496                    self.highlight( location_id );
    457497                    self.observers.notify( 'select-location', location_id );
    458498                });
     499
     500                $thisLocView.render = function(){
     501                };
     502
     503                new locatoraidEvent( 'locatoraid-render-in-list', $thisLocView );
    459504            }
    460505        }
     
    506551}
    507552
    508 this.map = function( html_id )
     553this.map = function( $this )
     554// this.map = function( html_id )
    509555{
     556    var html_id = $this.attr('id');
     557    // var $this = jQuery( '#' + html_id );
    510558    var self = this;
    511559    this.observers = new observers;
    512     var $this = jQuery( '#' + html_id );
    513560    $this.hide();
    514561
     
    772819                var templateVars = thisLoc;
    773820                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();
    779844            this.infowindow.open( self.map, thisMarker );
    780845        }
     
    785850            var thisLocView = template.render( templateVars );
    786851
    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
    788866            this.infowindow.open( self.map, thisMarker );
     867            new locatoraidEvent( 'locatoraid-render-on-map', $thisLocView );
    789868        }
    790869    }
     
    793872jQuery(document).on('hc2-gmaps-loaded', function()
    794873{
    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        }
    813899    }
    814900});
     
    824910    // });
    825911// });
     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  
    4141        }
    4242
    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';
    4445
    4546        $link_params = array(
     
    110111            'action'            => $link,
    111112            'data-radius-link'  => $radius_link,
    112             'class'             => 'hc-mb2',
     113            'class'             => 'hc-mb2 ' . $search_form_class,
    113114            );
    114115        if( isset($params['start']) && ($params['start'] != 'no') ){
  • locatoraid/trunk/modules/front/view_list.php

    r2143317 r2191985  
    55    {
    66        $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';
    89        $div = $this->app->make('/html/element')->tag('div')
    910            ->add_attr('id', $holder_id)
     11            ->add_attr('class', $holder_class)
    1012            ->add_attr('class', 'hc-mb3-xs')
    1113            ->add_attr('class', 'hc-relative')
     
    2628        $template = $this->app->make('/html/element')->tag('script')
    2729            ->add_attr('type', 'text/template')
    28             ->add_attr('id', 'hclc_list_template')
     30            ->add_attr('id', $holder_id . '_template')
    2931            ->add( $template )
    3032            ;
     
    4143        $no_results_template = $this->app->make('/html/element')->tag('script')
    4244            ->add_attr('type', 'text/template')
    43             ->add_attr('id', 'hclc_list_template_no_results')
     45            ->add_attr('id', $holder_id . '_template_no_results')
    4446            ->add( $no_results_template )
    4547            ;
  • locatoraid/trunk/modules/front/view_map.php

    r1985774 r2191985  
    55    {
    66        $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';
    89        $div = $this->app->make('/html/element')->tag('div')
    910            ->add_attr('id', $map_id)
     11            ->add_attr('class', $map_class)
    1012            ->add_attr('class', 'hc-mb3-xs')
    1113            ->add_attr('class', 'hc-border')
     
    3739        $template = $this->app->make('/html/element')->tag('script')
    3840            ->add_attr('type', 'text/template')
    39             ->add_attr('id', 'hclc_map_template')
     41            ->add_attr('id', $map_id . '_template')
    4042            ->add( $template )
    4143            ;
  • locatoraid/trunk/modules/geocode/view.php

    r1726376 r2191985  
    3030
    3131        $map_id = 'hclc_map';
     32        $map_class = 'hclc_map_class';
    3233        $map = $this->app->make('/html/element')->tag('div')
    3334            ->add_attr('id', $map_id)
     35            ->add_attr('class', $map_class)
    3436            ->add_attr('style', 'height: 15em;')
    3537
  • locatoraid/trunk/modules/geocodebulk/view.php

    r1726376 r2191985  
    1919
    2020            $map_id = 'hclc_map';
     21            $map_class = 'hclc_map_class';
    2122            $map = $this->app->make('/html/element')->tag('div')
    2223                ->add_attr('id', $map_id)
     24                ->add_attr('class', $map_class)
    2325                ->add_attr('class', 'hc-p1')
    2426                ->add_attr('class', 'hc-b1')
  • locatoraid/trunk/modules/locations.coordinates/index/view.php

    r1740734 r2191985  
    3030    // map
    3131        $map_id = 'hclc_map';
     32        $map_class = 'hclc_map_class';
    3233        $map = $this->app->make('/html/element')->tag('div')
    3334            ->add_attr('id', $map_id)
     35            ->add_attr('class', $map_class)
    3436            ->add_attr('class', 'hc-border')
    3537            ;
  • locatoraid/trunk/modules/locations/index/view.php

    r1783284 r2191985  
    3232        }
    3333
    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        }
    3841
    3942        $out
     
    6467        }
    6568
     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
    66101        return $out;
    67102    }
    68103
     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
    69127    public function header()
    70128    {
     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
    71144        $return = array(
    72             'title'     => HCM::__('Location'),
     145            // 'id'     => $checkbox,
     146            'title'     => $title_view,
    73147            // 'address'    => HCM::__('Address'),
    74148            );
     
    98172            ->add_attr('class', 'hc-fs4')
    99173            ->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'];
    103178        $id_view = $this->app->make('/html/element')->tag('span')
    104179            ->add_attr('class', 'hc-fs2')
     
    109184        $address_view = $p->present_address( $e );
    110185
     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
    111198        $title_view = $this->app->make('/html/list')
    112199            ->set_gutter(0)
     
    116203            ;
    117204
    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;
    119224        $return['title'] = $title_view;
    120225        $return['address'] = $address_view;
  • locatoraid/trunk/modules/search/controller.php

    r2127805 r2191985  
    6969            $command_args[] = array('priority', '<>', '-1');
    7070        }
    71 
    72         $command_args['osearch'] = array('osearch', $search);
    7371        $command_args[] = array('with', '-all-');
     72
    7473        if( $id ){
    7574            $command_args[] = $id;
     
    119118        }
    120119
    121         $match_results = NULL;
     120        $exact_results = array();
    122121        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            }
    129146        }
    130147
     
    134151        }
    135152
    136         if( $match_results ){
     153        if( $exact_results ){
     154            $results = $exact_results;
     155        }
     156        elseif( $match_results ){
    137157            $results = $match_results;
    138158        }
     
    185205        $results = $results + $geoResults;
    186206
    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            }
    189216        }
    190217
  • locatoraid/trunk/readme.txt

    r2143317 r2191985  
    8585== Changelog ==
    8686
     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
    8793= 3.6.7 =
    8894* 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.