Files
winix/core/item.h
Tomasz Sowa bbaefd0f77 added: date_creation and date_modification to items
changed: function 'run' is using a template: fun_run.html
         there is: [item_run] called from this template


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@489 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-03-22 23:54:15 +00:00

103 lines
1023 B
C++
Executable File

/*
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfileitem
#define headerfileitem
#include <string>
struct Item
{
long id;
long user_id;
long group_id;
int privileges;
tm date_creation;
tm date_modification;
std::string subject;
std::string content;
std::string url;
int content_type;
enum Type
{
dir = 0,
file = 1,
none = 1000
};
Type type;
//item_type;
long parent_id;
long default_item;
// used by the database
// !! moze da sie w ogole z tego zrezygnowac?
long content_id;
Item()
{
Clear();
}
void Clear()
{
id = -1;
user_id = -1;
group_id = -1;
privileges = 0;
subject.clear();
content.clear();
url.clear();
content_type = 0;
type = none;
parent_id = -1;
default_item = -1;
content_id = -1;
time_t t = std::time(0);
date_creation = *std::localtime( &t );
date_modification = date_creation;
}
};
#endif