Plugin Directory

Changeset 1531035


Ignore:
Timestamp:
11/09/2016 02:44:19 PM (9 years ago)
Author:
schrax
Message:

add a feature : you can now choose the height of your chart/map

Location:
charty/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • charty/trunk/charty.php

    r1529960 r1531035  
    44Description: Create and manage google geographic charts and maps. It's a useful tool to display demographic data on geographic charts but also on google maps (there is a Map display mode).
    55You can also customize your geographic charts (title, content, context, background, color gradient...).
    6 Version: 1.0
     6Version: 1.1
    77Author: Paul-Adrien Bru
    88Author URI: https://www.pa-bru.fr/
     
    5757    protected $continents_and_subs;
    5858    const DESCRIPTION_MAX_LENGTH = 200;
     59    const DEFAULT_HEIGHT = 600;
    5960
    6061    public static function get_instance(){
     
    105106        $this->plugin_path              = plugin_dir_path( __FILE__ );
    106107        $this->plugin_url               = plugin_dir_url( __FILE__ );
    107         $this->plugin_version           = '1.0';
     108        $this->plugin_version           = '1.1';
    108109        $this->plugin_l10n              = 'charty';
    109110        $this->countries                = require_once( $this->plugin_path . 'inc/countries.php');
     
    196197        $charty_maps_api_key =  get_post_meta($post->ID,'_charty_maps_api_key',true);
    197198        $charty_type =  get_post_meta($post->ID,'_charty_type',true);
     199        $charty_height =  get_post_meta($post->ID,'_charty_height',true);
    198200
    199201        //map type :
     
    234236            </div>
    235237        <!-- END CHARTY GOOGLE MAPS API KEY -->
     238
     239        <!-- START CHARTY HEIGHT -->
     240            <div class="meta-box-item-title">
     241                <h4>
     242                    <?php
     243                    _e('The height of the chart (in pixel)', $this->plugin_l10n);
     244                    ?>
     245                </h4>
     246            </div>
     247
     248            <div class="meta-box-item-content">
     249                <input style="width:20%" type="number" name="charty_height" id="charty_height" value="<?php echo $charty_height;?>" required />
     250            </div>
     251        <!-- END CHARTY HEIGHT -->
    236252
    237253        <!-- START CHARTY DESCRIPTION -->
     
    480496        update_post_meta($post_ID,'_charty_type', sanitize_text_field($_POST['charty_type']));
    481497        update_post_meta($post_ID,'_charty_description', sanitize_text_field($_POST['charty_description']));
     498        update_post_meta($post_ID,'_charty_height', sanitize_text_field($_POST['charty_height']));
    482499
    483500        $charty_labels = $_POST['charty_labels'];
     
    547564        //Charty type :
    548565            $charty_type = get_post_meta($atts['id'],'_charty_type',true);
     566
     567        //Charty height :
     568            if(!empty(get_post_meta($atts['id'],'_charty_height',true))){
     569                $charty_height = get_post_meta($atts['id'],'_charty_height',true) . "px";
     570            } else{
     571                $charty_height = self::DEFAULT_HEIGHT . "px";
     572            }
     573
    549574
    550575        //title :
     
    666691         */
    667692            $display_charty = '<h2>'.$charty_title.'</h2>'
    668                                 .'<div id="charty_'.$atts['id'].'" style="height: 600px;"></div>'
     693                                .'<div id="charty_'.$atts['id'].'" style="height: '. $charty_height .';"></div>'
    669694                                .'<p style="text-align:center;font-style:italic;">'.$charty_description.'</p>';
    670695
  • charty/trunk/languages/charty-fr_FR.po

    r1529960 r1531035  
    234234msgid "A new default Google Maps API Key is successfully added"
    235235msgstr "Une nouvelle clé d'API Google Maps a bien été enregistrée"
     236
     237msgid "The height of the chart (in pixel)"
     238msgstr "La hauteur du schéma/de la carte (en pixel)"
  • charty/trunk/readme.txt

    r1529960 r1531035  
    7777== Frequently Asked Questions ==
    7878
    79 = Can I insert several charts with charty on the same page ?=
     79= Can I insert several charts with charty on the same page ? =
    8080
    8181NO. But in the next version you will be able to add several charties on the same page.
    82 
    83 = Chart Height ? width ? responsive charts ? whats going on ? =
    84 
    85 Soon. At the moment it's static :
    86 * width: automatic
    87 * height: 600px
    8882
    8983== Screenshots ==
     
    9589== Changelog ==
    9690
     91= 1.1 =
     92* Added height parameter. Now you can choose a height for your chart box.
     93
    9794= 1.0 =
    9895* Initial Version
Note: See TracChangeset for help on using the changeset viewer.