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) 2013-2014, Tomasz Sowa
|
||||
* Copyright (c) 2013-2021, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -63,13 +63,23 @@ bool ImgCrop::HasAccess()
|
||||
|
||||
void ImgCrop::GetDirContent()
|
||||
{
|
||||
iq.sel_type = Item::file;
|
||||
iq.sel_content = false;
|
||||
// iq.sel_type = Item::file;
|
||||
// iq.sel_content = false;
|
||||
//
|
||||
// iq.WhereParentId(cur->request->dir_tab.back()->id);
|
||||
// iq.WhereFileType(WINIX_ITEM_FILETYPE_IMAGE);
|
||||
|
||||
iq.WhereParentId(cur->request->dir_tab.back()->id);
|
||||
iq.WhereFileType(WINIX_ITEM_FILETYPE_IMAGE);
|
||||
morm::Finder<Item> finder(model_connector);
|
||||
|
||||
db->GetItems(cur->request->item_tab, iq);
|
||||
cur->request->item_tab = finder.
|
||||
select().
|
||||
where().
|
||||
eq(L"type", static_cast<int>(Item::file)).
|
||||
eq(L"parent_id", cur->request->dir_tab.back()->id).
|
||||
eq(L"content.file_type", WINIX_ITEM_FILETYPE_IMAGE).
|
||||
get_vector();
|
||||
|
||||
//db->GetItems(cur->request->item_tab, iq);
|
||||
system->CheckWriteAccessToItems(cur->request->item_tab);
|
||||
}
|
||||
|
||||
@@ -89,7 +99,7 @@ void ImgCrop::MakePost()
|
||||
|
||||
Item & item = cur->request->item;
|
||||
|
||||
if( cur->request->is_item && item.type == Item::file && item.file_type == WINIX_ITEM_FILETYPE_IMAGE )
|
||||
if( cur->request->is_item && item.type == Item::file && item.item_content.file_type == WINIX_ITEM_FILETYPE_IMAGE )
|
||||
{
|
||||
if( system->HasWriteAccess(item) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user