the first part of reimplementing has been done
now we have app object and singletons are only: log logn plugin and app git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "templates.h"
|
||||
#include "misc.h"
|
||||
#include "../core/data.h"
|
||||
#include "../core/request.h"
|
||||
#include "../core/misc.h"
|
||||
|
||||
@@ -20,7 +19,7 @@ namespace TemplatesFunctions
|
||||
|
||||
void thread_is(Info & i)
|
||||
{
|
||||
i.res = request.is_thread;
|
||||
i.res = request->is_thread;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,15 +32,15 @@ void thread_tab(Info & i)
|
||||
{
|
||||
thread_tab_index = i.iter;
|
||||
|
||||
i.res = thread_tab_index < request.thread_tab.size();
|
||||
i.res = thread_tab_index < request->thread_tab.size();
|
||||
}
|
||||
|
||||
|
||||
void thread_tab_url(Info & i)
|
||||
{
|
||||
if( thread_tab_index < request.thread_tab.size() )
|
||||
if( thread_tab_index < request->thread_tab.size() )
|
||||
{
|
||||
Item * dir = data.dirs.GetDir( request.thread_tab[thread_tab_index].dir_id );
|
||||
Item * dir = system->dirs.GetDir( request->thread_tab[thread_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
{
|
||||
@@ -57,9 +56,9 @@ void thread_tab_url(Info & i)
|
||||
|
||||
void thread_tab_subject(Info & i)
|
||||
{
|
||||
if( thread_tab_index < request.thread_tab.size() )
|
||||
if( thread_tab_index < request->thread_tab.size() )
|
||||
{
|
||||
Item * dir = data.dirs.GetDir( request.thread_tab[thread_tab_index].dir_id );
|
||||
Item * dir = system->dirs.GetDir( request->thread_tab[thread_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
{
|
||||
@@ -78,9 +77,9 @@ void thread_tab_subject(Info & i)
|
||||
|
||||
void thread_tab_answers(Info & i)
|
||||
{
|
||||
if( thread_tab_index < request.thread_tab.size() )
|
||||
if( thread_tab_index < request->thread_tab.size() )
|
||||
{
|
||||
long a = request.thread_tab[thread_tab_index].items;
|
||||
long a = request->thread_tab[thread_tab_index].items;
|
||||
|
||||
// the first is created by the author
|
||||
// we count only the rest
|
||||
@@ -97,13 +96,13 @@ void thread_tab_author(Info & i)
|
||||
bool unknown = true;
|
||||
|
||||
|
||||
if( thread_tab_index < request.thread_tab.size() )
|
||||
if( thread_tab_index < request->thread_tab.size() )
|
||||
{
|
||||
Item * dir = data.dirs.GetDir( request.thread_tab[thread_tab_index].dir_id );
|
||||
Item * dir = system->dirs.GetDir( request->thread_tab[thread_tab_index].dir_id );
|
||||
|
||||
if( dir )
|
||||
{
|
||||
User * puser = data.users.GetUser(dir->user_id);
|
||||
User * puser = system->users.GetUser(dir->user_id);
|
||||
unknown = false;
|
||||
|
||||
if( puser )
|
||||
@@ -130,27 +129,27 @@ bool unknown = true;
|
||||
|
||||
void thread_tab_last_item_date_modification(Info & i)
|
||||
{
|
||||
if( thread_tab_index < request.thread_tab.size() )
|
||||
if( request.thread_tab[thread_tab_index].last_item.id != -1 )
|
||||
i.out << DateToStr( &request.thread_tab[thread_tab_index].last_item.date_modification );
|
||||
if( thread_tab_index < request->thread_tab.size() )
|
||||
if( request->thread_tab[thread_tab_index].last_item.id != -1 )
|
||||
i.out << DateToStr( &request->thread_tab[thread_tab_index].last_item.date_modification );
|
||||
}
|
||||
|
||||
|
||||
void thread_tab_last_item_date_modification_nice(Info & i)
|
||||
{
|
||||
if( thread_tab_index < request.thread_tab.size() )
|
||||
if( request.thread_tab[thread_tab_index].last_item.id != -1 )
|
||||
print_date_nice(i, &request.thread_tab[thread_tab_index].last_item.date_modification);
|
||||
if( thread_tab_index < request->thread_tab.size() )
|
||||
if( request->thread_tab[thread_tab_index].last_item.id != -1 )
|
||||
print_date_nice(i, &request->thread_tab[thread_tab_index].last_item.date_modification);
|
||||
}
|
||||
|
||||
|
||||
void thread_tab_last_item_user(Info & i)
|
||||
{
|
||||
if( thread_tab_index < request.thread_tab.size() )
|
||||
if( thread_tab_index < request->thread_tab.size() )
|
||||
{
|
||||
if( request.thread_tab[thread_tab_index].last_item.id != -1 )
|
||||
if( request->thread_tab[thread_tab_index].last_item.id != -1 )
|
||||
{
|
||||
User * puser = data.users.GetUser( request.thread_tab[thread_tab_index].last_item.user_id );
|
||||
User * puser = system->users.GetUser( request->thread_tab[thread_tab_index].last_item.user_id );
|
||||
|
||||
if( puser )
|
||||
HtmlEscape(i.out, puser->name);
|
||||
@@ -158,8 +157,8 @@ void thread_tab_last_item_user(Info & i)
|
||||
{
|
||||
i.out << "~";
|
||||
|
||||
if( !request.thread_tab[thread_tab_index].last_item.guest_name.empty() )
|
||||
HtmlEscape(i.out, request.thread_tab[thread_tab_index].last_item.guest_name);
|
||||
if( !request->thread_tab[thread_tab_index].last_item.guest_name.empty() )
|
||||
HtmlEscape(i.out, request->thread_tab[thread_tab_index].last_item.guest_name);
|
||||
else
|
||||
i.out << "guest"; // !! dodac do konfiga
|
||||
}
|
||||
@@ -170,7 +169,8 @@ void thread_tab_last_item_user(Info & i)
|
||||
|
||||
void thread_can_create(Info & i)
|
||||
{
|
||||
i.res = request.CanCreateThread(true);
|
||||
//i.res = request->CanCreateThread(true);
|
||||
i.res = true; // temporarily
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user