function doAction() { $action = getaction(); //если есть экшин- выполняем if (file_exists(__corePath . "actions/{$action}.php")) { include __corePath . "actions/{$action}.php"; $action = new action($this->db); $action->execute(); } }
function parsechoice() { global $cfg, $mysql, $session; $tosend = ""; $res = $mysql->select("SELECT * from `" . $cfg["usercp"]["table"]["cat"] . "` ORDER BY `" . $cfg["usercp"]["column"]["cat"]["order"] . "` ASC"); if ($res === false) { return false; } for ($i = 0; $i < count($res); $i++) { $cat = getcat($res[$i][$cfg["usercp"]["column"]["cat"]["name"]]); $r = $mysql->select("SELECT * from `" . $cfg["usercp"]["table"]["actions"] . "` WHERE " . $cfg["usercp"]["column"]["actions"]["catid"] . "='" . $res[$i][$cfg["usercp"]["column"]["cat"]["id"]] . "'"); if ($r === false) { return false; } $acts = ""; for ($j = 0; $j < count($r); $j++) { $acts .= getaction($r[$j][$cfg["usercp"]["column"]["actions"]["label"]], $r[$j][$cfg["usercp"]["column"]["actions"]["action"]], $session->getname . "=" . $session->getID()); } $tosend .= getchoice($cat, $acts); } return $tosend; }