Exemplo n.º 1
0
function wpgmaps_menu_layout()
{
    $handle = 'avia-google-maps-api';
    $list = 'enqueued';
    if (wp_script_is($handle, $list)) {
        wp_deregister_script('avia-google-maps-api');
    }
    //check to see if we have write permissions to the plugin folder
    if (!isset($_GET['action'])) {
        wpgmza_map_page();
    } else {
        echo "<br /><div style='float:right; display:block; width:250px; height:65px; padding:6px; text-align:center; background-color: #EEE; border: 1px solid #E6DB55; margin-right:17px;'><strong>" . __("Experiencing problems with the plugin?", "wp-google-maps") . "</strong><br /><a href='http://www.wpgmaps.com/documentation/troubleshooting/' title='WP Google Maps Troubleshooting Section' target='_BLANK'>" . __("See the troubleshooting manual.", "wp-google-maps") . "</a> <br />" . __("Or ask a question on our ", "wp-google-maps") . " <a href='http://www.wpgmaps.com/forums/forum/support-forum/' title='WP Google Maps Support Forum' target='_BLANK'>" . __("Support forum.", "wp-google-maps") . "</a></div>";
        if ($_GET['action'] == "trash" && isset($_GET['map_id'])) {
            if ($_GET['s'] == "1") {
                if (wpgmaps_trash_map($_GET['map_id'])) {
                    //wp_redirect( admin_url('admin.php?page=wp-google-maps-menu') );
                    echo "<script>window.location = \"" . get_option('siteurl') . "/wp-admin/admin.php?page=wp-google-maps-menu\"</script>";
                } else {
                    _e("There was a problem deleting the map.");
                }
            } else {
                $res = wpgmza_get_map_data($_GET['map_id']);
                echo "<h2>" . __("Delete your map", "wp-google-maps") . "</h2><p>" . __("Are you sure you want to delete the map", "wp-google-maps") . " <strong>\"" . $res->map_title . "?\"</strong> <br /><a href='?page=wp-google-maps-menu&action=trash&map_id=" . $_GET['map_id'] . "&s=1'>" . __("Yes", "wp-google-maps") . "</a> | <a href='?page=wp-google-maps-menu'>" . __("No", "wp-google-maps") . "</a></p>";
            }
        } else {
            if ($_GET['action'] == "edit_marker" && isset($_GET['id'])) {
                wpgmza_edit_marker(sanitize_text_field($_GET['id']));
            } else {
                if ($_GET['action'] == "add_poly" && isset($_GET['map_id'])) {
                    if (function_exists("wpgmza_b_real_pro_add_poly")) {
                        wpgmza_b_real_pro_add_poly(sanitize_text_field($_GET['map_id']));
                    } else {
                        wpgmza_b_pro_add_poly(sanitize_text_field($_GET['map_id']));
                    }
                } else {
                    if ($_GET['action'] == "edit_poly" && isset($_GET['map_id'])) {
                        if (function_exists("wpgmza_b_real_pro_edit_poly")) {
                            wpgmza_b_real_pro_edit_poly(sanitize_text_field($_GET['map_id']));
                        } else {
                            wpgmza_b_pro_edit_poly(sanitize_text_field($_GET['map_id']));
                        }
                    } else {
                        if ($_GET['action'] == "add_polyline" && isset($_GET['map_id'])) {
                            wpgmza_b_pro_add_polyline(sanitize_text_field($_GET['map_id']));
                        } else {
                            if ($_GET['action'] == "edit_polyline" && isset($_GET['map_id'])) {
                                wpgmza_b_pro_edit_polyline(sanitize_text_field($_GET['map_id']));
                            } else {
                                if ($_GET['action'] == 'welcome_page') {
                                    $file = dirname(__FILE__) . '/base/classes/WPGM_templates.php';
                                    include $file;
                                    $wpgmc = new WPGMAPS_templates();
                                    $wpgmc->welcome_page();
                                } else {
                                    if (function_exists('wpgmza_register_pro_version')) {
                                        $prov = get_option("WPGMZA_PRO");
                                        $wpgmza_pro_version = $prov['version'];
                                        if (floatval($wpgmza_pro_version) < 5.41) {
                                            wpgmaps_upgrade_notice();
                                            wpgmza_pro_menu();
                                        } else {
                                            wpgmza_pro_menu();
                                        }
                                    } else {
                                        wpgmza_basic_menu();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Exemplo n.º 2
0
function wpgmaps_menu_layout()
{
    //check to see if we have write permissions to the plugin folder
    //
    //
    wpgmaps_debugger("menu_start");
    if (!$_GET['action']) {
        wpgmza_map_page();
    } else {
        if ($_GET['action'] == "trash" && isset($_GET['map_id'])) {
            if ($_GET['s'] == "1") {
                if (wpgmaps_trash_map($_GET['map_id'])) {
                    //wp_redirect( admin_url('admin.php?page=wp-google-maps-menu') );
                    echo "<script>window.location = \"" . get_option('siteurl') . "/wp-admin/admin.php?page=wp-google-maps-menu\"</script>";
                } else {
                    _e("There was a problem deleting the map.");
                }
            } else {
                $res = wpgmza_get_map_data($_GET['map_id']);
                echo "<h2>" . __("Delete your map", "wp-google-maps") . "</h2><p>" . __("Are you sure you want to delete the map", "wp-google-maps") . " <strong>\"" . $res->map_title . "?\"</strong> <br /><a href='?page=wp-google-maps-menu&action=trash&map_id=" . $_GET['map_id'] . "&s=1'>" . __("Yes", "wp-google-maps") . "</a> | <a href='?page=wp-google-maps-menu'>" . __("No", "wp-google-maps") . "</a></p>";
            }
        } else {
            if ($_GET['action'] == "edit_marker" && isset($_GET['id'])) {
                wpgmza_edit_marker($_GET['id']);
            } else {
                if (function_exists(wpgmza_register_pro_version)) {
                    $prov = get_option("WPGMZA_PRO");
                    $wpgmza_pro_version = $prov['version'];
                    if (floatval($wpgmza_pro_version) < 4.01 || $wpgmza_pro_version == null) {
                        wpgmaps_upgrade_notice();
                        wpgmza_pro_menu();
                    } else {
                        wpgmza_pro_menu();
                    }
                } else {
                    wpgmza_basic_menu();
                }
            }
        }
    }
    wpgmaps_debugger("menu_end");
}