2008-12-10 05:42:49 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2009-04-21 22:50:55 +02:00
|
|
|
* Copyright (c) 2008-2009, 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;
|
|
|
|
|
2008-12-14 06:28:28 +01:00
|
|
|
|
|
|
|
long user_id;
|
|
|
|
long group_id;
|
|
|
|
int privileges;
|
|
|
|
|
2009-06-07 04:40:27 +02:00
|
|
|
// used as a user name when user_id is equal -1
|
|
|
|
std::string guest_name;
|
|
|
|
|
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;
|
2008-12-14 06:28:28 +01:00
|
|
|
std::string url;
|
|
|
|
|
|
|
|
|
2009-06-05 22:29:06 +02:00
|
|
|
// 0 - simple txt
|
|
|
|
// 1 - formatted txt
|
|
|
|
// 2 - html
|
|
|
|
// 3 - bbcode
|
2008-12-14 06:28:28 +01:00
|
|
|
int content_type;
|
|
|
|
|
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
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
none = 1000
|
|
|
|
};
|
|
|
|
|
2009-06-05 22:29:06 +02:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
Type type;
|
|
|
|
|
|
|
|
//item_type;
|
|
|
|
|
|
|
|
long parent_id;
|
|
|
|
long default_item;
|
|
|
|
|
|
|
|
|
2008-12-14 06:28:28 +01:00
|
|
|
// used by the database
|
2008-12-31 14:36:46 +01:00
|
|
|
// !! moze da sie w ogole z tego zrezygnowac?
|
2008-12-14 06:28:28 +01:00
|
|
|
long content_id;
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
Item()
|
|
|
|
{
|
|
|
|
Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Clear()
|
|
|
|
{
|
|
|
|
id = -1;
|
2008-12-14 06:28:28 +01:00
|
|
|
|
|
|
|
user_id = -1;
|
|
|
|
group_id = -1;
|
|
|
|
privileges = 0;
|
|
|
|
|
2009-06-07 04:40:27 +02:00
|
|
|
guest_name.clear();
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
subject.clear();
|
|
|
|
content.clear();
|
2008-12-14 06:28:28 +01:00
|
|
|
url.clear();
|
|
|
|
|
|
|
|
content_type = 0;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
type = none;
|
|
|
|
parent_id = -1;
|
|
|
|
default_item = -1;
|
2008-12-14 06:28:28 +01:00
|
|
|
|
|
|
|
content_id = -1;
|
2009-03-23 00:54:15 +01:00
|
|
|
|
|
|
|
time_t t = std::time(0);
|
|
|
|
date_creation = *std::localtime( &t );
|
|
|
|
date_modification = date_creation;
|
2008-12-10 05:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|