added a special default function: "-"

the proper default function will be selected automatically


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@695 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-12-07 18:18:45 +00:00
parent 508f06339e
commit 9b29cce1a4
12 changed files with 446 additions and 336 deletions

View File

@@ -191,6 +191,7 @@ void Functions::CreateFunctions()
Add(fun_reload);
Add(fun_rm);
Add(fun_run);
Add(fun_special_default);
Add(fun_stat);
Add(fun_subject);
Add(fun_template);
@@ -239,7 +240,7 @@ void Functions::SetDefaultFunctionForFile()
else
request->function = &fun_cat;
log << log3 << "Content: default function: " << request->function->fun.url << logend;
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
}
@@ -251,7 +252,7 @@ void Functions::SetDefaultFunctionForDir()
if( default_item != -1 )
{
log << log3 << "Content: Default item: id: " << default_item << logend;
log << log3 << "Functions: Default item: id: " << default_item << logend;
system->RedirectTo(default_item);
}
else
@@ -261,13 +262,14 @@ void Functions::SetDefaultFunctionForDir()
else
request->function = &fun_ls;
log << log3 << "Content: default function: " << request->function->fun.url << logend;
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
}
}
void Functions::SetDefaultFunction()
{
request->function = 0;
plugin.Call(WINIX_SELECT_DEFAULT_FUNCTION);
if( request->function )
@@ -295,7 +297,7 @@ void Functions::MakeGet()
if( request->function )
{
request->status = WINIX_ERR_NO_ITEM;
log << log1 << "Content: in authorizer mode only 'cat' funtion is available and must "
log << log1 << "Functions: in authorizer mode only 'cat' funtion is available and must "
"be default (not in the url)" << logend;
return;
}
@@ -304,7 +306,7 @@ void Functions::MakeGet()
}
if( !request->function )
if( !request->function || request->function == &fun_special_default )
SetDefaultFunction();
if( !request->redirect_to.empty() )
@@ -336,7 +338,7 @@ void Functions::MakePost()
return;
}
if( !request->function )
if( !request->function || request->function == &fun_special_default )
SetDefaultFunction();
if( !request->function )