} if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['csrf']) && check_csrf($_POST['csrf'], 'slider_csrf')) { if (isset($_POST['popshop_account']) && isset($_POST['popshop_catalog'])) { //update account if (actions::set_option(array('popshop_account' => $_POST['popshop_account'], 'popshop_catalog' => $_POST['popshop_catalog'], 'cj_ipp' => $_POST['cj_ipp']))) { echo '<div class="a-success">Saved!</div>'; } else { echo '<div class="a-error">Error!</div>'; } } else { if (isset($_POST['catid']) && isset($_POST['catid_old'])) { foreach ($_POST['catid'] as $id => $catid) { $catid = intval($catid); if ($catid != 0) { $catid_old = intval($_POST['catid_old'][$id]); \plugin\Popshop\inc\actions::setMerchantTypeMapping(intval($id), $catid, $catid_old); } } echo '<div class="a-success">Saved!</div>'; } } } $csrf = $_SESSION['slider_csrf'] = \site\utils::str_random(10); switch ($_GET['action']) { default: echo '<script> function dosync(full){ var infotext = "Please do NOT close! Updating"; var intervalR = setInterval(function(){ infotext+=".";$("#popshop_sync_info").html(infotext); }, 500);