Item class has been moved to a new directory 'models', a new class has been added: ItemContent
and same fields from Item were moved to ItemContent Item - id - parent_id - type (file, dir, symlink) - url - subject - template (html template) - sort_index - content_id ItemContent - id - ref -> references (renamed) - user_id - modification_user_id - group_id - privileges - date_creation - date_modification - guest_name - link_to - link_redirect - file_path - file_fs - file_type - file_size - has_thumb -> file_has_thumb (renamed) - hash -> file_hash (renamed) - hash_type -> file_hash_type (renamed) - content -> content_raw (renamed) - content_type -> content_raw_type (renamed) - content_parsed - content_parsed_type - meta - ameta -> meta_admin (renamed) - modify_index (removed) WIP: #4
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011-2018, Tomasz Sowa
|
||||
* Copyright (c) 2011-2021, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -188,7 +188,7 @@ void ExportInfo::SendFile(const Item & item, bool thumb, bool put_to_recurrence_
|
||||
system->dirs.MakePath(item.parent_id, msg.path);
|
||||
msg.path += item.url;
|
||||
|
||||
if( item.file_type != WINIX_ITEM_FILETYPE_NONE )
|
||||
if( item.item_content.file_type != WINIX_ITEM_FILETYPE_NONE )
|
||||
{
|
||||
msg.type = WINIX_PL_EXPORT_TYPE_CREATE_FILE_STATIC;
|
||||
|
||||
@@ -220,7 +220,7 @@ void ExportInfo::SendFile(const Item & item, bool thumb, bool put_to_recurrence_
|
||||
msg.http_server = exp.http_server;
|
||||
system->dirs.MakePath(exp_dir->dir_id, msg.src_dir);
|
||||
|
||||
if( !item.file_path.empty() && thumb ) // !! uzyc file_type
|
||||
if( !item.item_content.file_path.empty() && thumb ) // !! uzyc file_type
|
||||
msg.path.insert(0, L"/download"); // !! do konfiga
|
||||
|
||||
if( !exp.ftp_dir.empty() )
|
||||
@@ -299,15 +299,26 @@ void ExportInfo::SendDir(long dir_id)
|
||||
// send all non-static files from a directory
|
||||
void ExportInfo::SendAllFilesFromDir(long dir_id)
|
||||
{
|
||||
iq_dir.SetAll(false, false);
|
||||
iq_dir.sel_parent_id = true;
|
||||
iq_dir.sel_url = true;
|
||||
iq_dir.sel_file = true;
|
||||
iq_dir.WhereParentId(dir_id);
|
||||
iq_dir.WhereType(Item::file);
|
||||
iq_dir.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||
// iq_dir.SetAll(false, false);
|
||||
// iq_dir.sel_parent_id = true;
|
||||
// iq_dir.sel_url = true;
|
||||
// iq_dir.sel_file = true;
|
||||
// iq_dir.WhereParentId(dir_id);
|
||||
// iq_dir.WhereType(Item::file);
|
||||
// iq_dir.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||
|
||||
db->GetItems(dir_items, iq_dir);
|
||||
|
||||
morm::Finder<Item> finder(model_connector);
|
||||
|
||||
finder.
|
||||
select().
|
||||
where().
|
||||
eq(L"parent_id", dir_id).
|
||||
eq(L"type", static_cast<int>(Item::file)).
|
||||
eq(L"content.file_type", WINIX_ITEM_FILETYPE_NONE).
|
||||
get_vector(dir_items);
|
||||
|
||||
//db->GetItems(dir_items, iq_dir);
|
||||
|
||||
for(size_t i=0 ; i<dir_items.size() ; ++i)
|
||||
{
|
||||
@@ -319,10 +330,10 @@ void ExportInfo::SendAllFilesFromDir(long dir_id)
|
||||
|
||||
void ExportInfo::AdditionalExport(const Item & item)
|
||||
{
|
||||
for(size_t i=0 ; i<item.meta.spaces.size() ; ++i)
|
||||
for(size_t i=0 ; i<item.item_content.meta.spaces.size() ; ++i)
|
||||
{
|
||||
if( item.meta.spaces[i]->name == L"export" )
|
||||
AdditionalExport(item, *item.meta.spaces[i]);
|
||||
if( item.item_content.meta.spaces[i]->name == L"export" )
|
||||
AdditionalExport(item, *item.item_content.meta.spaces[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user