Plugin Directory

Changeset 2241294


Ignore:
Timestamp:
02/09/2020 02:21:03 PM (6 years ago)
Author:
hitcode
Message:

3.7.1

Location:
locatoraid/trunk
Files:
13 edited

Legend:

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

    r2214861 r2241294  
    11<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
    2 $config['app_version'] = '3.7.0';
     2$config['app_version'] = '3.7.1';
    33// $config['dbprefix_version'] = 'v1';
    44
  • locatoraid/trunk/happ2/assets/css/hc.css

    r1769456 r2241294  
    765765
    766766#hclc_map img {max-width: none !important;}
     767
     768@media (max-width: 48em) {
     769    .hc-lg-flex-auto-grid.hc-lg-mxn2 > div {margin-top:.5em;}
     770    .hc-lg-flex-auto-grid.hc-lg-mxn2 > div:first-child {margin-top:0;}
     771}
     772
     773#locatoraid-search-radius-select-container select {
     774    width: 100%;
     775}
     776
     777@media (min-width: 48em) {
     778    .hc-lg-mxn2 { margin-left: -.5rem; margin-right: -.5rem; }
     779    .hc-lg-px2 { padding-left: .5em; padding-right: .5em }
     780    .hc-lg-align-center { text-align: center }
     781
     782    .hc-lg-flex-auto-grid {
     783        display: flex;
     784        flex-direction: row;
     785        justify-content: space-around;
     786        flex-wrap: nowrap;
     787        align-items: center;
     788        vertical-align: middle;
     789        /* align-items: flex-start; */
     790    }
     791    .hc-lg-flex-auto-grid > div {
     792        white-space: nowrap; overflow: hidden; width: 100%;
     793    }
     794
     795    #locatoraid-search-radius-select-container {
     796        width: 6em;
     797    }
     798}
  • locatoraid/trunk/happ2/modules/app/_config_after.php

    r1970559 r2241294  
    22$config['after']['/app/enqueuer'][] = function( $app, $enqueuer )
    33{
     4    $ver = defined( 'LC3_VERSION' ) ? LC3_VERSION : 2;
     5
    46    $enqueuer
    5         ->register_script( 'hc', 'happ2/assets/js/hc2.js' )
     7        ->register_script( 'hc', 'happ2/assets/js/hc2.js?hcver=' . $ver )
    68
    7         ->register_style( 'hc-start', 'happ2/assets/css/hc-start.css' )
    8         ->register_style( 'hc', 'happ2/assets/css/hc.css' )
     9        ->register_style( 'hc-start', 'happ2/assets/css/hc-start.css?hcver=' . $ver )
     10        ->register_style( 'hc', 'happ2/assets/css/hc.css?hcver=' . $ver )
    911        ->register_style( 'font', 'https://fonts.googleapis.com/css?family=PT+Sans' )
    1012        ;
  • locatoraid/trunk/happ2/modules/http/uri.php

    r2209033 r2241294  
    105105            if( isset($base_params[$this->hca]) ){
    106106                $hca = $base_params[$this->hca];
     107                $hca = sanitize_text_field( $hca );
    107108
    108109                list( $slug, $params ) = $this->get_slug_and_params( $hca );
     110
    109111                $return['slug'] = $slug;
    110112                $return['raw_params'] = $params;
  • locatoraid/trunk/locatoraid.php

    r2214861 r2241294  
    44Plugin URI: https://www.locatoraid.com/
    55Description: Store locator plugin
    6 Version: 3.7.0
     6Version: 3.7.1
    77Author: hitcode.com
    88Author URI: https://www.locatoraid.com/
     
    1212
    1313if( ! defined('LC3_VERSION') ){
    14     define( 'LC3_VERSION', 370 );
     14    define( 'LC3_VERSION', 371 );
    1515}
    1616
  • locatoraid/trunk/modules/front.conf/_config_after.php

    r1807089 r2241294  
    1111            ),
    1212        'label' => HCM::__('Measure Units'),
     13        );
     14    $return['front:links_new_window'] = array(
     15        'input' => $app->make('/form/checkbox')
     16            ,
     17        'label' => HCM::__('Open Links In New Window'),
    1318        );
    1419    return $return;
  • locatoraid/trunk/modules/front/_config_settings.php

    r2143317 r2241294  
    11<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
    22$config['settings']['core:measure'] = 'mi';
     3$config['settings']['front:links_new_window'] = 1;
    34
    45$config['settings']['fields:name:use'] = TRUE;
  • locatoraid/trunk/modules/front/assets/js/front.js

    r2214861 r2241294  
    202202                search_url += encodeURIComponent( '/product2/' + replace_to );
    203203            }
     204
     205            if( 'radius' == k ){
     206                search_url += encodeURIComponent( '/radius/' + replace_to );
     207            }
    204208        }
    205209
     
    210214            search_string = search_string + ' ' + where;
    211215        }
     216
     217console.log( search );
     218console.log( search_url );
     219// return;
    212220
    213221        if( ! search_string.length ){
     
    336344        }
    337345
    338         var radius_search_url = $this.data('radius-link');
    339         var search_string = this_data.search;
    340         search_string = search_string + '';
    341 
    342         if( search_string.length && radius_search_url.length ){
    343             self.radius_search( this_data );
     346        if( this_data.hasOwnProperty('radius') ){
     347            self.search( this_data );
    344348        }
    345349        else {
    346             self.search( this_data );
     350            var radius_search_url = $this.data('radius-link');
     351            var search_string = this_data.search;
     352            search_string = search_string + '';
     353
     354            if( search_string.length && radius_search_url.length ){
     355                self.radius_search( this_data );
     356            }
     357            else {
     358                self.search( this_data );
     359            }
    347360        }
    348361    }
     
    350363    $this.on('submit', this.submit );
    351364    $this.find("input[type='checkbox']").on('change', this.submit );
     365    $this.find("select").on('change', this.submit );
    352366
    353367    // var default_search = $this.find('input[name=hc-search]').val();
  • locatoraid/trunk/modules/front/view.php

    r2214861 r2241294  
    1111
    1212        $enqueuer
    13             ->register_script( 'hc', 'happ2/assets/js/hc2.js' )
    14             ->register_style( 'hc', 'happ2/assets/css/hc.css' )
     13            ->register_script( 'hc', 'happ2/assets/js/hc2.js?hcver=' . LC3_VERSION )
     14            ->register_style( 'hc', 'happ2/assets/css/hc.css?hcver=' . LC3_VERSION )
    1515            ;
    1616
     
    8181            'search-bias-country'   => '', // australia, uk, finland etc
    8282            'radius'                => '10, 25, 50, 100, 200, 500',
     83            'radius-select' => 0,
    8384            'id'            => NULL,
    8485            'clustering'    => 0,
  • locatoraid/trunk/modules/front/view_form.php

    r2209033 r2241294  
    3636        }
    3737
     38    // radius select
     39        if( isset($params['radius-select']) && $params['radius-select'] ){
     40            if( isset($params['radius']) && (count($params['radius']) > 1) ){
     41                $radiusOptions = array();
     42                // $radiusOptions[ 0 ] = HCM::__('Radius');
     43                $measure = $app_settings->get('core:measure');
     44                foreach( $params['radius'] as $e ){
     45                    $radiusOptions[ $e ] = $e . ' ' . $measure;
     46                }
     47
     48                $radiusSelect = $this->app->make('/form/select')
     49                    ->set_options( $radiusOptions )
     50                    ->render( 'radius', current($params['radius']) )
     51                    ->add_attr('class', 'hcj2-radius-select')
     52                    ->add_attr('id', 'locatoraid-search-radius-select')
     53                    ;
     54
     55                $form_inputs['radius'] = $radiusSelect;
     56            }
     57        }
     58
    3859        $form_values = array();
    3960        if( isset($params['start']) && ($params['start'] != 'no') ){
     
    5980                $link_params['limit'] = $params['limit'];
    6081            }
    61             if( isset($params['radius']) && (count($params['radius']) <= 1) ){
    62                 $link_params['radius'] = $params['radius'];
     82            if( ! isset($form_inputs['radius']) ){
     83                if( isset($params['radius']) && (count($params['radius']) <= 1) ){
     84                    $link_params['radius'] = $params['radius'];
     85                }
    6386            }
    6487            if( isset($params['sort']) ){
     
    94117    // radius link which will give us links to results
    95118        $radius_link = '';
    96         if( isset($params['radius']) && (count($params['radius']) > 1) ){
    97             $radius_link_params = $link_params;
    98 
    99             $radius_link_params['radius'] = $params['radius'];
    100             unset( $radius_link_params['sort'] );
    101             // unset( $radius_link_params['limit'] );
    102 
    103             $radius_link = $this->app->make('/http/uri')
    104                 ->mode('api')
    105                 ->url('/search/radius', $radius_link_params )
    106                 ;
     119        if( ! isset($form_inputs['radius']) ){
     120            if( isset($params['radius']) && (count($params['radius']) > 1) ){
     121                $radius_link_params = $link_params;
     122
     123                $radius_link_params['radius'] = $params['radius'];
     124                unset( $radius_link_params['sort'] );
     125                // unset( $radius_link_params['limit'] );
     126
     127                $radius_link = $this->app->make('/http/uri')
     128                    ->mode('api')
     129                    ->url('/search/radius', $radius_link_params )
     130                    ;
     131            }
    107132        }
    108133
     
    151176            ->set_gutter(2)
    152177            ;
     178
     179        if( isset($inputs_view['radius']) ){
     180            $inputs_view['search'] = '<div class="hc-lg-flex-auto-grid hc-lg-mxn2"><div class="hc-lg-px2">' . $inputs_view['search'] . '</div><div class="hc-lg-px2 hc-lg-align-center" id="locatoraid-search-radius-select-container">' . $inputs_view['radius'] . '</div></div>';
     181            unset( $inputs_view['radius'] );
     182        }
     183
    153184        foreach( $inputs_view as $k => $input ){
    154185            $input_view = $this->app->make('/html/element')->tag('div')
  • locatoraid/trunk/modules/locations/presenter.php

    r2214861 r2241294  
    198198                $this_label = strlen($this_label) ? $this_label : $value;
    199199
    200                 $return = '<a href="' . $href . '" target="_blank">' . $this_label . '</a>';
     200                $newWindow = $app_settings->get( 'front:links_new_window' );
     201
     202                $return = '<a href="' . $href . '"';
     203                if( $newWindow ){
     204                    $return .= ' target="_blank"';
     205                }
     206                $return .= '>' . $this_label . '</a>';
     207
     208
    201209                break;
    202210
  • locatoraid/trunk/modules/publish.wordpress/view.html.php

    r2106597 r2241294  
    188188    </li>
    189189
    190 
    191190    <li class="hc-mt3">
    192191        <h3 class="hc-underline">radius</h3>
     
    207206
    208207    <li class="hc-mt3">
     208        <h3 class="hc-underline">radius-select</h3>
     209        <ul class="hc-ml3">
     210            <li>
     211                <?php echo HCM::__('Displays a drop-down list to select a search radius option. Set to 1 to show, 0 to hide.'); ?>
     212            </li>
     213            <li>
     214                <?php echo HCM::__('Default'); ?>: <em>0</em>
     215            </li>
     216            <li class="hc-p2">
     217                <code class="hc-p2">
     218                [<?php echo $tag; ?> radius-select="1"]
     219                </code>
     220            </li>
     221        </ul>
     222    </li>
     223
     224
     225    <li class="hc-mt3">
    209226        <h3 class="hc-underline">group</h3>
    210227        <ul class="hc-ml3">
  • locatoraid/trunk/readme.txt

    r2214861 r2241294  
    8585== Changelog ==
    8686
     87= 3.7.1 =
     88* Added a shortcode parameter if to display the search radius drop down box.
     89* Added a setting if to open links in a new window.
     90
    8791= 3.7.0 =
    8892* Added a setting to define a default map pin for locations.
Note: See TracChangeset for help on using the changeset viewer.