added: function: mkdir

git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@471 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2008-12-31 13:36:46 +00:00
parent 3e328932fc
commit 114b5724f8
18 changed files with 77 additions and 22 deletions

View File

@@ -401,13 +401,14 @@ Error Db::AddItemIntoItem(Item & item)
{
AssertConnection();
std::ostringstream query;
query << "insert into core.item (user_id, group_id, privileges, type, parent_id, content_id, url) values (";
query << "insert into core.item (user_id, group_id, privileges, type, parent_id, content_id, default_item, url) values (";
query << '\'' << item.user_id << "', ";
query << '\'' << item.group_id << "', ";
query << '\'' << item.privileges << "', ";
query << '\'' << static_cast<int>(item.type) << "', ";
query << '\'' << item.parent_id << "', ";
query << '\'' << item.content_id << "', ";
query << '\'' << item.default_item << "', ";
url_without_id = AddItemCreateUrlSubject(item);
@@ -473,8 +474,13 @@ return result;
Error Db::AddItem(Item & item)
{
Error result = AddItemIntoContent(item);
Error result = Error::ok;
if( item.type == Item::file )
result = AddItemIntoContent(item);
else
item.content_id = -1;
if( result == Error::ok )
result = AddItemIntoItem(item);