Пример #1
0
                    updatecache('cnodes', 0, $sid);
                }
                unset($selectid[0]);
                if ($selectid) {
                    $selectstr = implode(',', $selectid);
                    $npage = $pages - count($selectid) + 1;
                    amessage('operating', "?entry={$entry}&action={$action}&selectstr={$selectstr}&arcdeal={$arcdeal}&pages={$pages}&bcnconfigs=1{$param_suffix}", $pages, $npage, "<a href=\"?entry={$entry}&action={$action}{$param_suffix}\">", '</a>');
                }
            } elseif (in_str('ccid', $arcdeal)) {
                //更新结构但不更新节点
                if (!empty($selectid)) {
                    $coid = intval(str_replace('ccid', '', $arcdeal));
                    ${"cnccids{$coid}"} = empty(${"cnccids{$coid}"}) ? array() : ${"cnccids{$coid}"};
                    ${"cnmode{$coid}"} = empty(${"cnmode{$coid}"}) ? 0 : ${"cnmode{$coid}"};
                    foreach ($selectid as $k) {
                        modify_cnconfig(@$cnconfigs[$k], $coid, ${"cnccids{$coid}"}, ${"cnmode{$coid}"});
                    }
                    updatecache('cnconfigs', '', $sid);
                }
            }
        }
        adminlog(lang('update_catas_cnode'));
        amessage('ccnodeupdatefinish', "?entry={$entry}&action={$action}{$param_suffix}");
    }
} elseif ($action == 'cnconfigdetail' && $cncid) {
    $iscopy = empty($iscopy) ? 0 : 1;
    $cnconfig =& $cnconfigs[$cncid];
    $configs =& $cnconfig['configs'];
    if (!submitcheck('bcnconfigdetail')) {
        tabheader(lang('edit') . lang('cncfg'), 'cnconfigdetail', "?entry={$entry}&action={$action}" . ($iscopy ? '&iscopy=1' : '') . "{$param_suffix}&cncid={$cncid}");
        trbasic(lang('config_name'), 'cnconfignew[cname]', $cnconfig['cname'] . ($iscopy ? '-' . lang('copy0') : ''));
Пример #2
0
function relate_cncid($coid, $ccid, $level = 0, $sid = 0, $mode = 0)
{
    //查找是否有某类系的及与变动id有关的单层结构
    if (!$ccid) {
        return false;
    }
    $cncfgs = read_cache('cnconfigs', '', '', $sid);
    $level++;
    $cncid = 0;
    foreach ($cncfgs as $k => $v) {
        if (!empty($v['configs'][$coid]) && count($v['configs']) == 1 && in_array($v['configs'][$coid]['mode'], array(-1, 0, $level))) {
            $cncid = $k;
            if ($v['configs'][$coid]['mode'] == -1) {
                modify_cnconfig($v, $coid, array($ccid), $mode ? 1 : 2);
            }
            break;
        }
    }
    return $cncid;
}