added: forum
added: mount params can have arguments (in parentheses) added: mount params: withheader, withinfo, restrictcreatethread, only_root_can_remove, can_use_emacs_on(level), can_use_mkdir_on(level), added: table Item has 'subject' column now removed: column 'subject' from table Content git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@505 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#include "../core/db.h"
|
||||
#include "../core/data.h"
|
||||
#include "../app/content.h"
|
||||
|
||||
#include "../core/misc.h"
|
||||
|
||||
|
||||
bool Content::Init()
|
||||
@@ -59,9 +59,7 @@ void Content::SetDefaultFunctionForFile()
|
||||
|
||||
void Content::SetDefaultFunctionForDir()
|
||||
{
|
||||
Mount mount = data.mounts.GetCurrentMountPoint();
|
||||
|
||||
if( mount.type == Mount::thread )
|
||||
if( data.mounts.CurrentMountType() == Mount::thread )
|
||||
{
|
||||
request.pfunction = data.functions.GetFunction(FUN_THREAD);
|
||||
|
||||
@@ -341,15 +339,35 @@ void Content::ReadAdditionalInfo()
|
||||
if( request.dir_table.empty() )
|
||||
return;
|
||||
|
||||
Mount mount = data.mounts.GetCurrentMountPoint();
|
||||
|
||||
if( mount.type == Mount::thread )
|
||||
if( data.mounts.CurrentMountType() == Mount::thread )
|
||||
{
|
||||
db.GetThreadByDirId(request.dir_table.back()->id, request.thread);
|
||||
if( db.GetThreadByDirId(request.dir_table.back()->id, request.thread) == Error::ok )
|
||||
request.is_thread = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Content::PrepareUrl(Item & item)
|
||||
{
|
||||
TrimWhite(item.url);
|
||||
|
||||
if( item.url.empty() )
|
||||
item.url = item.subject; // if the subject is empty then the url will be corrected by CorrectUrl()
|
||||
|
||||
CorrectUrl(item);
|
||||
|
||||
if( data.functions.GetFunction(item.url) )
|
||||
{
|
||||
// the name provided by an user is the same as a name of a function
|
||||
// we add one underscore character at the beginning
|
||||
|
||||
// names of functions should not begin with an underscore '_'
|
||||
// and we can simply add one '_' at the beginning
|
||||
// and the name will be unique
|
||||
item.url.insert(item.url.begin(), '_');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user