Ejemplo n.º 1
0
';
            continue;
        } else {
            $item .= 'item' . $val['pid'] . '.add(item' . $val['id'] . ');
';
            continue;
        }
    }
    $tp->set_templatefile('templates/category_add.html');
    $tp->assign('tree', $tree);
    $tp->assign('root', $root);
    $tp->assign('item', $item);
    $tp->assign('option', $option);
    $moduleTemplate = $tp->result();
    $moduleTitle = '添加采集器分类';
} else {
    if (!$_POST['title']) {
        error('分类名称不能为空!');
    }
    !$_POST['orderid'] ? $maxOrderID = $NC->getNodeMaxOrderID($_POST['pid']) : ($maxOrderID = $_POST['orderid']);
    $data['id'] = '';
    $data['pid'] = $_POST['pid'];
    $data['title'] = $_POST['title'];
    $data['orderid'] = $maxOrderID;
    $NC->addCategory($data);
    $catearray = $NC->getCategory();
    $getarray = $NC->getTree($catearray, 0, 0, 'category');
    $NC->doCategoryCache($getarray);
    showloading('?module=listCategory', '分类添加', '分类添加完毕,现在返回分类列表', 1);
    $tpShowBody = false;
}