added: to templates: an interface for getting information from Space
miscspace.h, miscspace.cpp changed: plugin ticket now as a config we use a PT::Space struct (not finished yet, only 'integer', 'select' and 'progress' are done) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@794 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -13,12 +13,12 @@
|
||||
|
||||
#include <vector>
|
||||
#include "ticket.h"
|
||||
#include "ticketparser.h"
|
||||
#include "core/item.h"
|
||||
#include "core/system.h"
|
||||
#include "functions/functions.h"
|
||||
#include "db/db.h"
|
||||
#include "tdb.h"
|
||||
#include "confparser/confparser.h"
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ struct TicketConfWrap
|
||||
{
|
||||
bool to_delete;
|
||||
std::wstring file_name;
|
||||
TicketConf conf;
|
||||
PT::Space conf;
|
||||
|
||||
TicketConfWrap()
|
||||
{
|
||||
@@ -57,8 +57,11 @@ public:
|
||||
// current ticket for templates
|
||||
const Ticket * ticket;
|
||||
|
||||
// current item for templates
|
||||
Item * item;
|
||||
|
||||
// for displaying all tickets in a directory
|
||||
std::vector<Item> item_tab;
|
||||
std::vector<Item> item_tab; // !! in the future we'll use cur->request->item_tab[number] (an array of arrays)
|
||||
std::vector<Ticket> ticket_tab;
|
||||
std::vector<Item*> item_sort_tab;
|
||||
|
||||
@@ -69,8 +72,8 @@ public:
|
||||
|
||||
// current ticket config
|
||||
// will be set by FindCurrentConf()
|
||||
const TicketConfWrap * cur_conf_wrap;
|
||||
const TicketConf * cur_conf;
|
||||
TicketConfWrap * cur_conf_wrap;
|
||||
PT::Space * cur_conf;
|
||||
|
||||
// default: "progress"
|
||||
// can be set in config in option: ticket_form_progress_prefix
|
||||
@@ -90,9 +93,7 @@ public:
|
||||
|
||||
void ReadTicketConf(bool skip_existing_configs = false);
|
||||
void FindCurrentConf();
|
||||
void CheckMinMaxValue(const TicketConf::TicketItem & conf_item, Ticket::TicketParam & par);
|
||||
void ReadTicketParams(Ticket & ticket, bool clear_ticket = true, std::vector<long> * file_map = 0);
|
||||
|
||||
void ReadTicketParams(Ticket & ticket, bool clear_ticket, std::vector<long> & file_map, PT::Space & meta);
|
||||
void RemoveTicket(long file_id);
|
||||
|
||||
private:
|
||||
@@ -109,17 +110,19 @@ private:
|
||||
|
||||
// for adding a new image/file to a ticket
|
||||
Item file;
|
||||
std::wstring file_path;
|
||||
|
||||
// for reading config file
|
||||
TicketParser ticket_parser;
|
||||
PT::ConfParser conf_parser;
|
||||
std::vector<Item*> config_dir_tab;
|
||||
Item config_file;
|
||||
|
||||
// for Clearing
|
||||
// (we don't want to use empty pointers)
|
||||
const TicketConfWrap cur_conf_wrap_empty;
|
||||
const TicketConf cur_conf_empty;
|
||||
const Ticket ticket_empty;
|
||||
TicketConfWrap cur_conf_wrap_empty;
|
||||
PT::Space cur_conf_empty;
|
||||
const Ticket ticket_empty;
|
||||
Item item_empty;
|
||||
|
||||
// for removing a ticket
|
||||
Ticket rm_ticket;
|
||||
@@ -129,12 +132,17 @@ private:
|
||||
void ReadTicketConf(Mounts & mounts, bool skip_existing_configs);
|
||||
void MarkAllConfToDelete();
|
||||
void DeleteAllMarkedConf();
|
||||
void ReadTicketConf(const Mount & mount, bool skip_existing_configs);
|
||||
PT::Space & FindAddMetaByParam(PT::Space & meta, long param);
|
||||
|
||||
|
||||
bool ReadTicketValue(const TicketConf::TicketItem & conf_item, Ticket::TicketParam & par, const std::wstring & value);
|
||||
bool ReadTicketValue(const TicketConf::TicketItem & conf_item, Ticket::TicketParam & par, const PostFile & value, std::vector<long> * file_map);
|
||||
void ReadTicketParam(Ticket & ticket, int param_id, const std::wstring & value);
|
||||
void ReadTicketParam(Ticket & ticket, int param_id, const PostFile & value, std::vector<long> * file_map);
|
||||
void CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par);
|
||||
bool ReadTicketValue(PT::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, PT::Space & meta);
|
||||
void ReadTicketValue(PT::Space & space, long param_id, const PostFile & value, std::vector<long> & file_map, PT::Space & meta, Item & upload_dir);
|
||||
void ReadTicketValue(PT::Space & space, long param_id, const PostFile & value, std::vector<long> & file_map, PT::Space & meta);
|
||||
void ReadTicketParam(PT::Space & space, Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta);
|
||||
void ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta);
|
||||
void ReadTicketParam(Ticket & ticket, long param_id, const PostFile & value, std::vector<long> & file_map, PT::Space & meta);
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user