2008-12-10 05:42:49 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2008-12-10 05:42:49 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2010-02-28 22:33:06 +01:00
|
|
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
2008-12-10 05:42:49 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#ifndef headerfilecmslucoreitem
|
|
|
|
#define headerfilecmslucoreitem
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct Item
|
|
|
|
{
|
|
|
|
long id;
|
2010-02-22 23:52:09 +01:00
|
|
|
long parent_id;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-14 06:28:28 +01:00
|
|
|
|
|
|
|
long user_id;
|
|
|
|
long group_id;
|
2010-02-22 23:52:09 +01:00
|
|
|
std::string guest_name; // used as a user name when user_id is equal -1
|
2008-12-14 06:28:28 +01:00
|
|
|
|
2010-06-22 23:09:37 +02:00
|
|
|
long modification_user_id; // who has modified the item last (not taken into account when checking permissions)
|
|
|
|
|
2010-02-22 23:52:09 +01:00
|
|
|
int privileges;
|
2009-06-07 04:40:27 +02:00
|
|
|
|
2009-03-23 00:54:15 +01:00
|
|
|
tm date_creation;
|
|
|
|
tm date_modification;
|
2008-12-14 06:28:28 +01:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
std::string subject;
|
|
|
|
std::string content;
|
2010-02-22 23:52:09 +01:00
|
|
|
long content_id; // used by the database
|
2008-12-14 06:28:28 +01:00
|
|
|
std::string url;
|
|
|
|
|
2010-01-11 15:47:52 +01:00
|
|
|
enum ContentType
|
|
|
|
{
|
|
|
|
ct_text = 0,
|
|
|
|
ct_formatted_text,
|
|
|
|
ct_html,
|
|
|
|
ct_bbcode,
|
|
|
|
ct_raw
|
|
|
|
};
|
2008-12-14 06:28:28 +01:00
|
|
|
|
2010-01-11 15:47:52 +01:00
|
|
|
ContentType content_type;
|
2008-12-14 06:28:28 +01:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2009-06-05 22:29:06 +02:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
enum Type
|
|
|
|
{
|
|
|
|
dir = 0,
|
|
|
|
file = 1,
|
2009-06-05 22:29:06 +02:00
|
|
|
|
2010-02-22 23:52:09 +01:00
|
|
|
none = 1000 // !! pozbyc sie tego
|
2008-12-10 05:42:49 +01:00
|
|
|
};
|
|
|
|
|
2009-06-05 22:29:06 +02:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
Type type;
|
|
|
|
|
|
|
|
|
|
|
|
long default_item;
|
|
|
|
|
|
|
|
|
2008-12-14 06:28:28 +01:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2010-02-22 23:52:09 +01:00
|
|
|
// external static file authorized by winix
|
|
|
|
enum Auth
|
2009-12-30 21:46:12 +01:00
|
|
|
{
|
2010-02-22 23:52:09 +01:00
|
|
|
auth_none = 0, /* there is not an external file */
|
|
|
|
auth_image = 1, /* png, gif, jpg - only types available to render by a web browser*/
|
|
|
|
auth_document = 2, /* pdf doc xls txt */
|
|
|
|
auth_other = 3 /* other file */
|
2009-12-30 21:46:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-02-22 23:52:09 +01:00
|
|
|
Auth auth;
|
2010-03-15 02:47:26 +01:00
|
|
|
std::string auth_path; // path to a file (if auth!=auth_none)
|
2010-02-22 23:52:09 +01:00
|
|
|
|
2009-12-30 21:46:12 +01:00
|
|
|
|
2010-08-13 22:04:57 +02:00
|
|
|
std::string html_template;
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2010-10-24 01:12:47 +02:00
|
|
|
// methods
|
|
|
|
Item();
|
|
|
|
void SetDateToNow();
|
|
|
|
void SetDateModifyToNow();
|
|
|
|
void Clear();
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|