PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 1.3.1
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v1.3.1
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / classes / WpMatomo / Admin / AdminSettings.php
matomo / classes / WpMatomo / Admin Last commit date
TrackingSettings 5 years ago views 5 years ago AccessSettings.php 6 years ago Admin.php 6 years ago AdminSettings.php 6 years ago AdminSettingsInterface.php 6 years ago AdvancedSettings.php 6 years ago Dashboard.php 6 years ago ExclusionSettings.php 6 years ago GeolocationSettings.php 6 years ago GetStarted.php 6 years ago Info.php 6 years ago Marketplace.php 6 years ago Menu.php 5 years ago PrivacySettings.php 5 years ago SafeModeMenu.php 6 years ago Summary.php 5 years ago SystemReport.php 5 years ago TrackingSettings.php 5 years ago
AdminSettings.php
102 lines
1 <?php
2 /**
3 * Matomo - free/libre analytics platform
4 *
5 * @link https://matomo.org
6 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7 * @package matomo
8 */
9
10 namespace WpMatomo\Admin;
11
12 use Piwik\Cache;
13 use Piwik\Option;
14 use Piwik\Plugins\SitesManager\API;
15 use WpMatomo\Access;
16 use WpMatomo\Settings;
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit; // if accessed directly
20 }
21
22 class AdminSettings {
23 const TAB_TRACKING = 'tracking';
24 const TAB_ACCESS = 'access';
25 const TAB_EXCLUSIONS = 'exlusions';
26 const TAB_PRIVACY = 'privacy';
27 const TAB_GEOLOCATION = 'geolocation';
28 const TAB_ADVANCED = 'advanced';
29
30 /**
31 * @var Settings
32 */
33 private $settings;
34
35 public function __construct( Settings $settings ) {
36 $this->settings = $settings;
37 }
38
39 public static function make_url( $tab ) {
40 global $_parent_pages;
41 $menu_slug = Menu::SLUG_SETTINGS;
42
43 if (is_multisite() && is_network_admin()) {
44 if ( isset( $_parent_pages[$menu_slug] ) ) {
45 $parent_slug = $_parent_pages[$menu_slug];
46 if ( $parent_slug && ! isset( $_parent_pages[$parent_slug] ) ) {
47 $url = network_admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );
48 } else {
49 $url = network_admin_url( 'admin.php?page=' . $menu_slug );
50 }
51 } else {
52 $url = '';
53 }
54
55 $url = esc_url( $url );
56 } else {
57 $url = menu_page_url( $menu_slug, false );
58 }
59 return add_query_arg( array( 'tab' => $tab ), $url );
60 }
61
62 public function show() {
63 $access = new Access( $this->settings );
64 $access_settings = new AccessSettings( $access, $this->settings );
65 $tracking = new TrackingSettings( $this->settings );
66 $exclusions = new ExclusionSettings( $this->settings );
67 $geolocation = new GeolocationSettings( $this->settings );
68 $privacy = new PrivacySettings( $this->settings );
69 $advanced = new AdvancedSettings( $this->settings );
70 $setting_tabs = array(
71 self::TAB_TRACKING => $tracking,
72 self::TAB_ACCESS => $access_settings,
73 self::TAB_PRIVACY => $privacy,
74 self::TAB_EXCLUSIONS => $exclusions,
75 self::TAB_GEOLOCATION => $geolocation,
76 self::TAB_ADVANCED => $advanced,
77 );
78
79 $active_tab = self::TAB_TRACKING;
80
81 if ($this->settings->is_network_enabled() && !is_network_admin()){
82 $active_tab = self::TAB_EXCLUSIONS;
83 $setting_tabs = array(
84 self::TAB_EXCLUSIONS => $exclusions,
85 self::TAB_PRIVACY => $privacy,
86 );
87 }
88
89 $setting_tabs = apply_filters( 'matomo_setting_tabs', $setting_tabs, $this->settings );
90
91 if ( ! empty( $_GET['tab'] ) && isset( $setting_tabs[ $_GET['tab'] ] ) ) {
92 $active_tab = $_GET['tab'];
93 }
94
95 $content_tab = $setting_tabs[ $active_tab ];
96 $matomo_settings = $this->settings;
97
98 include dirname( __FILE__ ) . '/views/settings.php';
99 }
100
101 }
102