changed: in plugin 'menu'
menu_dir_tab ezc functions can be nested now
(not finished yet)
added: 'meta' winix function
additional meta information for files and directories
(not finished yet)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@775 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "dbitemcolumns.h"
|
||||
#include "dbbase.h"
|
||||
#include "core/log.h"
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +44,28 @@ void DbItemColumns::SetColumns(PGresult * r)
|
||||
ref = PQfnumber(r, "ref");
|
||||
modify_index = PQfnumber(r, "modify_index");
|
||||
sort_index = PQfnumber(r, "sort_index");
|
||||
meta = PQfnumber(r, "meta");
|
||||
}
|
||||
|
||||
|
||||
void DbItemColumns::SetMeta(PGresult * r, long row, Item & item)
|
||||
{
|
||||
DbBase::AssertValueWide(r, row, meta, meta_str);
|
||||
|
||||
item.meta.Clear();
|
||||
conf_parser.SetSpace(item.meta);
|
||||
conf_parser.UTF8(true); // from the db we always have UTF-8 string
|
||||
conf_parser.SplitSingle(true);
|
||||
|
||||
if( conf_parser.ParseString(meta_str) != ConfParser::ok )
|
||||
{
|
||||
log << log1 << "Db: syntax error when parsing meta information for"
|
||||
<< " item id: " << item.id
|
||||
<< ", url: " << item.url
|
||||
<< ", line: " << conf_parser.line << logend;
|
||||
}
|
||||
|
||||
meta_str.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +102,8 @@ void DbItemColumns::SetItem(PGresult * r, long row, Item & item)
|
||||
if( guest_name != -1 ) DbBase::AssertValueWide(r, row, guest_name, item.guest_name);
|
||||
if( html_template != -1 ) DbBase::AssertValueWide(r, row, html_template, item.html_template);
|
||||
if( sort_index != -1 ) item.sort_index = DbBase::AssertValueInt(r, row, sort_index);
|
||||
|
||||
if( meta != -1 ) SetMeta(r, row, item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user