function getMenuCodeToSql($table, $cat, $f) { static $sql; $R = getUidData($table, $cat); if ($R['uid']) { $sql .= $f . '=' . $R['uid'] . ' or '; } if ($R['isson']) { $RDATA = getDbSelect($table, 'parent=' . $R['uid'], 'uid'); while ($C = db_fetch_array($RDATA)) { getMenuCodeToSql($table, $C['uid'], $f); } } return substr($sql, 0, strlen($sql) - 4); }
unlink($vfile . '.footer.php'); } } if ($cachetime) { $fp = fopen($vfile . '.txt', 'w'); fwrite($fp, $cachetime); fclose($fp); @chmod($vfile . '.txt', 0707); } else { if (is_file($vfile . '.txt')) { unlink($vfile . '.txt'); } } if ($subcopy == 1) { include_once $g['path_core'] . 'function/menu.func.php'; $subQue = getMenuCodeToSql($table['s_menu'], $cat, 'uid'); if ($subQue) { getDbUpdate($table['s_menu'], "hidden='" . $hidden . "',reject='" . $reject . "',perm_g='" . $perm_g . "',perm_l='" . $perm_l . "',layout='" . $layout . "'", "uid <> " . $cat . " and (" . $subQue . ")"); } } getLink('reload', 'parent.', '', ''); } else { $MAXC = getDbCnt($table['s_menu'], 'max(gid)', 'depth=' . ($depth + 1) . ' and parent=' . $parent); $sarr = explode(',', trim($name)); $slen = count($sarr); for ($i = 0; $i < $slen; $i++) { if (!$sarr[$i]) { continue; } $gid = $MAXC + 1 + $i; $xdepth = $depth + 1;
<?php if (!defined('__KIMS__')) { exit; } checkAdmin(0); if (!$cat) { getLink($g['r'] . '/?m=admin&module=' . $m, 'parent.', '', ''); } include_once $g['path_core'] . 'function/menu.func.php'; $subQue = getMenuCodeToSql($table['s_domain'], $cat, 'uid'); if ($subQue) { $DAT = db_query('select * from ' . $table['s_domain'] . ' where ' . $subQue, $DB_CONNECT); while ($R = db_fetch_array($DAT)) { db_query('delete from ' . $table['s_domain'] . ' where uid=' . $R['uid'], $DB_CONNECT); } if ($parent) { if (!getDbRows($table['s_domain'], 'parent=' . $parent)) { db_query('update ' . $table['s_domain'] . ' set is_child=0 where uid=' . $parent, $DB_CONNECT); } } } getLink($g['s'] . '/?r=' . $r . '&m=admin&module=' . $m . '&cat=' . $parent . '&code=' . $code, 'parent.', '', '');