/** * Performs a quick check for plugin install state. * Also updates plugin options as needed. This handles minor updates * (i.e. no database changes). * * @access public * @static */ function check() { $is_installed = get_option('agm_google_maps', false); if ($is_installed) { return AgmPluginInstaller::check_and_update_options($is_installed); } else { AgmPluginInstaller::install(); } }
function json_reset_options() { $status = false; if (current_user_can('manage_options')) { $installer = new AgmPluginInstaller(); $installer->set_default_options(); $status = true; } header('Content-type: application/json'); echo json_encode(array('status' => $status ? 1 : 0)); exit; }
$textdomain_handler = 'load_plugin_textdomain'; } else { // No textdomain is loaded because we can't determine the plugin location. // No point in trying to add textdomain to string and/or localizing it. wp_die(__('There was an issue determining where Google Maps plugin is installed. Please reinstall.')); } } } $textdomain_handler('agm_google_maps', false, AGM_PLUGIN_SELF_DIRNAME . '/languages/'); // Post Indexer (http://premium.wpmudev.org/project/post-indexer) integration define('AGM_USE_POST_INDEXER', function_exists('post_indexer_make_current'), true); require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_map_model.php'; require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_maps_widget.php'; require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_plugin_installer.php'; register_activation_hook(__FILE__, array('AgmPluginInstaller', 'install')); AgmPluginInstaller::check(); add_action('widgets_init', create_function('', "register_widget('AgmMapsWidget');")); if (is_admin()) { require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_admin_help.php'; } require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_plugins_handler.php'; AgmPluginsHandler::init(); if (is_admin()) { require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_admin_form_renderer.php'; require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_admin_maps.php'; AgmAdminMaps::serve(); } else { require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_marker_replacer.php'; require_once AGM_PLUGIN_BASE_DIR . '/lib/class_agm_user_maps.php'; AgmUserMaps::serve(); }