WordPress.org

Plugin Directory

Changeset 631976


Ignore:
Timestamp:
11/29/12 20:46:33 (17 months ago)
Author:
MadtownLems
Message:

removed storing and using of options. added support for https links

Location:
google-maps-embed/trunk
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • google-maps-embed/trunk/cets_EmbedGmaps.php

    r260900 r631976  
    11<?php 
    22/* 
    3 Plugin Name: Google Maps embed 
     3Plugin Name: Google Maps Embed 
    44Plugin URI:  
    5 Description: This plugin adds an icon to the WYSIWYG editor that allows a user to embed a Google Map into a post or page. Cooperative Extension Technology Services does not provide support for Google services. 
    6 Author: Deanna Schneider 
    7 Version: 1.5 
    8 Author URI: http://deannaschneider.wordpress.com/ 
    9  
    10 Copyright 2008 Deanna Schneider 
     5Description: This plugin adds an icon to the Visual editor that allows a user to embed a Google Map into a post or page. Cooperative Extension Technology Services does not provide support for Google services. 
     6Author: Deanna Schneider and Jason Lemahieu 
     7Version: 1.12 
     8Author URI:  
     9 
    1110 
    1211This program is free software; you can redistribute it and/or modify 
     
    2726class cets_EmbedGmaps { 
    2827 
    29      
    30  
    31     function cets_EmbedGmaps() { 
    32         global $wp_version; 
    33         // The current version 
    34         define('cets_EmbedGmaps_VERSION', '1.0.0'); 
    35          
    36         // Check for WP2.6 installation 
    37         if (!defined ('IS_WP26')) 
    38             define('IS_WP26', version_compare($wp_version, '2.6', '>=') ); 
    39          
    40         //This works only in WP2.6 or higher 
    41         if ( IS_WP26 == FALSE) { 
    42             add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error fade"><p><strong>' . __('Sorry, cets_EmbedGmaps works only under WordPress 2.6 or higher',"cetsEmbedGmaps") . '</strong></p></div>\';')); 
    43             return; 
    44         } 
    45          
    46          
     28    function cets_EmbedGmaps() {     
     29                 
    4730        // define URL 
    4831        define('cets_EmbedGmaps_ABSPATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' ); 
    4932        define('cets_EmbedGmaps_URLPATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' ); 
    50         //define('cets_EmbedGmaps_TAXONOMY', 'wt_tag'); 
    51          
    52          
    53          
    54          
     33                 
    5534        include_once (dirname (__FILE__)."/lib/shortcodes.php"); 
    5635        include_once (dirname (__FILE__)."/tinymce/tinymce.php"); 
    57          
    58         // set the default options 
    59         $defaults = array( 
    60             'src'       => 'http://maps.google.com/?ie=UTF8&ll=37.0625,-95.677068&spn=55.586984,107.138672&t=h&z=4', 
    61             'height' => 425, 
    62             'width' => 350, 
    63             'frameborder' => 0, 
    64             'marginheight' => 0, 
    65             'marginwidth' => 0, 
    66             'scrolling' => 'no', 
    67             'line' => 3); 
    68              
    69             add_option('cets_embedGmaps_src', $defaults['src']); 
    70             add_option('cets_embedGmaps_width', $defaults['width']); 
    71             add_option('cets_embedGmaps_height', $defaults['height']); 
    72             add_option('cets_embedGmaps_marginwidth', $defaults['marginwidth']); 
    73             add_option('cets_embedGmaps_marginheight', $defaults['marginheight']); 
    74             add_option('cets_embedGmaps_frameborder', $defaults['frameborder']); 
    75             add_option('cets_embedGmaps_scrolling', $defaults['scrolling']); 
    76             add_option('cets_embedGmaps_line', $defaults['line']); 
    77              
     36                     
    7837     
    7938    //add the quick tags and functions 
     
    8241     
    8342    if ( in_array( basename($_SERVER['PHP_SELF']), apply_filters( 'vvq_editor_pages', array('post-new.php', 'page-new.php', 'post.php', 'page.php') ) ) ) { 
    84                 // add scrips 
    85                 wp_enqueue_script('jquery'); 
     43                 
     44                add_action('admin_init', array(&$this, 'adminRegisterScripts' ) ); 
     45                add_action('admin_enqueue_scripts', array(&$this, 'adminEnqueueScripts') ); 
     46                 
    8647                add_action( 'admin_head', array(&$this, 'EditorCSS') ); 
    8748                add_action( 'admin_footer', array(&$this, 'OutputjQueryDialogDiv') ); 
    88                 wp_enqueue_script( 'jquery-ui-draggable', plugins_url('/google-maps-embed/lib/jquery-ui/ui.draggable.js'), array('jquery-ui-core'), '1.5.2' ); 
    89                 wp_enqueue_script( 'jquery-ui-resizable', plugins_url('/google-maps-embed/lib/jquery-ui/ui.resizable.js'), array('jquery-ui-core'), '1.5.2' ); 
    90                 wp_enqueue_script( 'jquery-ui-dialog', plugins_url('/google-maps-embed/lib/jquery-ui/ui.dialog.js'), array('jquery-ui-core'), '1.5.2' ); 
    91                 wp_enqueue_style( 'cets-jquery-ui', plugins_url('/google-maps-embed/lib/jquery-ui/cets-jquery-ui.css'), array(), $this->version, 'screen' ); 
    92         } 
    93     } 
    94      
    95      
     49        } 
     50    } 
     51     
     52    function adminRegisterScripts() { 
     53        wp_register_script( 'jquery-ui-draggable', plugins_url('/google-maps-embed/lib/jquery-ui/ui.draggable.js'), array('jquery-ui-core'), '1.5.2' ); 
     54        wp_register_script( 'jquery-ui-resizable', plugins_url('/google-maps-embed/lib/jquery-ui/ui.resizable.js'), array('jquery-ui-core'), '1.5.2' ); 
     55        wp_register_script( 'jquery-ui-dialog', plugins_url('/google-maps-embed/lib/jquery-ui/ui.dialog.js'), array('jquery-ui-core'), '1.5.2' ); 
     56                 
     57        wp_register_style( 'cets-jquery-ui-css', plugins_url('/google-maps-embed/lib/jquery-ui/cets-jquery-ui.css'), array(), false, 'screen' ); 
     58    } 
     59     
     60    function adminEnqueueScripts() { 
     61        wp_enqueue_script('jquery'); 
     62        wp_enqueue_script( 'jquery-ui-draggable' ); 
     63        wp_enqueue_script( 'jquery-ui-resizable' ); 
     64        wp_enqueue_script( 'jquery-ui-dialog' ); 
     65         
     66        wp_enqueue_style( 'cets-jquery-ui-css' ); 
     67    } 
     68         
    9669    // all the quick tag stuff is pretty much stolen from Viper. He rocks. 
    9770    function addQuicktagsAndFunctions() {        
    9871     
    99     // get the defaults and make sure they're valid 
    100      
    101         $width = get_option('cets_embedGmaps_width'); 
    102         $height = get_option('cets_embedGmaps_height'); 
    103         $marginwidth = get_option('cets_embedGmaps_marginwidth'); 
    104         $marginheight = get_option('cets_embedGmaps_marginheight'); 
    105         $frameborder = get_option('cets_embedGmaps_frameborder'); 
    106         $scrolling = get_option('cets_embedGmaps_scrolling'); 
    107          
    108         $width = (is_numeric($width) == true ? $width : 350); 
    109         $height = (is_numeric($height) == true ? $height : 425); 
    110         $marginwidth = (is_numeric($marginwidth) == true ? $marginwidth : 0); 
    111         $marginheight = (is_numeric($marginheight) == true ? $marginheight : 0); 
    112         $frameborder = (is_numeric($frameborder) == true ? $frameborder : 0); 
    113         $scrolling = (strlen($scrolling) == true ? $scrolling : 'no'); 
    114              
    115     // This is the non tiny mce button stuff 
     72    // Set defaults 
     73        $width = 350; 
     74        $height = 425; 
     75        $marginwidth = 0; 
     76        $marginheight = 0; 
     77        $frameborder = 0; 
     78        $scrolling = 'no'; 
     79         
     80     
     81    // This is the tiny mce button stuff 
    11682        $types = array( 
    11783            'cetsEmbedGmap' => array( 
     
    12591         
    12692         
    127     $buttonhtml = $datajs = ''; 
     93         
     94    $buttonshtml = $datajs = ''; 
    12895        foreach ( $types as $type => $strings ) { 
    12996            // HTML for quicktag button 
     
    13299            // Create the data array 
    133100            $datajs .= "    cets_GEData['$type'] = {\n"; 
    134             $datajs .= '        title: "' . $this->js_escape( ucwords( $strings[1] ) ) . '",' . "\n"; 
    135             $datajs .= '        instructions: "' . $this->js_escape( $strings[2] ) . '",' . "\n"; 
    136             $datajs .= '        example: "' . js_escape( $strings[3] ) . '"'; 
     101            $datajs .= '        title: "' . $this->esc_js( ucwords( $strings[1] ) ) . '",' . "\n"; 
     102            $datajs .= '        instructions: "' . $this->esc_js( $strings[2] ) . '",' . "\n"; 
     103            $datajs .= '        example: "' . esc_js( $strings[3] ) . '"'; 
    137104            $datajs .= ",\n     width: " . $width . ",\n"; 
    138105            $datajs .= "        height: " . $height .",\n"; 
     
    173140     
    174141            // Open the dialog while setting the width, height, title, buttons, etc. of it 
    175             var buttons = { "<?php echo js_escape('Okay', 'cets_EmbedGmaps'); ?>": cets_GEButtonOkay, "<?php echo js_escape('Cancel', 'cets_EmbedGmaps'); ?>": cets_GEDialogClose }; 
     142            var buttons = { "<?php echo esc_js('Okay', 'cets_EmbedGmaps'); ?>": cets_GEButtonOkay, "<?php echo esc_js('Cancel', 'cets_EmbedGmaps'); ?>": cets_GEDialogClose }; 
    176143            var title = cets_GEData[tag]["title"]; 
    177144             
     
    184151     
    185152            // Set the instructions 
    186             jQuery("#cets_GE-dialog-message").html("<p>" + cets_GEData[tag]["instructions"] + "</p><p><strong><?php echo js_escape( __('Example:', 'cets_EmbedGmaps') ); ?></strong></p><p><code>" + cets_GEData[tag]["example"] + "</code></p>"); 
     153            jQuery("#cets_GE-dialog-message").html("<p>" + cets_GEData[tag]["instructions"] + "</p><p><strong><?php echo esc_js( __('Example:', 'cets_EmbedGmaps') ); ?></strong></p><p><code>" + cets_GEData[tag]["example"] + "</code></p>"); 
    187154     
    188155            // Style the jQuery-generated buttons by adding CSS classes and add second CSS class to the "Okay" button 
    189156            jQuery(".ui-dialog button").addClass("button").each(function(){ 
    190                 if ( "<?php echo js_escape('Okay', 'cets_EmbedGmaps'); ?>" == jQuery(this).html() ) jQuery(this).addClass("button-highlighted"); 
     157                if ( "<?php echo esc_js('Okay', 'cets_EmbedGmaps'); ?>" == jQuery(this).html() ) jQuery(this).addClass("button-highlighted"); 
    191158            }); 
    192159     
     
    269236            var buttonshtml = '<input type=\"button\" class=\"ed_button\" onclick=\"cets_GEButtonClick(\'cetsEmbedGmap\')\" title=\"Embed a Google map\" value=\"Embed Gmap\" />'; 
    270237             
    271             //jQuery("#ed_toolbar").append(<?php echo $this->js_escape( $buttonshtml ); ?>); 
     238            //jQuery("#ed_toolbar").append(<?php echo $this->esc_js( $buttonshtml ); ?>); 
    272239            jQuery("#ed_toolbar").append(buttonshtml); 
    273240             
     
    302269    } //end addquicktags function 
    303270     
    304     // WordPress' js_escape() won't allow <, >, or " -- instead it converts it to an HTML entity. This is a "fixed" function that's used when needed. 
    305     function js_escape($text) { 
     271    // WordPress' esc_js() won't allow <, >, or " -- instead it converts it to an HTML entity. This is a "fixed" function that's used when needed. 
     272    function esc_js($text) { 
    306273        $safe_text = addslashes($text); 
    307274        $safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text)); 
    308275        $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text)); 
    309276        $safe_text = str_replace('\\\n', '\n', $safe_text); 
    310         return apply_filters('js_escape', $safe_text, $text); 
     277        return apply_filters('esc_js', $safe_text, $text); 
    311278    } 
    312279         
     
    323290                <div id="cets_GE-dialog-slide-header" class="cets_GE-dialog-slide ui-dialog-titlebar"><?php _e('Dimensions', 'cets_gmapsEmbed'); ?></div> 
    324291                <div id="cets_GE-dialog-slide" class="cets_GE-dialog-slide cets_GE-dialog-content"> 
    325                     <p><?php printf( __("The default dimensions for maps can be set on this plugin's <a href='%s'>settings page</a>. However, you can set custom dimensions for this one particular map here:", 'cets_gmapsEmbed'), admin_url('options-general.php?page=cets_gmapsEmbed') ); ?></p> 
     292                     
    326293                    <p>Width: <input type="text" id="cets_GE-dialog-width" class="cets_GE-dialog-dim" style="width:50px" /> <br/> 
    327294                    Height: <input type="text" id="cets_GE-dialog-height" class="cets_GE-dialog-dim" style="width:50px" /> pixels</p> 
     
    337304                    <p> 
    338305                    Should the iframe scroll? <select name="cets_GE-dialog-scrolling" id="cets_GE-dialog-scrolling"> 
    339                 <option value="no"<?php if(get_option('cets_embedGmaps_scrolling', 'no') == 'no') echo ' selected'; ?>>No</option> 
    340                 <option value="yes"<?php if(get_option('cets_embedGmaps_scrolling', 'no') == 'yes') echo ' selected'; ?>>Yes</option> 
    341                 <option value="auto"<?php if(get_option('cets_embedGmaps_scrolling', 'no') == 'auto') echo ' selected'; ?>>Auto</option> 
     306                <option value="no" SELECTED>No</option> 
     307                <option value="yes" >Yes</option> 
     308                <option value="auto" >Auto</option> 
    342309            </select> 
    343310                    </p> 
     
    362329     
    363330     
    364      
    365     }// end embed_Gmaps class 
    366      
    367  
    368      
    369      
    370      
    371  
     331}// end embed_Gmaps class 
     332     
    372333 
    373334// Start this plugin once all other plugins are fully loaded 
    374 add_action( 'plugins_loaded', create_function( '', 'global $cets_EmbedGmaps; $cets_EmbedGmaps = new cets_EmbedGmaps();' ) ); 
    375  
    376  
    377  
    378 // Admin options menu stuff starts here 
    379 include_once (dirname (__FILE__)."/options.php"); 
    380  
    381  
    382      
    383  
    384 ?> 
     335add_action( 'plugins_loaded', 'cets_embed_gmaps_init' ); 
     336function cets_embed_gmaps_init() { 
     337    $cets_EmbedGmaps = new cets_EmbedGmaps(); 
     338} 
  • google-maps-embed/trunk/lib/jquery-ui/cets-jquery-ui.css

    r487125 r631976  
    1717    font-family: ; 
    1818    font-size: px; 
    19     background: #ffffff; 
     19    background: #ffffff !important; 
    2020    color: 333333; 
    2121    border: 4px solid #cccccc; 
    2222    position: relative; 
    23     overflow:hidden; 
     23    overflow: hidden; 
    2424} 
    2525.ui-resizable-handle { 
  • google-maps-embed/trunk/lib/shortcodes.php

    r260900 r631976  
    22 
    33/** 
    4  * @author Deanna Schneider 
     4 * @author Deanna Schneider & Jason Lemahieu 
    55 * @copyright 2008 
    66 * @description Use WordPress Shortcode API for more features 
     
    99 
    1010class cets_EmbedGmaps_shortcodes { 
    11      
    12     var $count = 1; 
    13      
     11         
    1412    // register the new shortcodes 
    1513    function cets_EmbedGmaps_shortcodes() { 
     
    1917    } 
    2018 
    21      
    2219    function show_Gmap( $atts ) { 
    2320     
     
    2522     
    2623        extract(shortcode_atts(array( 
    27             'src'       => get_option('cets_embedGmaps_src','http://maps.google.com/?ie=UTF8&ll=37.0625,-95.677068&spn=55.586984,107.138672&t=h&z=4'), 
    28             'height' => get_option('cets_embedGmaps_height', 425), 
    29             'width' => get_option('cets_embedGmaps_width',350), 
    30             'frameborder' => get_option('cets_embedGmaps_frameborder',0), 
    31             'marginheight' => get_option('cets_embedGmaps_marginheight',0), 
    32             'marginwidth' => get_option('cets_embedGmaps_marginwidth',0), 
    33             'scrolling' => get_option('cets_embedGmaps_scrolling','no') 
     24            'src'       => 'http://maps.google.com/?ie=UTF8&ll=37.0625,-95.677068&spn=55.586984,107.138672&t=h&z=4', 
     25            'height' => 425, 
     26            'width' => 350, 
     27            'frameborder' => 0, 
     28            'marginheight' => 0, 
     29            'marginwidth' => 0, 
     30            'scrolling' =>'no' 
    3431        ), $atts )); 
    3532         
    3633        // clean up the url 
    37         $src = str_replace("'", "\\'", clean_url($src)); 
    38          
    39          
    40          
     34        $src = str_replace("'", "\\'", esc_url($src)); 
     35             
    4136        //if it's not a link to maps.google.com, don't allow it 
    42         if (substr_count($src, 'http://maps.google', 0) == 0) return; 
    43          
     37        if (substr_count($src, 'http://maps.google', 0) == 0 && substr_count($src, 'https://maps.google', 0) == 0) return; 
    4438         
    4539        // makes sure all the other attributes are valid 
    46         if (!is_numeric($height)) $height = get_option('cets_embedGmaps_height', 425); 
    47         if (!is_numeric($width)) $width = get_option('cets_embedGmaps_width',350); 
    48         if (!is_numeric($frameborder)) $frameborder = get_option('cets_embedGmaps_frameborder',0); 
    49         if (!is_numeric($marginheight)) $marginheight = get_option('cets_embedGmaps_marginheight',0); 
    50         if (!is_numeric($marginwidth)) $marginwidth = get_option('cets_embedGmaps_marginwidth',0); 
    51         if ($scrolling != 'auto' && $scrolling != 'yes') $scrolling = get_option('cets_embedGmaps_scrolling','no'); 
     40        if (!is_numeric($height)) $height = 425; 
     41        if (!is_numeric($width)) $width = 350; 
     42        if (!is_numeric($frameborder)) $frameborder = 0; 
     43        if (!is_numeric($marginheight)) $marginheight = 0; 
     44        if (!is_numeric($marginwidth)) $marginwidth = 0; 
     45        if ($scrolling != 'auto' && $scrolling != 'yes') $scrolling = 'no'; 
    5246         
    5347        // take the link and make the iframe embed stuff. 
     
    5650        return $return; 
    5751         
    58     } 
    59  
    60      
     52    }    
    6153} 
    6254 
    6355// let's use it 
    6456$cets_EmbedGmapsShortcodes = new cets_EmbedGmaps_Shortcodes;     
    65  
    66 ?> 
  • google-maps-embed/trunk/readme.txt

    r260900 r631976  
    11=== Google Maps Embed === 
    2 Contributors: DeannaS, kgraeme 
    3 Tags: google maps, WPMU 
    4 Requires at least: 2.7 
    5 Tested up to: 3.0  
     2Contributors: DeannaS, kgraeme, MadtownLems 
     3Tags: google maps 
     4Requires at least: 3.0 
     5Tested up to: 3.4.2 
    66Stable tag: trunk 
    77 
    88 
    99 
    10 Tiny MCE button for embedding a google map via google maps' link. No API key needed. Also includes shortcode ability. 
     10Tiny MCE button for embedding a google map via google maps link. No API key needed. Also includes shortcode ability. 
    1111 
    1212== Description == 
    1313 
    14 If getting an API key is beyond the skill set or desires of your users, but they still want to be able to have a Google map, this plugin is the answer. It adds a button to the visual editor that allows them to use the link from Google Maps to embed a plugin. Blog administrators can set defaults for width, height, marginwidth, marginheight, frameborder, and scrolling properties for the embed code. Users can override these defaults when they are creating a post or page. Power users can directly enter a shortcode in a post, page or widget. Shortcode should be entered in the following format: 
     14If getting an API key is beyond the skill set or desires of your users, but they still want to be able to have a Google map, this plugin is the answer. It adds a button to the visual editor that allows them to use the link from Google Maps to embed a plugin. Authors can embed maps and set width, height, marginwidth, marginheight, frameborder, and scrolling properties. Power users can directly enter a shortcode in a post, page or widget. Shortcode should be entered in the following format: 
    1515 
    1616[cetsEmbedGmap src=http://maps.google.com/?ie=UTF8&ll=37.0625,-95.677068&spn=53.609468,107.138672&z=4 width=350 height=425 marginwidth=0 marginheight=0 frameborder=0 scrolling=no] 
     
    24241. Place the cets\_EmbedGmaps folder in the wp-content/plugins folder. 
    25251. Activate via the plugin activation screens. 
    26 1. If upgrading from 1.3.1 to 1.4, you can delete the cets\_embedGmaps\_config.php file and the tinymce\window.php file. 
     261. If upgrading from 1.3.1 to 1.4+, you can delete the cets\_embedGmaps\_config.php file and the tinymce\window.php file. 
    2727 
    2828 
     
    4040 
    4141== Changelog == 
     421.12 - cleaning up and syncing with local version for better support going forward 
     43 
     441.10 - add support for https URLs 
     45 
     461.6 - IMPORTANT: This version removes the Settings Page and ability to save or use default settings. You must now set each map setting on each map 
     47 
    42481.5 - allowed for regional version of maps.google to be used. Tested on 3.0 
    4349 
  • google-maps-embed/trunk/tinymce/tinymce.php

    r206751 r631976  
    1111     
    1212    function add_cets_EmbedGmaps_button()  { 
     13         
    1314        // Modify the version when tinyMCE plugins are changed. 
    1415        add_filter('tiny_mce_version', array (&$this, 'change_tinymce_version') ); 
     
    2021    function addbuttons() { 
    2122         
     23 
    2224        // Don't bother doing this stuff if the current user lacks permissions 
    2325        if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) return; 
    2426         
     27        $type = $this->cets_get_post_type(); 
     28        if ($type == 'cets_event') { return; } 
     29 
    2530        // Add only in Rich Editor mode 
    2631        if ( get_user_option('rich_editing') == 'true') { 
     
    2833        // add the button for wp2.5 in a new way 
    2934            add_filter("mce_external_plugins", array (&$this, "add_tinymce_plugin" ), 5); 
    30              
    31             $line = get_option('cets_embedGmaps_line'); 
    32             if ( 1 == $line) 
    33                 add_filter( 'mce_buttons', array(&$this, 'register_button') ); 
    34             else 
    35                 add_filter( 'mce_buttons_' . $line, array(&$this, 'register_button') ); 
     35            add_filter( 'mce_buttons_' . 3, array(&$this, 'register_button') ); 
    3636             
    3737             
     
    3939    } 
    4040     
     41 
     42    function cets_get_post_type() { 
     43    //look for post type for new posts/pages 
     44        if ( !isset($_GET['post_type']) ) 
     45            $post_type = 'post'; 
     46        elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) ) 
     47            $post_type = $_GET['post_type']; 
     48             
     49                     
     50        // look for post ID and set post type for editing 
     51        if ( isset($_GET['post']) ) 
     52            $post_id = (int) $_GET['post']; 
     53        elseif ( isset($_POST['post_ID']) ) 
     54            $post_id = (int) $_POST['post_ID']; 
     55        else 
     56            $post_id = 0;    
     57             
     58        if ( $post_id ) { 
     59        $post = get_post($post_id); 
     60        if ( $post ) { 
     61            $post_type_object = get_post_type_object($post->post_type); 
     62            if ( $post_type_object ) { 
     63                $post_type = $post->post_type;       
     64            } 
     65        } 
     66        } elseif ( isset($_POST['post_type']) ) { 
     67            $post_type_object = get_post_type_object($_POST['post_type']); 
     68            if ( $post_type_object ) { 
     69                $post_type = $post_type_object->name; 
     70            } 
     71        } 
     72        return $post_type; 
     73    } 
     74 
     75 
    4176    // used to insert button in wordpress 2.5x editor 
    4277    function register_button($buttons) { 
     
    6297} 
    6398 
    64 // Call it now 
    65 $tinymce_button = new add_cets_EmbedGmaps_button (); 
    6699 
    67 ?> 
     100/* 
     101add_action('plugins_loaded', 'cets_gmaps_button_init'); 
     102function cets_gmaps_button_init() { 
     103*/ 
     104    global $cets_gmaps_embed_tinymce_button;  
     105    $cets_gmaps_embed_tinymce_button = new add_cets_EmbedGmaps_button(); 
     106//} 
Note: See TracChangeset for help on using the changeset viewer.