namespace PT renamed to pt
This commit is contained in:
@@ -123,7 +123,7 @@ bool ExportInfo::DecodePass(Export & exp)
|
||||
/*
|
||||
if( system->crypt.RSA(false, rsa_key, exp.ftp_pass_bin, pass_decrypted) )
|
||||
{
|
||||
PT::UTF8ToWide(pass_decrypted, exp.ftp_pass);
|
||||
pt::UTF8ToWide(pass_decrypted, exp.ftp_pass);
|
||||
system->crypt.ClearString(pass_decrypted);
|
||||
}
|
||||
else
|
||||
@@ -143,7 +143,7 @@ bool ExportInfo::SkipDir(long dir_id, std::wstring & dir)
|
||||
{
|
||||
if( system->dirs.MakePath(dir_id, tmp_dir) )
|
||||
{
|
||||
if( !tmp_dir.empty() && PT::is_substr(tmp_dir, dir) )
|
||||
if( !tmp_dir.empty() && pt::is_substr(tmp_dir, dir) )
|
||||
{
|
||||
// tmp_dir has a slash at the end
|
||||
// we want the slash at the beginning
|
||||
@@ -334,7 +334,7 @@ void ExportInfo::AdditionalExport(const Item & item)
|
||||
{
|
||||
for(size_t i=0 ; i<item.item_content.meta.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & child = *(*item.item_content.meta.child_spaces)[i];
|
||||
pt::Space & child = *(*item.item_content.meta.child_spaces)[i];
|
||||
|
||||
if( child.name && *child.name == L"export" )
|
||||
AdditionalExport(item, child);
|
||||
@@ -343,7 +343,7 @@ void ExportInfo::AdditionalExport(const Item & item)
|
||||
}
|
||||
|
||||
|
||||
void ExportInfo::AdditionalExport(const Item & item, PT::Space & meta)
|
||||
void ExportInfo::AdditionalExport(const Item & item, pt::Space & meta)
|
||||
{
|
||||
meta.to_list(L"additional_export", additional_export);
|
||||
|
||||
|
@@ -103,7 +103,7 @@ private:
|
||||
bool SkipDir(long dir_id, std::wstring & dir);
|
||||
|
||||
void AdditionalExport(const Item & item);
|
||||
void AdditionalExport(const Item & item, PT::Space & meta);
|
||||
void AdditionalExport(const Item & item, pt::Space & meta);
|
||||
void AdditionalExport(const std::wstring & path);
|
||||
|
||||
bool HasRecurrenceId(long id);
|
||||
|
@@ -262,7 +262,7 @@ return len;
|
||||
void ExportThread::Convert(const std::wstring & in, std::string & out, bool clear)
|
||||
{
|
||||
Lock();
|
||||
PT::WideToUTF8(in, out, clear);
|
||||
pt::WideToUTF8(in, out, clear);
|
||||
Unlock();
|
||||
}
|
||||
|
||||
@@ -393,13 +393,13 @@ bool ExportThread::HasThumbInAdress(std::string & buf, size_t i)
|
||||
|
||||
for( ; i<buf.size() ; ++i)
|
||||
{
|
||||
if( PT::is_substr(thumb1, &buf[i]) )
|
||||
if( pt::is_substr(thumb1, &buf[i]) )
|
||||
{
|
||||
buf.erase(i, len1);
|
||||
return true;
|
||||
}
|
||||
|
||||
if( PT::is_substr(thumb2, &buf[i]) )
|
||||
if( pt::is_substr(thumb2, &buf[i]) )
|
||||
{
|
||||
buf.erase(i, len2);
|
||||
return true;
|
||||
@@ -427,7 +427,7 @@ void ExportThread::ChangeAdressesThumb(std::string & buf, const char * http_pref
|
||||
|
||||
for(size_t i=0 ; i<buf.size() ; ++i)
|
||||
{
|
||||
if( PT::is_substr(look_for_url.c_str(), &buf[i]) )
|
||||
if( pt::is_substr(look_for_url.c_str(), &buf[i]) )
|
||||
{
|
||||
i += look_for_url.size() - 1; // without skipping the last slash
|
||||
|
||||
|
@@ -77,10 +77,10 @@ Groups * GroupInfo::FindGroups(long dir_id)
|
||||
bool GroupInfo::ParseGroups(const std::wstring & str, Groups & groups)
|
||||
{
|
||||
groups.Clear();
|
||||
PT::Space & space = *groups.GetSpace();
|
||||
pt::Space & space = *groups.GetSpace();
|
||||
conf_parser.SetSpace(space);
|
||||
|
||||
if( conf_parser.ParseSpace(str) == PT::SpaceParser::ok )
|
||||
if( conf_parser.ParseSpace(str) == pt::SpaceParser::ok )
|
||||
{
|
||||
groups.Reindex();
|
||||
}
|
||||
@@ -91,7 +91,7 @@ bool GroupInfo::ParseGroups(const std::wstring & str, Groups & groups)
|
||||
groups.Clear();
|
||||
}
|
||||
|
||||
return conf_parser.status == PT::SpaceParser::ok;
|
||||
return conf_parser.status == pt::SpaceParser::ok;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -96,7 +96,7 @@ private:
|
||||
typedef std::map<long, GroupsWrapItem> GroupsWrap;
|
||||
GroupsWrap groups_wrap;
|
||||
|
||||
PT::SpaceParser conf_parser;
|
||||
pt::SpaceParser conf_parser;
|
||||
std::vector<Item*> config_dir_tab;
|
||||
Item config_file;
|
||||
|
||||
|
@@ -46,7 +46,7 @@ namespace GroupItem
|
||||
|
||||
|
||||
|
||||
PT::Space * Groups::GetSpace()
|
||||
pt::Space * Groups::GetSpace()
|
||||
{
|
||||
return &space;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ void Groups::Reindex()
|
||||
{
|
||||
while( seti < space.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[seti];
|
||||
pt::Space & sp = *(*space.child_spaces)[seti];
|
||||
|
||||
if( sp.name )
|
||||
{
|
||||
@@ -85,7 +85,7 @@ void Groups::Reindex()
|
||||
}
|
||||
|
||||
|
||||
void Groups::ReindexGroups(GroupIndex & group_index, PT::Space & set)
|
||||
void Groups::ReindexGroups(GroupIndex & group_index, pt::Space & set)
|
||||
{
|
||||
size_t i, v;
|
||||
|
||||
@@ -94,7 +94,7 @@ size_t i, v;
|
||||
// loop through all groups in the set
|
||||
for( i=0 ; i < set.child_spaces->size() ; ++i )
|
||||
{
|
||||
PT::Space & group = *(*set.child_spaces)[i];
|
||||
pt::Space & group = *(*set.child_spaces)[i];
|
||||
// !! IMPROVE ME will be safer to copy the value out
|
||||
// if we used accidently the group.Text later the key
|
||||
// would be overwritten
|
||||
@@ -141,7 +141,7 @@ size_t i, v;
|
||||
}
|
||||
|
||||
|
||||
void Groups::SortValues(PT::Space & group)
|
||||
void Groups::SortValues(pt::Space & group)
|
||||
{
|
||||
sort_by = group.to_wstr(L"sort_by");
|
||||
sort_asc = group.is_equal(L"sort_asc", L"true");
|
||||
@@ -154,7 +154,7 @@ void Groups::SortValues(PT::Space & group)
|
||||
}
|
||||
|
||||
|
||||
bool Groups::SortFunHelper::operator()(PT::Space * sp1, PT::Space * sp2)
|
||||
bool Groups::SortFunHelper::operator()(pt::Space * sp1, pt::Space * sp2)
|
||||
{
|
||||
const std::wstring * val1 = sp1->get_wstr(groups->sort_by.c_str());
|
||||
const std::wstring * val2 = sp2->get_wstr(groups->sort_by.c_str());
|
||||
@@ -208,11 +208,11 @@ const std::wstring & Groups::GetOption(size_t seti, size_t groupi, size_t valuei
|
||||
{
|
||||
if( space.child_spaces && seti < space.child_spaces->size() )
|
||||
{
|
||||
PT::Space & groups = *(*space.child_spaces)[seti];
|
||||
pt::Space & groups = *(*space.child_spaces)[seti];
|
||||
|
||||
if( groups.child_spaces && groupi < groups.child_spaces->size() )
|
||||
{
|
||||
PT::Space & value = *(*groups.child_spaces)[groupi];
|
||||
pt::Space & value = *(*groups.child_spaces)[groupi];
|
||||
|
||||
if( value.child_spaces && valuei < value.child_spaces->size() )
|
||||
{
|
||||
@@ -239,7 +239,7 @@ size_t Groups::Size(size_t seti, size_t groupi)
|
||||
{
|
||||
if( space.child_spaces && seti < space.child_spaces->size() )
|
||||
{
|
||||
PT::Space & groups = *(*space.child_spaces)[seti];
|
||||
pt::Space & groups = *(*space.child_spaces)[seti];
|
||||
|
||||
if( groups.child_spaces && groupi < groups.child_spaces->size() )
|
||||
return (*groups.child_spaces)[groupi]->child_spaces->size();
|
||||
|
@@ -57,7 +57,7 @@ public:
|
||||
reading all space
|
||||
(sets and groups)
|
||||
*/
|
||||
PT::Space * GetSpace();
|
||||
pt::Space * GetSpace();
|
||||
|
||||
|
||||
/*
|
||||
@@ -110,7 +110,7 @@ private:
|
||||
# sets should have a unique name
|
||||
# groups don't have a name
|
||||
*/
|
||||
PT::Space space;
|
||||
pt::Space space;
|
||||
|
||||
|
||||
/*
|
||||
@@ -143,13 +143,13 @@ private:
|
||||
Groups * groups;
|
||||
SortFunHelper(Groups * pgroups) : groups(pgroups) {};
|
||||
size_t SortValue(const std::wstring & val);
|
||||
bool operator()(PT::Space * sp1, PT::Space * sp2);
|
||||
bool operator()(pt::Space * sp1, pt::Space * sp2);
|
||||
};
|
||||
|
||||
|
||||
|
||||
void ReindexGroups(GroupIndex & group_index, PT::Space & set);
|
||||
void SortValues(PT::Space & group);
|
||||
void ReindexGroups(GroupIndex & group_index, pt::Space & set);
|
||||
void SortValues(pt::Space & group);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -73,18 +73,18 @@ void AddWinixFunctions(PluginInfo & info)
|
||||
// create a class from these methods
|
||||
void ReloadConfigFile(PluginInfo & info, Item & file)
|
||||
{
|
||||
PT::Space space;
|
||||
PT::SpaceParser parser;
|
||||
pt::Space space;
|
||||
pt::SpaceParser parser;
|
||||
|
||||
parser.SetSpace(space);
|
||||
PT::SpaceParser::Status status = parser.ParseSpace(file.item_content.content_raw);
|
||||
pt::SpaceParser::Status status = parser.ParseSpace(file.item_content.content_raw);
|
||||
|
||||
if( status == PT::SpaceParser::syntax_error )
|
||||
if( status == pt::SpaceParser::syntax_error )
|
||||
{
|
||||
info.log << log1 << "MR: syntax error in file: " << file.url << ", line: " << parser.get_last_parsed_line() << " (skipping this file)" << logend;
|
||||
}
|
||||
else
|
||||
if( status == PT::SpaceParser::ok )
|
||||
if( status == pt::SpaceParser::ok )
|
||||
{
|
||||
std::wstring * list_id_str = space.get_wstr(L"list_id");
|
||||
|
||||
|
@@ -55,7 +55,7 @@ struct MenuItem
|
||||
long id; // item id
|
||||
std::wstring url;
|
||||
std::wstring subject;
|
||||
PT::Space meta;
|
||||
pt::Space meta;
|
||||
Item::Type type;
|
||||
int file_type;
|
||||
};
|
||||
|
@@ -77,7 +77,7 @@ void Seo::MakePost()
|
||||
|
||||
item.subject = subject;
|
||||
|
||||
PT::Space & seo = item.item_content.meta.find_add_child_space(L"seo");
|
||||
pt::Space & seo = item.item_content.meta.find_add_child_space(L"seo");
|
||||
seo.add(L"description", description);
|
||||
seo.add(L"keywords", keywords);
|
||||
|
||||
|
@@ -96,7 +96,7 @@ void Stats::ReadStats()
|
||||
if( stats_file.empty() )
|
||||
return;
|
||||
|
||||
PT::WideToUTF8(stats_file, astats_file);
|
||||
pt::WideToUTF8(stats_file, astats_file);
|
||||
std::ifstream file(astats_file.c_str());
|
||||
|
||||
if( !file )
|
||||
@@ -147,7 +147,7 @@ void Stats::SaveStats()
|
||||
if( stats_file.empty() )
|
||||
return;
|
||||
|
||||
PT::WideToUTF8(stats_file, astats_file);
|
||||
pt::WideToUTF8(stats_file, astats_file);
|
||||
std::ofstream file(astats_file.c_str());
|
||||
|
||||
if( !file )
|
||||
|
@@ -80,7 +80,7 @@ bool Reply::HasAccess()
|
||||
return false;
|
||||
|
||||
|
||||
PT::Space * thread_space = cur->request->item.item_content.meta_admin.find_child_space(L"thread");
|
||||
pt::Space * thread_space = cur->request->item.item_content.meta_admin.find_child_space(L"thread");
|
||||
|
||||
if( thread_space )
|
||||
{
|
||||
|
@@ -298,7 +298,7 @@ void thread_sort_tab_date_creation(Info & i)
|
||||
{
|
||||
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||
{
|
||||
PT::Date date = system->ToLocal(thread_info.item_sort_tab[item_sort_index]->item_content.date_creation);
|
||||
pt::Date date = system->ToLocal(thread_info.item_sort_tab[item_sort_index]->item_content.date_creation);
|
||||
i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec);
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,7 @@ void thread_sort_tab_date_modification(Info & i)
|
||||
{
|
||||
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||
{
|
||||
PT::Date date = system->ToLocal(thread_info.item_sort_tab[item_sort_index]->item_content.date_modification);
|
||||
pt::Date date = system->ToLocal(thread_info.item_sort_tab[item_sort_index]->item_content.date_modification);
|
||||
i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec);
|
||||
}
|
||||
}
|
||||
@@ -337,8 +337,8 @@ void thread_sort_tab_dates_equal(Info & i)
|
||||
{
|
||||
if( item_sort_index < thread_info.item_sort_tab.size() )
|
||||
{
|
||||
PT::Date & date1 = thread_info.item_sort_tab[item_sort_index]->item_content.date_creation;
|
||||
PT::Date & date2 = thread_info.item_sort_tab[item_sort_index]->item_content.date_modification;
|
||||
pt::Date & date1 = thread_info.item_sort_tab[item_sort_index]->item_content.date_creation;
|
||||
pt::Date & date2 = thread_info.item_sort_tab[item_sort_index]->item_content.date_modification;
|
||||
|
||||
i.res = date1 == date2;
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
// the last file in a thread
|
||||
long last_item_id;
|
||||
PT::Date last_item_date_modification;
|
||||
pt::Date last_item_date_modification;
|
||||
long last_item_user_id;
|
||||
std::wstring last_item_guest_name;
|
||||
|
||||
|
@@ -164,13 +164,13 @@ return ticket;
|
||||
}
|
||||
|
||||
|
||||
PT::Space & CreateTicket::PrepareSpace()
|
||||
pt::Space & CreateTicket::PrepareSpace()
|
||||
{
|
||||
SessionData * session_data = reinterpret_cast<SessionData*>(
|
||||
cur->session->plugin_data.Get(ticket_info->plugin_id) );
|
||||
|
||||
long dir_id = cur->request->dir_tab.back()->id;
|
||||
PT::Space & new_space = session_data->GetNewSpace(dir_id, session_data->create_space_map);
|
||||
pt::Space & new_space = session_data->GetNewSpace(dir_id, session_data->create_space_map);
|
||||
|
||||
return new_space;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ void CreateTicket::MakePost()
|
||||
ticket_info->FindCurrentConf();
|
||||
|
||||
Ticket & ticket = PrepareTicket();
|
||||
PT::Space & meta = PrepareSpace();
|
||||
pt::Space & meta = PrepareSpace();
|
||||
Item & item = cur->request->item;
|
||||
ticket_info->ticket = &ticket;
|
||||
ticket_info->item = &item;
|
||||
@@ -209,7 +209,7 @@ void CreateTicket::MakeGet()
|
||||
ticket_info->FindCurrentConf();
|
||||
|
||||
Ticket & ticket = PrepareTicket();
|
||||
PT::Space & meta = PrepareSpace();
|
||||
pt::Space & meta = PrepareSpace();
|
||||
ticket_info->ticket = &ticket;
|
||||
ticket_info->item = &cur->request->item;
|
||||
|
||||
|
@@ -66,7 +66,7 @@ private:
|
||||
void Submit(Ticket & ticket, Item & item);
|
||||
void RemoveTmpTicket();
|
||||
Ticket & PrepareTicket();
|
||||
PT::Space & PrepareSpace();
|
||||
pt::Space & PrepareSpace();
|
||||
|
||||
TDb * tdb;
|
||||
TicketInfo * ticket_info;
|
||||
|
@@ -174,23 +174,23 @@ return ticket;
|
||||
|
||||
|
||||
|
||||
PT::Space & EditTicket::PrepareSpace()
|
||||
pt::Space & EditTicket::PrepareSpace()
|
||||
{
|
||||
SessionData * session_data = reinterpret_cast<SessionData*>(
|
||||
cur->session->plugin_data.Get(ticket_info->plugin_id) );
|
||||
|
||||
bool is_new;
|
||||
long file_id = cur->request->item.id;
|
||||
PT::Space & new_space = session_data->GetNewSpace(file_id, session_data->edit_space_map, &is_new);
|
||||
pt::Space & new_space = session_data->GetNewSpace(file_id, session_data->edit_space_map, &is_new);
|
||||
|
||||
if( is_new )
|
||||
{
|
||||
PT::Space * ticket_space = cur->request->item.item_content.meta.find_child_space(L"ticket");
|
||||
pt::Space * ticket_space = cur->request->item.item_content.meta.find_child_space(L"ticket");
|
||||
|
||||
if( ticket_space )
|
||||
{
|
||||
new_space = *ticket_space;
|
||||
PT::Space & old_space = session_data->GetOldSpace(file_id, session_data->edit_space_map);
|
||||
pt::Space & old_space = session_data->GetOldSpace(file_id, session_data->edit_space_map);
|
||||
old_space = new_space;
|
||||
}
|
||||
}
|
||||
@@ -203,10 +203,10 @@ bool EditTicket::CloseTicket()
|
||||
{
|
||||
cur->request->item.propagate_connector();
|
||||
|
||||
PT::Space & ticket_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"ticket");
|
||||
pt::Space & ticket_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"ticket");
|
||||
ticket_space.add(L"closed", true);
|
||||
|
||||
PT::Space & thread_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"thread");
|
||||
pt::Space & thread_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"thread");
|
||||
thread_space.add(L"closed", true);
|
||||
|
||||
//if( db->EditAdminMetaById(cur->request->item.ameta, cur->request->item.id) == WINIX_ERR_OK )
|
||||
@@ -228,7 +228,7 @@ void EditTicket::MakePost()
|
||||
ticket_info->FindCurrentConf();
|
||||
|
||||
Ticket & ticket = PrepareTicket();
|
||||
PT::Space & meta = PrepareSpace();
|
||||
pt::Space & meta = PrepareSpace();
|
||||
Item & item = cur->request->item;
|
||||
|
||||
old_url = item.url;
|
||||
@@ -267,7 +267,7 @@ void EditTicket::MakeGet()
|
||||
ticket_info->FindCurrentConf();
|
||||
|
||||
Ticket & ticket = PrepareTicket();
|
||||
PT::Space & meta = PrepareSpace();
|
||||
pt::Space & meta = PrepareSpace();
|
||||
ticket_info->ticket = &ticket;
|
||||
ticket_info->item = &cur->request->item;
|
||||
|
||||
|
@@ -70,7 +70,7 @@ private:
|
||||
|
||||
void RemoveTmpTicket();
|
||||
Ticket & PrepareTicket();
|
||||
PT::Space & PrepareSpace();
|
||||
pt::Space & PrepareSpace();
|
||||
void ChangeTicket(Ticket & ticket, Item & item);
|
||||
void Submit(Ticket & ticket, Item & item);
|
||||
bool CloseTicket();
|
||||
|
@@ -83,7 +83,7 @@ SpaceMap::iterator i;
|
||||
|
||||
|
||||
|
||||
void SessionData::RemoveAllFiles(PT::Space & new_space)
|
||||
void SessionData::RemoveAllFiles(pt::Space & new_space)
|
||||
{
|
||||
std::vector<long> new_file_tab;
|
||||
BuildFileList(new_file_tab, new_space);
|
||||
@@ -94,7 +94,7 @@ void SessionData::RemoveAllFiles(PT::Space & new_space)
|
||||
|
||||
|
||||
|
||||
void SessionData::RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_space)
|
||||
void SessionData::RemoveAllStaleFiles(pt::Space & new_space, pt::Space & old_space)
|
||||
{
|
||||
std::vector<long> new_file_tab;
|
||||
std::vector<long> old_file_tab;
|
||||
@@ -140,7 +140,7 @@ void SessionData::RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_spa
|
||||
|
||||
|
||||
|
||||
void SessionData::BuildFileList(std::vector<long> & file_tab, PT::Space & space)
|
||||
void SessionData::BuildFileList(std::vector<long> & file_tab, pt::Space & space)
|
||||
{
|
||||
file_tab.clear();
|
||||
|
||||
@@ -148,7 +148,7 @@ void SessionData::BuildFileList(std::vector<long> & file_tab, PT::Space & space)
|
||||
{
|
||||
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[i];
|
||||
pt::Space & sp = *(*space.child_spaces)[i];
|
||||
|
||||
if( sp.name && (*sp.name) == L"param" )
|
||||
CheckFile(file_tab, sp);
|
||||
@@ -157,13 +157,13 @@ void SessionData::BuildFileList(std::vector<long> & file_tab, PT::Space & space)
|
||||
}
|
||||
|
||||
|
||||
void SessionData::CheckFile(std::vector<long> & file_tab, PT::Space & space)
|
||||
void SessionData::CheckFile(std::vector<long> & file_tab, pt::Space & space)
|
||||
{
|
||||
if( space.child_spaces )
|
||||
{
|
||||
for(size_t i=0 ; i<space.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & subsp = *(*space.child_spaces)[i];
|
||||
pt::Space & subsp = *(*space.child_spaces)[i];
|
||||
|
||||
if( subsp.name && *subsp.name == L"file" )
|
||||
{
|
||||
@@ -194,7 +194,7 @@ return res.first->second;
|
||||
|
||||
|
||||
|
||||
PT::Space & SessionData::GetOldSpace(long id, SpaceMap & space_map, bool * is_new)
|
||||
pt::Space & SessionData::GetOldSpace(long id, SpaceMap & space_map, bool * is_new)
|
||||
{
|
||||
std::pair<SpaceMap::iterator, bool> res = space_map.insert( std::make_pair(id, SpacePair()) );
|
||||
|
||||
@@ -205,7 +205,7 @@ return res.first->second.old_space;
|
||||
}
|
||||
|
||||
|
||||
PT::Space & SessionData::GetNewSpace(long id, SpaceMap & space_map, bool * is_new)
|
||||
pt::Space & SessionData::GetNewSpace(long id, SpaceMap & space_map, bool * is_new)
|
||||
{
|
||||
std::pair<SpaceMap::iterator, bool> res = space_map.insert( std::make_pair(id, SpacePair()) );
|
||||
|
||||
|
@@ -58,8 +58,8 @@ struct SessionData : public PluginDataBase
|
||||
|
||||
struct SpacePair
|
||||
{
|
||||
PT::Space new_space;
|
||||
PT::Space old_space;
|
||||
pt::Space new_space;
|
||||
pt::Space old_space;
|
||||
|
||||
// old_space is used when editing an existing ticket
|
||||
// current ticket space is copied to old_space
|
||||
@@ -95,8 +95,8 @@ struct SessionData : public PluginDataBase
|
||||
Ticket & GetTicket(long id, TicketMap & ticket_map, bool * is_new = 0);
|
||||
|
||||
// inserting and returning a new/old space or just returning the space if it exists
|
||||
PT::Space & GetOldSpace(long id, SpaceMap & space_map, bool * is_new = 0);
|
||||
PT::Space & GetNewSpace(long id, SpaceMap & space_map, bool * is_new = 0);
|
||||
pt::Space & GetOldSpace(long id, SpaceMap & space_map, bool * is_new = 0);
|
||||
pt::Space & GetNewSpace(long id, SpaceMap & space_map, bool * is_new = 0);
|
||||
|
||||
// for deleting files
|
||||
Fun::Rm * fun_rm;
|
||||
@@ -104,11 +104,11 @@ struct SessionData : public PluginDataBase
|
||||
private:
|
||||
|
||||
void RemoveFiles(SpaceMap & space_map, bool only_stale_files);
|
||||
void RemoveAllFiles(PT::Space & new_space);
|
||||
void RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_space);
|
||||
void RemoveAllFiles(pt::Space & new_space);
|
||||
void RemoveAllStaleFiles(pt::Space & new_space, pt::Space & old_space);
|
||||
|
||||
void BuildFileList(std::vector<long> & file_tab, PT::Space & space);
|
||||
void CheckFile(std::vector<long> & file_tab, PT::Space & space);
|
||||
void BuildFileList(std::vector<long> & file_tab, pt::Space & space);
|
||||
void CheckFile(std::vector<long> & file_tab, pt::Space & space);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -66,7 +66,7 @@ struct TicketValue
|
||||
{
|
||||
bool is_param; // true if there is a paremeter (in config Space)
|
||||
|
||||
PT::Space * config_par; // current space param (from current config) if is_param is true
|
||||
pt::Space * config_par; // current space param (from current config) if is_param is true
|
||||
// when is_param is true then this pointer is never null
|
||||
|
||||
long param_id; // param id (the same as config_par->Long(L"id"))
|
||||
@@ -79,7 +79,7 @@ bool is_in_ticket_par; // true if the value is defined in ticket.par_tab
|
||||
// else the value can be defined in meta (or not at all)
|
||||
|
||||
Ticket::TicketParam * ticket_par; // if is_in_ticket_par is true
|
||||
PT::Space * value_meta; // if is_in_ticket_par is false and if there is such a value in meta
|
||||
pt::Space * value_meta; // if is_in_ticket_par is false and if there is such a value in meta
|
||||
|
||||
|
||||
TicketValue()
|
||||
@@ -169,7 +169,7 @@ return false;
|
||||
looking for a subspace in meta which has id equal to param_id
|
||||
can return a null pointer
|
||||
*/
|
||||
PT::Space * find_ticket_param(long param_id, PT::Space & meta)
|
||||
pt::Space * find_ticket_param(long param_id, pt::Space & meta)
|
||||
{
|
||||
wchar_t param_id_str[50];
|
||||
|
||||
@@ -181,7 +181,7 @@ wchar_t param_id_str[50];
|
||||
|
||||
for(size_t i=0 ; i<meta.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & sp = *(*meta.child_spaces)[i];
|
||||
pt::Space & sp = *(*meta.child_spaces)[i];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.is_equal(L"id", param_id_str) )
|
||||
return &sp;
|
||||
@@ -211,7 +211,7 @@ return 0;
|
||||
value.ticket_par
|
||||
value.value_meta
|
||||
*/
|
||||
void find_ticket_value(TicketValue & value, Ticket::ParTab & par_tab, PT::Space & item_meta)
|
||||
void find_ticket_value(TicketValue & value, Ticket::ParTab & par_tab, pt::Space & item_meta)
|
||||
{
|
||||
size_t par_index;
|
||||
|
||||
@@ -229,11 +229,11 @@ size_t par_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
PT::Space * meta = item_meta.find_child_space(L"ticket");
|
||||
pt::Space * meta = item_meta.find_child_space(L"ticket");
|
||||
|
||||
if( meta )
|
||||
{
|
||||
PT::Space * sp = find_ticket_param(value.param_id, *meta);
|
||||
pt::Space * sp = find_ticket_param(value.param_id, *meta);
|
||||
|
||||
if( sp )
|
||||
{
|
||||
@@ -253,7 +253,7 @@ void ticket_print_value_select(Info & i, TicketValue & value)
|
||||
{
|
||||
for(size_t a=0 ; a<value.config_par->child_spaces->size() ; ++a)
|
||||
{
|
||||
PT::Space & sp = *(*value.config_par->child_spaces)[a];
|
||||
pt::Space & sp = *(*value.config_par->child_spaces)[a];
|
||||
|
||||
if( sp.name && *sp.name == L"option" && sp.to_long(L"id") == value.ticket_par->intv )
|
||||
{
|
||||
@@ -322,7 +322,7 @@ void ticket_meta_value(Info & i)
|
||||
|
||||
void ticket_is_closed(Info & i)
|
||||
{
|
||||
PT::Space * ticket_space = ticket_info.item->item_content.meta_admin.find_child_space(L"ticket");
|
||||
pt::Space * ticket_space = ticket_info.item->item_content.meta_admin.find_child_space(L"ticket");
|
||||
|
||||
if( ticket_space )
|
||||
i.res = ticket_space->to_bool(L"closed", false);
|
||||
@@ -337,14 +337,14 @@ void ticket_param_value_for_param_id(Info & i)
|
||||
value_for_param_id.Clear();
|
||||
|
||||
size_t conf_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
int id = Toi(i.par);
|
||||
|
||||
if( space.child_spaces )
|
||||
{
|
||||
for( ; conf_index < space.child_spaces->size() ; ++conf_index)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.to_int(L"id") == id )
|
||||
{
|
||||
@@ -372,7 +372,7 @@ void ticket_does_param_id_have_value(Info & i)
|
||||
value_for_param_id.Clear();
|
||||
|
||||
size_t conf_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
|
||||
if( i.params.size() == 2 && space.child_spaces )
|
||||
{
|
||||
@@ -381,7 +381,7 @@ void ticket_does_param_id_have_value(Info & i)
|
||||
|
||||
for( ; conf_index < space.child_spaces->size() ; ++conf_index)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == id )
|
||||
{
|
||||
@@ -559,7 +559,7 @@ void tickets_tab_is_closed(Info & i)
|
||||
|
||||
if( tickets_value.is_item )
|
||||
{
|
||||
PT::Space * ticket_space = tickets_value.item->item_content.meta_admin.find_child_space(L"ticket");
|
||||
pt::Space * ticket_space = tickets_value.item->item_content.meta_admin.find_child_space(L"ticket");
|
||||
|
||||
if( ticket_space )
|
||||
i.res = ticket_space->to_bool(L"closed", false);
|
||||
@@ -638,14 +638,14 @@ void tickets_tab_param_value_for_param_id(Info & i)
|
||||
if( tickets_value.is_ticket )
|
||||
{
|
||||
size_t param_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
long id = Tol(i.par);
|
||||
|
||||
if( space.child_spaces )
|
||||
{
|
||||
for( ; param_index < space.child_spaces->size() ; ++param_index)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[param_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[param_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" &&
|
||||
sp.to_long(L"id") == id )
|
||||
@@ -675,7 +675,7 @@ void tickets_tab_does_param_id_have_value(Info & i)
|
||||
if( tickets_value.is_ticket && i.params.size() == 2 )
|
||||
{
|
||||
size_t param_index = 0;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
long id = Toi(i.params[0].str);
|
||||
long id2 = Toi(i.params[1].str);
|
||||
|
||||
@@ -683,7 +683,7 @@ void tickets_tab_does_param_id_have_value(Info & i)
|
||||
{
|
||||
for( ; param_index < space.child_spaces->size() ; ++param_index)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[param_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[param_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == id )
|
||||
{
|
||||
@@ -723,13 +723,13 @@ void tickets_tab_conf_tab(Info & i)
|
||||
if( tickets_value.is_ticket )
|
||||
{
|
||||
conf_index = i.iter;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
|
||||
if( space.child_spaces )
|
||||
{
|
||||
while( conf_index < space.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" )
|
||||
break;
|
||||
@@ -840,13 +840,13 @@ void tickets_tab_conf_tab_file_tab(Info & i)
|
||||
if( i.iter == 0 )
|
||||
tickets_file_number = 0;
|
||||
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces )
|
||||
{
|
||||
while( tickets_file_index < mt.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*mt.child_spaces)[tickets_file_index];
|
||||
pt::Space & sp = *(*mt.child_spaces)[tickets_file_index];
|
||||
|
||||
if( sp.name && *sp.name == L"file" )
|
||||
break;
|
||||
@@ -869,7 +869,7 @@ void tickets_tab_conf_tab_file_tab_index(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() )
|
||||
i.out << tickets_file_number;
|
||||
@@ -884,7 +884,7 @@ void tickets_tab_conf_tab_file_tab_path(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() )
|
||||
i.out << (*mt.child_spaces)[tickets_file_index]->to_wstr(L"path");
|
||||
@@ -898,7 +898,7 @@ void tickets_tab_conf_tab_file_tab_itemid(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() )
|
||||
i.out << (*mt.child_spaces)[tickets_file_index]->to_wstr(L"itemid");
|
||||
@@ -912,7 +912,7 @@ void tickets_tab_conf_tab_file_tab_meta(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() )
|
||||
space_value(i, *(*mt.child_spaces)[tickets_file_index]);
|
||||
@@ -954,13 +954,13 @@ void ticket_tab(Info & i)
|
||||
value.Clear();
|
||||
|
||||
conf_index = i.iter;
|
||||
PT::Space & space = *ticket_info.cur_conf;
|
||||
pt::Space & space = *ticket_info.cur_conf;
|
||||
|
||||
if( space.child_spaces )
|
||||
{
|
||||
while( conf_index < space.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
pt::Space & sp = *(*space.child_spaces)[conf_index];
|
||||
|
||||
if( sp.name && *sp.name == L"param" )
|
||||
break;
|
||||
@@ -1072,13 +1072,13 @@ void ticket_tab_select_tab(Info & i)
|
||||
if( value.is_param )
|
||||
{
|
||||
select_index = i.iter;
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces )
|
||||
{
|
||||
while( select_index < sp.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp_child = *(*sp.child_spaces)[select_index];
|
||||
pt::Space & sp_child = *(*sp.child_spaces)[select_index];
|
||||
|
||||
if( sp_child.name && *sp_child.name == L"option" )
|
||||
break;
|
||||
@@ -1098,11 +1098,11 @@ void ticket_tab_select_tab_is_selected(Info & i)
|
||||
|
||||
if( value.is_param )
|
||||
{
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces && select_index < sp.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp_child = *(*sp.child_spaces)[select_index];
|
||||
pt::Space & sp_child = *(*sp.child_spaces)[select_index];
|
||||
|
||||
long id = sp_child.to_long(L"id");
|
||||
|
||||
@@ -1126,7 +1126,7 @@ void ticket_tab_select_tab_name(Info & i)
|
||||
|
||||
if( value.is_param )
|
||||
{
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces && select_index < sp.child_spaces->size() )
|
||||
i.out << (*sp.child_spaces)[select_index]->to_wstr(L"value");
|
||||
@@ -1140,7 +1140,7 @@ void ticket_tab_select_tab_id(Info & i)
|
||||
|
||||
if( value.is_param )
|
||||
{
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces && select_index < sp.child_spaces->size() )
|
||||
i.out << (*sp.child_spaces)[select_index]->to_wstr(L"id");
|
||||
@@ -1153,7 +1153,7 @@ void ticket_tab_select_tab_meta(Info & i)
|
||||
|
||||
if( value.is_param )
|
||||
{
|
||||
PT::Space & sp = *value.config_par;
|
||||
pt::Space & sp = *value.config_par;
|
||||
|
||||
if( sp.child_spaces && select_index < sp.child_spaces->size() )
|
||||
space_value(i, *(*sp.child_spaces)[select_index]);
|
||||
@@ -1173,13 +1173,13 @@ void ticket_tab_file_tab(Info & i)
|
||||
if( i.iter == 0 )
|
||||
ticket_file_number = 0;
|
||||
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces )
|
||||
{
|
||||
while( ticket_file_index < mt.child_spaces->size() )
|
||||
{
|
||||
PT::Space & sp = *(*mt.child_spaces)[ticket_file_index];
|
||||
pt::Space & sp = *(*mt.child_spaces)[ticket_file_index];
|
||||
|
||||
if( sp.name && *sp.name == L"file" )
|
||||
break;
|
||||
@@ -1202,7 +1202,7 @@ void ticket_tab_file_tab_index(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() )
|
||||
i.out << ticket_file_number;
|
||||
@@ -1216,7 +1216,7 @@ void ticket_tab_file_tab_path(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() )
|
||||
i.out << (*mt.child_spaces)[ticket_file_index]->to_wstr(L"path");
|
||||
@@ -1229,7 +1229,7 @@ void ticket_tab_file_tab_itemid(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() )
|
||||
i.out << (*mt.child_spaces)[ticket_file_index]->to_wstr(L"itemid");
|
||||
@@ -1242,7 +1242,7 @@ void ticket_tab_file_tab_meta(Info & i)
|
||||
|
||||
if( value.is_value && !value.is_in_ticket_par )
|
||||
{
|
||||
PT::Space & mt = *value.value_meta;
|
||||
pt::Space & mt = *value.value_meta;
|
||||
|
||||
if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() )
|
||||
space_value(i, *(*mt.child_spaces)[ticket_file_index]);
|
||||
|
@@ -169,7 +169,7 @@ bool TicketInfo::ParseTicketConf(long mount_dir_id, const std::wstring & path)
|
||||
conf_parser.SetSpace(conf_tab[mount_dir_id].conf);
|
||||
conf_tab[mount_dir_id].conf.clear();
|
||||
|
||||
return (conf_parser.ParseSpace(config_file.item_content.content_raw) == PT::SpaceParser::ok);
|
||||
return (conf_parser.ParseSpace(config_file.item_content.content_raw) == pt::SpaceParser::ok);
|
||||
}
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ void TicketInfo::FindCurrentConf()
|
||||
|
||||
|
||||
|
||||
void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par)
|
||||
void TicketInfo::CheckMinMaxValue(pt::Space & space, Ticket::TicketParam & par)
|
||||
{
|
||||
std::wstring * type = space.get_wstr(L"type");
|
||||
|
||||
@@ -307,7 +307,7 @@ void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par)
|
||||
{
|
||||
for(size_t a=0 ; a<space.child_spaces->size() ; ++a)
|
||||
{
|
||||
PT::Space & sp = *(*space.child_spaces)[a];
|
||||
pt::Space & sp = *(*space.child_spaces)[a];
|
||||
|
||||
if( sp.name && *sp.name == L"option" && sp.to_long(L"id") == par.intv )
|
||||
return;
|
||||
@@ -323,20 +323,20 @@ void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par)
|
||||
}
|
||||
|
||||
|
||||
PT::Space & TicketInfo::FindAddMetaByParam(PT::Space & meta, long param)
|
||||
pt::Space & TicketInfo::FindAddMetaByParam(pt::Space & meta, long param)
|
||||
{
|
||||
if( meta.child_spaces )
|
||||
{
|
||||
for(size_t i=0 ; i<meta.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & sp = *(*meta.child_spaces)[i];
|
||||
pt::Space & sp = *(*meta.child_spaces)[i];
|
||||
|
||||
if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == param )
|
||||
return sp;
|
||||
}
|
||||
}
|
||||
|
||||
PT::Space & sp = meta.add_child_space(L"param");
|
||||
pt::Space & sp = meta.add_child_space(L"param");
|
||||
sp.add(L"id", param);
|
||||
|
||||
return sp;
|
||||
@@ -344,7 +344,7 @@ return sp;
|
||||
|
||||
|
||||
|
||||
bool TicketInfo::ReadTicketValue(PT::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, PT::Space & meta)
|
||||
bool TicketInfo::ReadTicketValue(pt::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, pt::Space & meta)
|
||||
{
|
||||
if( space.is_equal(L"type", L"integer") ||
|
||||
space.is_equal(L"type", L"progress") ||
|
||||
@@ -360,7 +360,7 @@ bool TicketInfo::ReadTicketValue(PT::Space & space, long param_id, Ticket::Ticke
|
||||
space.is_equal(L"type", L"multistring") )
|
||||
{
|
||||
// !! dodac cos co sprawdzi czy string nie zawiera znakow konca linii
|
||||
PT::Space & sp = FindAddMetaByParam(meta, param_id);
|
||||
pt::Space & sp = FindAddMetaByParam(meta, param_id);
|
||||
sp.add(L"value", value);
|
||||
return false;
|
||||
}
|
||||
@@ -391,10 +391,10 @@ return false;
|
||||
|
||||
|
||||
|
||||
void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
void TicketInfo::ReadTicketValue(pt::Space & space,
|
||||
long param_id,
|
||||
const PostFile & value,
|
||||
PT::Space & meta,
|
||||
pt::Space & meta,
|
||||
Item & upload_dir)
|
||||
{
|
||||
file.Clear(); // clearing and setting date
|
||||
@@ -409,8 +409,8 @@ void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
PT::Space & space = FindAddMetaByParam(meta, param_id);
|
||||
PT::Space & file_space = space.add_child_space(L"file");
|
||||
pt::Space & space = FindAddMetaByParam(meta, param_id);
|
||||
pt::Space & file_space = space.add_child_space(L"file");
|
||||
|
||||
if( file.item_content.file_type == WINIX_ITEM_FILETYPE_IMAGE )
|
||||
file_space.add(L"type", L"image");
|
||||
@@ -428,8 +428,8 @@ void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
}
|
||||
|
||||
|
||||
void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
long param_id, const PostFile & value, PT::Space & meta)
|
||||
void TicketInfo::ReadTicketValue(pt::Space & space,
|
||||
long param_id, const PostFile & value, pt::Space & meta)
|
||||
{
|
||||
std::wstring * type = space.get_wstr(L"type");
|
||||
|
||||
@@ -456,7 +456,7 @@ void TicketInfo::ReadTicketValue(PT::Space & space,
|
||||
|
||||
|
||||
// adding a new parameter only if it not exists in ticket.par_tab
|
||||
void TicketInfo::ReadTicketParam(PT::Space & space, Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta)
|
||||
void TicketInfo::ReadTicketParam(pt::Space & space, Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta)
|
||||
{
|
||||
ticket_param.param = param_id;
|
||||
|
||||
@@ -481,7 +481,7 @@ void TicketInfo::ReadTicketParam(PT::Space & space, Ticket & ticket, long param_
|
||||
|
||||
|
||||
|
||||
void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta)
|
||||
void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta)
|
||||
{
|
||||
ticket_param.Clear();
|
||||
|
||||
@@ -489,7 +489,7 @@ void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstr
|
||||
{
|
||||
for(size_t i=0 ; i<cur_conf->child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & space = *(*cur_conf->child_spaces)[i];
|
||||
pt::Space & space = *(*cur_conf->child_spaces)[i];
|
||||
|
||||
if( space.name && *space.name == L"param" && space.to_long(L"id") == param_id )
|
||||
{
|
||||
@@ -504,13 +504,13 @@ void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstr
|
||||
|
||||
|
||||
// always adds a new parameter
|
||||
void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, PT::Space & meta)
|
||||
void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, pt::Space & meta)
|
||||
{
|
||||
if( cur_conf->child_spaces )
|
||||
{
|
||||
for(size_t i=0 ; i<cur_conf->child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & space = *(*cur_conf->child_spaces)[i];
|
||||
pt::Space & space = *(*cur_conf->child_spaces)[i];
|
||||
|
||||
if( space.name && *space.name == L"param" && space.to_long(L"id") == param_id )
|
||||
{
|
||||
@@ -527,19 +527,19 @@ void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, PT::Spac
|
||||
|
||||
|
||||
|
||||
bool TicketInfo::DeleteTicketFile(Ticket & ticket, long file_id, PT::Space & meta)
|
||||
bool TicketInfo::DeleteTicketFile(Ticket & ticket, long file_id, pt::Space & meta)
|
||||
{
|
||||
if( meta.child_spaces )
|
||||
{
|
||||
for(size_t i=0 ; i<meta.child_spaces->size() ; ++i)
|
||||
{
|
||||
PT::Space & param = *(*meta.child_spaces)[i];
|
||||
pt::Space & param = *(*meta.child_spaces)[i];
|
||||
|
||||
if( param.name && *param.name == L"param" && param.child_spaces )
|
||||
{
|
||||
for(size_t z=0 ; z<param.child_spaces->size() ; ++z)
|
||||
{
|
||||
PT::Space & file = *(*param.child_spaces)[z];
|
||||
pt::Space & file = *(*param.child_spaces)[z];
|
||||
|
||||
if( file.name && *file.name == L"file" )
|
||||
{
|
||||
@@ -566,7 +566,7 @@ return false;
|
||||
|
||||
|
||||
|
||||
void TicketInfo::ReadTicketParams(Ticket & ticket, bool clear_ticket, PT::Space & meta, bool & file_was_deleted)
|
||||
void TicketInfo::ReadTicketParams(Ticket & ticket, bool clear_ticket, pt::Space & meta, bool & file_was_deleted)
|
||||
{
|
||||
PostTab::iterator i;
|
||||
PostFileTab::iterator i2;
|
||||
@@ -583,13 +583,13 @@ PostFileTab::iterator i2;
|
||||
{
|
||||
// !! CHECKME why ticket_form_prefix is in the global config?
|
||||
// (this is a plugin variable)
|
||||
if( PT::is_substr(config->ticket_form_prefix, i->first) )
|
||||
if( pt::is_substr(config->ticket_form_prefix, i->first) )
|
||||
{
|
||||
long param_id = Tol(i->first.c_str() + config->ticket_form_prefix.size());
|
||||
ReadTicketParam(ticket, param_id, i->second, meta);
|
||||
}
|
||||
|
||||
if( PT::is_substr(ticket_delete_prefix, i->first) )
|
||||
if( pt::is_substr(ticket_delete_prefix, i->first) )
|
||||
{
|
||||
long file_id = Tol(i->first.c_str() + ticket_delete_prefix.size());
|
||||
|
||||
@@ -602,7 +602,7 @@ PostFileTab::iterator i2;
|
||||
|
||||
for(i2=cur->request->post_file_tab.begin() ; i2!=cur->request->post_file_tab.end() ; ++i2)
|
||||
{
|
||||
if( PT::is_substr(config->ticket_form_prefix, i2->first) )
|
||||
if( pt::is_substr(config->ticket_form_prefix, i2->first) )
|
||||
ReadTicketParam(Tol(i2->first.c_str() + config->ticket_form_prefix.size()), i2->second, meta);
|
||||
}
|
||||
|
||||
@@ -629,9 +629,9 @@ void TicketInfo::RemoveTicket(long file_id)
|
||||
}
|
||||
|
||||
|
||||
void TicketInfo::CopyTicketSpace(PT::Space & ticket_space, Item & item)
|
||||
void TicketInfo::CopyTicketSpace(pt::Space & ticket_space, Item & item)
|
||||
{
|
||||
PT::Space & ticket_meta = item.item_content.meta.find_add_child_space(L"ticket");
|
||||
pt::Space & ticket_meta = item.item_content.meta.find_add_child_space(L"ticket");
|
||||
ticket_meta = ticket_space;
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ struct TicketConfWrap
|
||||
{
|
||||
bool to_delete;
|
||||
std::wstring file_name;
|
||||
PT::Space conf;
|
||||
pt::Space conf;
|
||||
|
||||
TicketConfWrap()
|
||||
{
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
// current ticket config
|
||||
// will be set by FindCurrentConf()
|
||||
TicketConfWrap * cur_conf_wrap;
|
||||
PT::Space * cur_conf;
|
||||
pt::Space * cur_conf;
|
||||
|
||||
// default: "progress"
|
||||
// can be set in config in option: ticket_form_progress_prefix
|
||||
@@ -127,9 +127,9 @@ public:
|
||||
void ReadTicketConf(bool skip_existing_configs = false);
|
||||
void FindCurrentConf(long dir_id);
|
||||
void FindCurrentConf();
|
||||
void ReadTicketParams(Ticket & ticket, bool clear_ticket, PT::Space & meta, bool & file_was_deleted);
|
||||
void ReadTicketParams(Ticket & ticket, bool clear_ticket, pt::Space & meta, bool & file_was_deleted);
|
||||
void RemoveTicket(long file_id);
|
||||
void CopyTicketSpace(PT::Space & ticket_space, Item & item);
|
||||
void CopyTicketSpace(pt::Space & ticket_space, Item & item);
|
||||
|
||||
void MakeRedirectIfPossible(const Item & item);
|
||||
|
||||
@@ -154,14 +154,14 @@ private:
|
||||
std::wstring file_path;
|
||||
|
||||
// for reading config file
|
||||
PT::SpaceParser conf_parser;
|
||||
pt::SpaceParser conf_parser;
|
||||
std::vector<Item*> config_dir_tab;
|
||||
Item config_file;
|
||||
|
||||
// for Clearing
|
||||
// (we don't want to use empty pointers)
|
||||
TicketConfWrap cur_conf_wrap_empty;
|
||||
PT::Space cur_conf_empty;
|
||||
pt::Space cur_conf_empty;
|
||||
Ticket ticket_empty;
|
||||
Item item_empty;
|
||||
|
||||
@@ -174,17 +174,17 @@ private:
|
||||
void MarkAllConfToDelete();
|
||||
void DeleteAllMarkedConf();
|
||||
void ReadTicketConf(const Mount & mount, bool skip_existing_configs);
|
||||
PT::Space & FindAddMetaByParam(PT::Space & meta, long param);
|
||||
pt::Space & FindAddMetaByParam(pt::Space & meta, long param);
|
||||
|
||||
|
||||
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, PT::Space & meta, Item & upload_dir);
|
||||
void ReadTicketValue(PT::Space & space, long param_id, const PostFile & value, 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(long param_id, const PostFile & value, PT::Space & meta);
|
||||
bool DeleteTicketFile(Ticket & ticket, long file_id, PT::Space & meta);
|
||||
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, pt::Space & meta, Item & upload_dir);
|
||||
void ReadTicketValue(pt::Space & space, long param_id, const PostFile & value, 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(long param_id, const PostFile & value, pt::Space & meta);
|
||||
bool DeleteTicketFile(Ticket & ticket, long file_id, pt::Space & meta);
|
||||
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user