added: function: mkdir
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@471 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
10
core/db.cpp
10
core/db.cpp
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user