PluginProbe
Extensions for Leaflet Map / 5.4
Extensions for Leaflet Map v5.4
5.4 5.3 5.2 5.1 4.8 4.9 5.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.5 2.0 2.0.1 2.0.2 2.0.3 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 All 88 releases
extensions-leaflet-map / extensions-leaflet-map.php

extensions-leaflet-map.php in Extensions for Leaflet Map 5.4, at extensions-leaflet-map.php

132 lines 4.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Extensions for Leaflet Map
4 * Description: Extends the WordPress Plugin <a href="https://wordpress.org/plugins/leaflet-map/">Leaflet Map</a> with Leaflet Plugins and other functions.
5 * Plugin URI: https://leafext.de/en/
6 * Version: 5.4
7 * Requires PHP: 8.2
8 * Requires Plugins: leaflet-map
9 * Author: hupe13
10 * Author URI: https://leafext.de/en/
11 * License: GPL v2 or later
12 *
13 * @package Extensions for Leaflet Map
14 **/
15
16 // Direktzugriff auf diese Datei verhindern.
17 defined( 'ABSPATH' ) || die();
18
19 define( 'LEAFEXT_PLUGIN_FILE', __FILE__ ); // /pfad/wp-content/plugins/extensions-leaflet-map/extensions-leaflet-map.php .
20 define( 'LEAFEXT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); // /pfad/wp-content/plugins/extensions-leaflet-map-github/ .
21 define( 'LEAFEXT_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); // https://url/wp-content/plugins/extensions-leaflet-map-github/ .
22 define( 'LEAFEXT_PLUGIN_PICTS', LEAFEXT_PLUGIN_URL . 'pict/' ); // https://url/wp-content/plugins/extensions-leaflet-map-github/pict/ .
23 define( 'LEAFEXT_PLUGIN_SETTINGS', dirname( plugin_basename( __FILE__ ) ) ); // extensions-leaflet-map-github .
24
25 if ( ! function_exists( 'get_plugin_data' ) ) {
26 require_once ABSPATH . 'wp-admin/includes/plugin.php';
27 }
28 // string $plugin_file, bool $markup = true, bool $translate = true
29 $leafext_plugin_data = get_plugin_data( __FILE__, true, false );
30 define( 'LEAFEXT_VERSION', $leafext_plugin_data['Version'] );
31
32 if ( ! function_exists( 'leafext_plugin_active' ) ) {
33 function leafext_plugin_active( $slug ) {
34 $plugins = get_option( 'active_plugins' );
35 if ( is_array( $plugins ) ) {
36 $is_active = preg_grep( '/^.*\/' . $slug . '\.php$/', $plugins );
37 if ( count( $is_active ) === 1 ) {
38 return true;
39 }
40 }
41 $plugins = get_site_option( 'active_sitewide_plugins' );
42 if ( is_array( $plugins ) ) {
43 $is_active = preg_grep( '/^.*\/' . $slug . '\.php$/', array_flip( $plugins ) );
44 if ( count( $is_active ) === 1 ) {
45 return true;
46 }
47 }
48 return false;
49 }
50 }
51
52 if ( is_admin() ) {
53 require_once __DIR__ . '/admin.php';
54 }
55
56 require_once __DIR__ . '/php/enqueue-leafletplugins.php';
57 require_once __DIR__ . '/php/functions.php';
58 require_once __DIR__ . '/pkg/JShrink/Minifier.php';
59
60 require_once __DIR__ . '/php/elevation.php';
61 require_once __DIR__ . '/php/sgpx.php';
62 require_once __DIR__ . '/php/multielevation.php';
63
64 require_once __DIR__ . '/php/fullscreen.php';
65 require_once __DIR__ . '/php/gesture.php';
66
67 require_once __DIR__ . '/php/hover.php';
68 require_once __DIR__ . '/php/hoverlap.php';
69
70 require_once __DIR__ . '/php/markercluster.php';
71 require_once __DIR__ . '/php/placementstrategies.php';
72 require_once __DIR__ . '/php/clustergroup.php';
73 require_once __DIR__ . '/php/featuregroup.php';
74 require_once __DIR__ . '/php/parentgroup.php';
75
76 require_once __DIR__ . '/php/extramarker.php';
77 require_once __DIR__ . '/php/geojsonmarker.php';
78 require_once __DIR__ . '/php/extramarker-geojson.php';
79
80 require_once __DIR__ . '/php/hidemarkers.php';
81
82 require_once __DIR__ . '/php/choropleth.php';
83
84 require_once __DIR__ . '/php/zoomhome.php';
85
86 require_once __DIR__ . '/php/tileserver.php';
87
88 require_once __DIR__ . '/php/leaflet-search.php';
89
90 require_once __DIR__ . '/php/leaflet-directory.php';
91 require_once __DIR__ . '/php/managefiles.php';
92
93 require_once __DIR__ . '/php/overview-map.php';
94 require_once __DIR__ . '/php/featured-map.php';
95 require_once __DIR__ . '/php/targetmarker.php';
96 require_once __DIR__ . '/php/listmarker.php';
97
98 /**
99 * Add settings to plugin page.
100 */
101 function leafext_add_action_links( $actions ) {
102 $actions[] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=' . LEAFEXT_PLUGIN_SETTINGS ) ) . '">' . esc_html__( 'Settings', 'extensions-leaflet-map' ) . '</a>';
103 return $actions;
104 }
105 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'leafext_add_action_links' );
106
107 /**
108 * For translating elevation.
109 */
110 function leafext_extra_textdomain( $mofile, $domain ) {
111 if ( 'extensions-leaflet-map' === $domain ) {
112 if ( file_exists( LEAFEXT_PLUGIN_DIR . '/lang/extensions-leaflet-map-' . get_locale() . '.mo' ) ) {
113 $mofile = LEAFEXT_PLUGIN_DIR . '/lang/extensions-leaflet-map-' . get_locale() . '.mo';
114 }
115 }
116 return $mofile;
117 }
118 add_filter( 'load_textdomain_mofile', 'leafext_extra_textdomain', 10, 2 );
119
120 // Disable activation the other of WP / Github Version
121 if ( ! function_exists( 'leafext_disable_extensions_activation' ) ) {
122 function leafext_disable_extensions_activation( $actions, $plugin_file ) {
123 if ( array_key_exists( 'activate', $actions ) ) {
124 if ( basename( $plugin_file ) === basename( __FILE__ ) ) {
125 $actions['activate'] = wp_strip_all_tags( $actions['activate'] );
126 }
127 }
128 return $actions;
129 }
130 }
131 add_filter( 'plugin_action_links', 'leafext_disable_extensions_activation', 10, 2 );
132