moved some ezc functions from templates/item.cpp to Item and ItemContent

removed: templates/item.cpp
updated: some html templates which use [item] or [item_tab]
removed some old html templates: item_info.html and itam_tab_info.html
This commit is contained in:
2021-07-06 21:52:29 +02:00
parent 746aa41111
commit 9d65d931d0
24 changed files with 67 additions and 1297 deletions

View File

@@ -92,6 +92,7 @@ void Item::fields()
field(L"execute", &Item::execute);
field(L"has_html_template", &Item::has_html_template);
// may we should add a method setTypeFromInt(int t)?
type = static_cast<Type>(type_helper);
@@ -648,6 +649,11 @@ void Item::execute(EzcEnv & env)
}
bool Item::has_html_template()
{
return !html_template.empty();
}
} // namespace Winix

View File

@@ -197,6 +197,7 @@ public:
bool is_parent_for_current_dir() const;
bool is_current_dir() const;
bool has_html_template();
protected:

View File

@@ -90,6 +90,7 @@ void ItemContent::fields()
field(L"privileges_octal", &ItemContent::privileges_octal);
field(L"has_user", &ItemContent::has_user);
field(L"has_group", &ItemContent::has_group);
field(L"item_users_different", &ItemContent::item_users_different);
field(L"user", &ItemContent::user);
field(L"group", &ItemContent::group);
field(L"type_is", &ItemContent::type_is);
@@ -106,6 +107,12 @@ void ItemContent::fields()
field(L"is_meta_object", &ItemContent::is_meta_object);
field(L"is_admin_meta_object", &ItemContent::is_admin_meta_object);
field(L"are_dates_equal", &ItemContent::are_dates_equal);
field(L"can_content_be_html_filtered", &ItemContent::CanContentBeHtmlFiltered);
field(L"is_link_to", &ItemContent::is_link_to);
field(L"is_link_redirect", &ItemContent::is_link_redirect);
// IMPROVEME prepare a setter functions which tests whether content_raw_type_helper and content_parsed_type_helper are correct values
content_raw_type = static_cast<ContentType>(content_raw_type_helper);
content_parsed_type = static_cast<ContentType>(content_parsed_type_helper);
@@ -450,6 +457,13 @@ bool ItemContent::has_group() const
return group_id != -1;
}
bool ItemContent::item_users_different()
{
return user_id != modification_user_id;
}
void ItemContent::user(morm::Wrapper & wrapper)
{
Users * users = get_users();
@@ -600,17 +614,36 @@ void ItemContent::display_user_name(EzcEnv & env)
}
bool ItemContent::is_meta_object()
bool ItemContent::is_meta_object() const
{
return meta.is_object();
}
bool ItemContent::is_admin_meta_object()
bool ItemContent::is_admin_meta_object() const
{
return admin_meta.is_object();
}
bool ItemContent::are_dates_equal() const
{
return date_creation == date_modification;
}
bool ItemContent::is_link_to() const
{
return !link_to.empty();
}
bool ItemContent::is_link_redirect() const
{
return link_redirect == 1;
}
} // namespace Winix

View File

@@ -272,10 +272,15 @@ public:
bool has_user() const;
bool has_group() const;
bool item_users_different();
bool is_meta_object();
bool is_admin_meta_object();
bool is_meta_object() const;
bool is_admin_meta_object() const;
bool are_dates_equal() const;
bool is_link_to() const;
bool is_link_redirect() const;
protected: