Plugin Directory

Changeset 1839607


Ignore:
Timestamp:
03/13/2018 08:36:31 PM (8 years ago)
Author:
epointal
Message:

Add german translation and stamen terrain tiles

Location:
lf-hiker/trunk
Files:
9 added
7 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • lf-hiker/trunk/Controller/Front.php

    r1833277 r1839607  
    66 */
    77if ( ! defined( 'ABSPATH' ) ) exit;
     8$lfh_shortcode_done = array();
    89
    910Class Lfh_Controller_Front
    1011{
     12   
    1113    private static $_instance = null;
    1214    private static $_lfh_map_count =0;
     
    2224        add_shortcode('lfh-marker', array(&$this, 'marker_shortcode'));
    2325        add_shortcode('lfh-gpx', array(&$this, 'gpx_shortcode'));
    24         add_shortcode('lfh-kml', array(&$this, 'kml_shortcode'));
     26       // add_shortcode('lfh-kml', array(&$this, 'kml_shortcode'));
    2527        if(!function_exists('shortcode_empty_paragraph_fix')){
    2628            add_filter( 'the_content', array(&$this,'shortcode_empty_paragraph_fix' ));
     
    6668   
    6769    public function map_shortcode($atts, $html =null){
     70        if( $this->is_divi_get_thumbnail()){
     71            return "";
     72        }
    6873        if(!is_array($atts)){
    6974            $atts = array();
    7075        }
     76
    7177        $options = Lfh_Model_Map::filter_map_data($atts);
    7278     
     
    96102        $this->add_map_scripts( $options );
    97103       
    98         return $this->get_view()->render('map', array(
     104        $map = $this->get_view()->render('map', array(
    99105                'options' => $options,
    100106                'is_connected' => wp_get_current_user()->ID
    101107                ));
     108       
     109        return $map;
    102110    }
    103111   
    104112 
    105113    public function gpx_shortcode($atts, $html=''){
    106        
     114        if( $this->is_divi_get_thumbnail()){
     115            return "";
     116        }
    107117        $options = Lfh_Model_Map::filter_gpx_data($atts);
    108118        if(is_null($options)){
     
    123133                        'html'        => $html
    124134                   ));
     135       
    125136        return $content;
    126137    }
    127138   
    128139    public function marker_shortcode ( $atts, $html = '') {
     140        if( $this->is_divi_get_thumbnail()){
     141            return "";
     142        }
    129143        $options = Lfh_Model_Map::filter_marker_data($atts);
    130144        if(is_null($options)){
     
    151165    public  function add_div_fadable(){
    152166        echo '<div id="lfh-fade"></div>';
     167    }
     168    private function is_divi_get_thumbnail(){
     169        global $shortname;
     170        if( $shortname != "divi"){
     171            return false;
     172        }
     173        $functions = debug_backtrace();
     174        $find = false;
     175        $i = 5;
     176        while( $i < count( $functions) && !$find){
     177            if( $functions[$i]["function"] === "get_thumbnail"){
     178                $find = true;
     179            }
     180            $i++;
     181        }
     182        return $find;
    153183    }
    154184    private function add_map_scripts($options){
  • lf-hiker/trunk/Model/Map.php

    r1833277 r1839607  
    5151                       // 'url'           =>  'https://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg',
    5252                        'url'           => '//stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg',
    53                         'attribution'   => '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a>Contributors & <a href="http://stamen.com">Stamen Design</a>',
     53                        'attribution'   => 'by <a href="http://stamen.com">Stamen Design</a> Data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> Contributors | <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',
    5454                        'max_zoom'      => 13,
     55                        'need_key'      => false),
     56            'stamen_terrain'=> array(
     57                        'label'         => 'Stamen Terrain',
     58                        'url'           => '//stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg',
     59                        'attribution'   => 'by <a href="http://stamen.com">Stamen Design</a> Data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> Contributors | <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',
     60                        'min_zoom'      => 1,
     61                        'max_zoom'      => 14,
    5562                        'need_key'      => false)
    5663    );
  • lf-hiker/trunk/css/lfh-style.css

    r1833277 r1839607  
    12221222  margin-bottom: 2px;
    12231223}
     1224svg.leaflet-zoom-animated {
     1225  max-height: none;
     1226}
    12241227@media screen and (max-width: 768px) {
    12251228  /*.lfh-control-fullscreen{
  • lf-hiker/trunk/css/lfh-style.less

    r1833277 r1839607  
    900900}
    901901
    902 
     902svg.leaflet-zoom-animated{
     903    max-height: none;
     904}
    903905
    904906@media screen and (max-width: 768px)
  • lf-hiker/trunk/gulpfile.js

    r1833277 r1839607  
    22//there are in files readme others version numbers: for releases, tested browsers, and the most important wordpress
    33
    4 var old_version = '1.5.1';
    5 var version = '1.6.0';
     4var old_version = '1.6.0';
     5var version = '1.7.0';
    66var gulp = require('gulp');
    77var less = require('gulp-less');
  • lf-hiker/trunk/lf-hiker.php

    r1833277 r1839607  
    66    Author: epointal
    77    Author URI: http://elisabeth.pointal.org/
    8     Version: 1.6.0
     8    Version: 1.7.0
    99    License: GPL2
    1010    Text domain: lfh
     
    1212
    1313if ( ! defined( 'ABSPATH' ) ) exit;
    14 
     14if( ! function_exists( "boolval")){
     15    function boolval( $var ){
     16        if( is_null( $var )){
     17            return false;
     18        }
     19        switch( gettype( $var)){
     20            case "boolean":
     21                return $var;
     22                break;
     23            case "integer":
     24            case "double":
     25                if($var >0){
     26                    return true;
     27                }else{
     28                    return false;
     29                }
     30                break;
     31            case "string":
     32                if( $var === "" || $var === "0" || $var === "false"){
     33                    return false;
     34                }else{
     35                    return true;
     36                }
     37                break;
     38            case "array":
     39                if( count($var)>0){
     40                    return true;
     41                }else{
     42                    return false;
     43                }
     44                break;
     45            default:
     46                return true;
     47        }
     48    }
     49}
    1550
    1651class Lf_Hiker_Plugin
    1752{
    18     const VERSION = '1.6.0';
     53    const VERSION = '1.7.0';
    1954   
    2055    private static $_controller;
  • lf-hiker/trunk/package.json

    r1833277 r1839607  
    11{
    22  "name": "lf-hiker",
    3   "version": "1.6.0",
     3  "version": "1.7.0",
    44  "description": "plugin for wordpress for display track with profil elevation",
    55  "main": "index.js",
  • lf-hiker/trunk/readme.txt

    r1833277 r1839607  
    77Tested up to: 4.9 
    88Stable tag: 1.0 
    9 Version: 1.6.0
     9Version: 1.7.0
    1010License: GPLv2 or later 
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    9797 * Fran&ccedil;ais (fr_FR)
    9898 * English (en_US) 
     99 * Deutsch (de_DE) 
    99100 
    100101 If you need language of **Lf Hiker** which is not included. You can easily translate with poedit from the file :   
     
    134135
    135136== Changelog ==
     137= 1.7.0 =
     138 * Fixed: no path displayed with mesmerize theme
     139 * Evolution: add tiles Stamen Terrain
     140 * Evolution: add german translation
     141 * Fixed: conflict with divi theme and option Grab the first post image
     142 * Fixed: function boolval do not exists (version php <5.5)
     143 
    136144= 1.6.0 =
    137145 * Ability to choose the default map tiles
Note: See TracChangeset for help on using the changeset viewer.