<h2>' . esc_html__('Experiments', 'better-analytics') . ' <a href="' . add_query_arg(array('action' => 'create_edit'), esc_url(menu_page_url('better-analytics_experiments', false))) . '" class="add-new-h2">' . esc_html__('Add New', 'better-analytics') . '</a>' . '</h2> <form method="post" action="' . esc_url(menu_page_url('better-analytics_experiments', false)) . '"> <input type="hidden" name="page" value="better-analytics_experiments"/>'; echo $noticeAtTop; if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'activate') { /* translators: %1$s = <strong>, %2$s = </strong> */ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf(esc_html__('Experiment %1$sactivated%2$s.'), '<strong>', '</strong>') . '</p></div>'; } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'activate-selected') { /* translators: %1$s = <strong>, %2$s = </strong> */ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf(esc_html__('Selected experiments %1$sactivated%2$s.'), '<strong>', '</strong>') . '</p></div>'; } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'deactivate') { /* translators: %1$s = <strong>, %2$s = </strong> */ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf(esc_html__('Experiment %1$sdeactivated%2$s.'), '<strong>', '</strong>') . '</p></div>'; } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'deactivate-selected') { /* translators: %1$s = <strong>, %2$s = </strong> */ echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf(esc_html__('Selected experiments %1$sdeactivated%2$s.'), '<strong>', '</strong>') . '</p></div>'; } global $totals; $experiments = $totals = array(); if ($profile = $reportingClass->getProfileByProfileId($betterAnalyticsOptions['api']['profile'])) { $experiments = DigitalPointBetterAnalytics_Model_Experiments::getAllExperiments($profile['accountId'], $profile['webPropertyId'], $profile['id']); $totals = DigitalPointBetterAnalytics_Model_Reporting::getExperimentTotals($experiments); } $goalTable = new DigitalPointBetterAnalytics_Formatting_ExperimentTable(array('plural' => 'experiments', 'experiments' => $experiments)); $goalTable->prepare_items(); $goalTable->views(); $goalTable->display(); echo '</form></div>'; } }