Add page for permissions asking

[MAILPOET-1856]
This commit is contained in:
Pavel Dohnal
2019-05-13 13:43:10 +02:00
committed by M. Shull
parent 5d1623a083
commit 4f42537fe7
6 changed files with 78 additions and 1 deletions

View File

@ -360,6 +360,19 @@ class Menu {
]
);
// WooCommerce List Import
$this->wp->addSubmenuPage(
true,
$this->setPageTitle($this->wp->__('Track WooCommerce revenues with cookies', 'mailpoet')),
$this->wp->__('Track WooCommerce revenues with cookies', 'mailpoet'),
AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN,
'mailpoet-revenue-tracking-permission',
array(
$this,
'revenueTrackingPermission'
)
);
// Update page
$this->wp->addSubmenuPage(
true,
@ -432,6 +445,17 @@ class Menu {
$this->displayPage('woocommerce_list_import.html', $data);
}
function revenueTrackingPermission() {
if (!$this->settings->get('display_revenues')) {
return;
}
if ((bool)(defined('DOING_AJAX') && DOING_AJAX)) return;
$data = [
'finish_wizard_url' => $this->wp->adminUrl('admin.php?page=' . self::MAIN_PAGE_SLUG),
];
$this->displayPage('revenue_tracking_permission.html', $data);
}
function update() {
global $wp;
$current_url = $this->wp->homeUrl(add_query_arg($wp->query_string, $wp->request));