-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-backend-dsgvo.php
More file actions
105 lines (102 loc) · 2.69 KB
/
Copy pathgithub-backend-dsgvo.php
File metadata and controls
105 lines (102 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
/**
* Backend Menus
*
* @package DSGVO snippet for Leaflet Map and its Extensions Github Version
**/
// Direktzugriff auf diese Datei verhindern.
defined( 'ABSPATH' ) || die();
/**
* For translating
*/
function leafext_dsgvo_textdomain( $mofile, $domain ) {
if ( 'dsgvo-leaflet-map' === $domain ) {
if ( file_exists( __DIR__ . '/lang/dsgvo-leaflet-map-' . get_locale() . '.mo' ) ) {
$mofile = __DIR__ . '/lang/dsgvo-leaflet-map-' . get_locale() . '.mo';
}
}
return $mofile;
}
add_filter( 'load_textdomain_mofile', 'leafext_dsgvo_textdomain', 10, 2 );
// Updates from Github
function leafext_dsgvo_updates_from_github() {
$name = 'Updates created by hupe13 hosted on GitHub';
$ghu_url = 'https://github.com/hupe13/ghu-update-puc';
$ghu_php_old = 'leafext-update-github.php';
$ghu_settings_old = 'admin.php?page=github-settings">Github settings</a>';
$ghu_php = 'ghu-update-puc.php';
$ghu_settings = 'options-general.php?page=ghu-update-puc">Github Update PUC</a>';
$settings_page = '';
echo '<h2>' . wp_kses_post( 'Updates in WordPress way' ) . '</h2>';
if ( is_multisite() ) {
if ( strpos(
implode(
',',
array_keys(
get_site_option( 'active_sitewide_plugins', array() )
)
),
$ghu_php_old
) !== false ) {
$settings_page = $ghu_settings_old;
} elseif ( strpos(
implode(
',',
array_keys(
get_site_option( 'active_sitewide_plugins', array() )
)
),
$ghu_php
) !== false
) {
$settings_page = $ghu_settings;
}
if ( $settings_page !== '' ) {
echo wp_kses_post(
'To manage and receive updates, open <a href="' .
get_site_url( get_main_site_id() ) .
'/wp-admin/' . $settings_page . '.'
);
} else {
echo wp_kses_post(
'To receive updates, go to the <a href="' .
esc_url( network_admin_url() ) .
'plugins.php">network dashboard</a> and install and network activate ' .
'<a href=' . $ghu_url . '>' . $name . '</a>.'
);
}
} else {
// Single site
if ( strpos(
implode(
',',
get_option( 'active_plugins', array() )
),
$ghu_php_old
) !== false ) {
$settings_page = $ghu_settings_old;
} elseif ( strpos(
implode(
',',
get_option( 'active_plugins', array() )
),
$ghu_php
) !== false ) {
$settings_page = $ghu_settings;
}
if ( $settings_page !== '' ) {
echo wp_kses_post(
'To manage and receive updates, open <a href="' .
esc_url( admin_url() ) .
$settings_page . '.'
);
} else {
echo wp_kses_post(
'To receive updates, go to the <a href="' .
esc_url( admin_url() ) .
'plugins.php">dashboard</a> and install and activate ' .
'<a href=' . $ghu_url . '>' . $name . '</a>.'
);
}
}
}