function clearConf($module, $name) { global $modx; // Check existence and value of exported $query = "SELECT exported FROM " . $modx->getFullTableName('shop_conf') . " WHERE module='" . $module . "' AND " . "name='" . $name . "'"; if (!($result = $modx->db->query($query))) { exit('Query failed: ' . mysql_error()); } if ($modx->db->getRecordCount($result) != 1) { return FALSE; } $row = mysql_fetch_row($result); $query = "DELETE FROM " . $modx->getFullTableName('shop_conf') . " WHERE module='" . $module . "' AND name='" . $name . "'"; if (!($result = $modx->db->query($query))) { exit('Query failed: ' . mysql_error()); } if ($row[0] == 1) { regenConf(); } }
function saveconfig() { global $shop_lang, $modx; $user = $modx->userLoggedIn(); $act = $_GET['act']; if ($user['usertype'] == "manager") { if (!empty($act) && $act == "saveconfig") { foreach ($_GET as $key => $value) { if ($key != "a" && $key != "id" && $key != "act" && $key != "act2" && $key != "act3") { //echo $value; setConf("", $key, $value, 1); } } include_once $modx->config['base_path'] . "manager/processors/cache_sync.class.processor.php"; $sync = new synccache(); $sync->setCachepath($modx->config['base_path'] . "assets/cache/"); $sync->setReport(false); $sync->emptyCache(); // first empty the cache regenConf(); return "<span class='ok'>" . $shop_lang['saveok'] . "</span>"; } } }