changed: winix 'upload' function is a file manager now
we're using an jquery upload plugin
added: Item struct has new rows: hash, hash_type, file_size, sort_index
added: css mount parameter
you can specify css files there, and javascript wysiwyg editors
(ckeditor, tinymce) can make use of it
changed: post parsers can parse post variables with the same name
(a postfix is added in such a case)
added: common_dir parameter to the config
this is a path to common directory (directory with common static files)
it is needed to the 'css' mount parameter
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@746 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
#include "postmultiparser.h"
|
||||
#include "log.h"
|
||||
#include "utf8.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
|
||||
PostMultiParser::PostMultiParser()
|
||||
@@ -353,6 +353,15 @@ void PostMultiParser::ReadContent()
|
||||
}
|
||||
|
||||
|
||||
void PostMultiParser::ConvStr(const std::string & src, std::wstring & dst)
|
||||
{
|
||||
if( config->utf8 )
|
||||
Ezc::UTF8ToWide(src, dst);
|
||||
else
|
||||
AssignString(src, dst);
|
||||
}
|
||||
|
||||
|
||||
void PostMultiParser::AddNormalPostVar()
|
||||
{
|
||||
if( post_tab->size() >= WINIX_POSTTABLE_MAXSIZE )
|
||||
@@ -362,20 +371,10 @@ void PostMultiParser::AddNormalPostVar()
|
||||
return;
|
||||
}
|
||||
|
||||
ConvStr(name, namew);
|
||||
ConvStr(content, contentw);
|
||||
|
||||
if( config->utf8 )
|
||||
{
|
||||
Ezc::UTF8ToWide(name, namew);
|
||||
Ezc::UTF8ToWide(content, contentw);
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignString(name, namew);
|
||||
AssignString(content, contentw);
|
||||
}
|
||||
|
||||
std::pair<PostTab::iterator, bool> res = post_tab->insert( std::make_pair(namew, contentw) );
|
||||
bool added = res.second;
|
||||
bool added = InsertPostVar(*post_tab, namew, contentw);
|
||||
|
||||
log << log2 << "PMP: POST var, name: \"" << namew << "\"";
|
||||
|
||||
@@ -395,20 +394,12 @@ void PostMultiParser::AddFilePostVar()
|
||||
return;
|
||||
}
|
||||
|
||||
if( config->utf8 )
|
||||
{
|
||||
Ezc::UTF8ToWide(name, namew);
|
||||
Ezc::UTF8ToWide(filename, post_file_temp.filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignString(name, namew);
|
||||
AssignString(filename, post_file_temp.filename);
|
||||
}
|
||||
|
||||
ConvStr(name, namew);
|
||||
ConvStr(filename, post_file_temp.filename);
|
||||
post_file_temp.tmp_filename = tmp_filename;
|
||||
std::pair<PostFileTab::iterator, bool> res = post_file_tab->insert( std::make_pair(namew, post_file_temp) );
|
||||
bool added = res.second;
|
||||
post_file_temp.file_size = content_len;
|
||||
|
||||
bool added = InsertPostVar(*post_file_tab, namew, post_file_temp);
|
||||
|
||||
log << log2 << "PMP: POST FILE var, name: \"" << namew << "\"";
|
||||
|
||||
@@ -424,15 +415,10 @@ void PostMultiParser::AddPostVar()
|
||||
if( name.empty() )
|
||||
return;
|
||||
|
||||
|
||||
if( filename.empty() )
|
||||
{
|
||||
AddNormalPostVar();
|
||||
}
|
||||
else
|
||||
{
|
||||
AddFilePostVar();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -569,6 +555,7 @@ Error PostMultiParser::Parse(FCGX_Stream * in_, PostTab & post_tab_, PostFileTab
|
||||
in = in_;
|
||||
last = 0;
|
||||
err = WINIX_ERR_OK;
|
||||
var_index = 1;
|
||||
line_end_dos = false;
|
||||
in_buffer_ind = WINIX_POSTMULTI_INPUT_BUFFER;
|
||||
in_buffer_len = WINIX_POSTMULTI_INPUT_BUFFER;
|
||||
@@ -587,6 +574,7 @@ Error PostMultiParser::Parse(FCGX_Stream * in_, PostTab & post_tab_, PostFileTab
|
||||
|
||||
if( err != WINIX_ERR_OK )
|
||||
{
|
||||
RemovePostFileTmp(*post_file_tab);
|
||||
post_tab->clear();
|
||||
post_file_tab->clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user