/** * изменение */ public function action_applyed() { Tools::debug($_GET); Tools::debug($_POST); if (isset($_GET["fid"]) && !empty($_POST["cval"])) { $id = (int) $_GET["fid"]; $files = $this->model->getFileList(); if (!empty($files[$id])) { $path = "build" . DIRECTORY_SEPARATOR . $_SESSION["mwccfgread"] . DIRECTORY_SEPARATOR . "lang" . DIRECTORY_SEPARATOR . $_SESSION["mwclang"] . DIRECTORY_SEPARATOR . $files[$id] . ".php"; if (file_exists($path)) { require $path; if (empty($_POST["cname"])) { $i = 1; while (!empty($lang["auto_lang" . $i])) { $i++; } $_POST["cname"] = "auto_lang{$i}"; } $lang[$_POST["cname"]] = $_POST["cval"]; $ai = new ArrayIterator($lang); $content = '<?php '; foreach ($ai as $id => $val) { $content .= '$lang["' . $id . '"]="' . $val . '"; '; } $fh = fopen($path, "w"); fwrite($fh, $content); fclose($fh); } } } }
public function action_viewhex() { if (!empty($_GET["get"])) { $path = "build/" . tbuild . "/_dat/items/harmony.php"; if (file_exists($path)) { require $path; } else { $harm = array(); } Tools::debug(rItem::Read($_GET["get"], $harm)); //читаем вещь } }
/** * удалить параметр из конфига */ public function action_delpos() { if (!empty($_GET["pos"]) && !empty($_GET["c"])) { $cfgName = $_GET["c"]; $params = $_GET["pos"]; $cfg_ = Configs::readCfg($cfgName, $_SESSION["mwccfgread"]); if (isset($cfg_[$params])) { Tools::debug($cfg_[$params]); unset($cfg_[$params]); Configs::writeCfg($cfg_, $cfgName, $_SESSION["mwccfgread"]); } } }