Plugin Directory

Changeset 1914834


Ignore:
Timestamp:
07/25/2018 02:10:13 PM (8 years ago)
Author:
Sh14
Message:

custom placemark special attribut added

Location:
oi-yamaps/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • oi-yamaps/trunk/Readme.md

    r1897230 r1914834  
    4747## Changelog
    4848
     49###  3.1.8 (25.07.2018)
     50* fix: custom placemark special attribut added;
    4951###  3.1.7 (22.06.2018)
    5052* fix: the symbol of the number 1 was deleted before the map;
  • oi-yamaps/trunk/oi-yamaps.php

    r1897230 r1914834  
    55Description: The plugin allows you to use Yandex.Maps on your site pages and put the placemarks on the map. Without an API key. <strong>Don't forget to reactivate the plugin!</strong>
    66Author: Alexei Isaenko
    7 Version: 3.1.7
     7Version: 3.1.8
    88Author URI: https://oiplug.com/members/isaenkoalexei
    99Text Domain: oi-yamaps
     
    202202        'hint'           => '',
    203203        'coordinates'    => '',
     204        'iconlayout'     => '',
    204205        'iconimage'      => '',
    205206        'button_caption' => __( 'Show the map', 'oi-yamaps' ),
     
    366367    }
    367368
    368     $result = array( $address, $coordinates, $is_coordinates );
     369    $result = array($address, $coordinates, $is_coordinates);
    369370
    370371    if ( $flag == false ) {
     
    642643            'iconcaption' => $atts['iconcaption'],
    643644            'placemark'   => $atts['placemark'],
     645            'iconlayout'  => $atts['iconlayout'],
    644646            'iconimage'   => $atts['iconimage'],
    645647            'iconsize'    => '',
     
    696698        $atts['lon']            = array();
    697699        foreach ( $vars['placemarks'] as $key => $value ) {
    698             // set placemark if it's not...
    699             if ( empty( $value['placemark'] ) ) {
    700                 $value['placemark'] = $atts['placemark'];
     700            if ( ! empty( $value ) ) {
     701
     702                // set placemark if it's not...
     703                if ( empty( $value['placemark'] ) ) {
     704                    $value['placemark'] = $atts['placemark'];
     705                }
     706
     707                if ( empty( $atts['center'] ) ) {
     708                    list( $atts['lat'][], $atts['lon'][] ) = explode( ',', $value['coordinates'] );
     709                }
     710                $atts['placemark_code'] .= placemark_code( $value );
    701711            }
    702             if ( empty( $atts['center'] ) ) {
    703                 list( $atts['lat'][], $atts['lon'][] ) = explode( ',', $value['coordinates'] );
    704             }
    705             $atts['placemark_code'] .= placemark_code( $value );
    706712        }
    707713        if ( empty( $atts['center'] ) ) {
     
    829835        'iconcaption' => '',
    830836        'placemark'   => '',
     837        'iconlayout'  => '',
    831838        'iconimage'   => '',
    832839        'iconsize'    => '',
     
    835842    ), $atts );
    836843
     844    if ( ! empty( $atts['iconimage'] ) && empty( $atts['iconlayout'] ) ) {
     845        $atts['iconlayout'] = 'default#image';
     846    }
     847
    837848    foreach ( $atts as $key => $value ) {
    838849        if ( ! empty( $atts[ $key ] ) ) {
     
    865876                    $atts['footer'] = 'balloonContentFooter: "' . $atts['footer'] . '",';
    866877                    break;
    867 
    868 
    869878                case 'hint':
    870879                    $atts['hint'] = 'hintContent: "' . $atts['hint'] . '"';
    871880                    break;
    872 
     881                case 'iconlayout':
     882                    $atts['iconlayout'] = 'iconLayout: "' . $atts['iconlayout'] . '", ';
     883                    break;
    873884                case 'iconimage':
    874885                    $atts['iconimage'] = 'iconImageHref: "' . $atts['iconimage'] . '", ';
     
    895906
    896907    // replace braces with triangular brackets
    897     $content_tags = array( 'header', 'body', 'footer', );
     908    $content_tags = array('header', 'body', 'footer',);
    898909    foreach ( $content_tags as $tag ) {
    899910        if ( ! empty( $atts[ $tag ] ) ) {
    900             $atts[ $tag ] = str_replace( array( '{', '}', ), array( '<', '>', ), $atts[ $tag ] );
     911            $atts[ $tag ] = str_replace( array('{', '}',), array('<', '>',), $atts[ $tag ] );
    901912        }
    902913    }
     
    913924                {' .
    914925              $atts['placemark'] .
     926              $atts['iconlayout'] .
    915927              $atts['iconimage'] .
    916928              $atts['iconsize'] .
     
    939951        'iconcaption' => '',
    940952        'placemark'   => '',
     953        'iconlayout'  => '',
    941954        'iconimage'   => '',
    942955        'iconsize'    => '',
     
    981994            'iconcaption' => $atts['iconcaption'],
    982995            'placemark'   => $atts['placemark'],
     996            'iconlayout'  => $atts['iconlayout'],
    983997            'iconimage'   => $atts['iconimage'],
    984998            'iconsize'    => $atts['iconsize'],
  • oi-yamaps/trunk/readme.txt

    r1897230 r1914834  
    5959== Changelog ==
    6060
    61 = 3.1.6 (22.06.2018) =
     613.1.8 (25.07.2018)
     62* fix: custom placemark special attribut added;
     63= 3.1.7 (22.06.2018) =
    6264* fix: the symbol of the number 1 was deleted before the map;
    6365= 3.1.6 (29.05.2018) =
Note: See TracChangeset for help on using the changeset viewer.