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,8 +9,9 @@
|
||||
|
||||
#include <ctime>
|
||||
#include "templates.h"
|
||||
#include "../core/data.h"
|
||||
#include "../core/request.h"
|
||||
#include "core/request.h"
|
||||
#include "functions/functions.h"
|
||||
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
@@ -33,28 +34,28 @@ static char buffer[100];
|
||||
|
||||
void winix_users_logged(Info & i)
|
||||
{
|
||||
i.out << data.how_many_logged;
|
||||
i.out << system->users.HowManyLogged();
|
||||
}
|
||||
|
||||
|
||||
void winix_function(Info & i)
|
||||
{
|
||||
i.out << request.pfunction->item.url;
|
||||
i.out << request->pfunction->fun.url;
|
||||
}
|
||||
|
||||
|
||||
void winix_function_is(Info & i)
|
||||
{
|
||||
if( !request.pfunction )
|
||||
if( !request->pfunction )
|
||||
return;
|
||||
|
||||
i.res = (request.pfunction->item.url == i.par);
|
||||
i.res = (request->pfunction->fun.url == i.par);
|
||||
}
|
||||
|
||||
|
||||
void winix_function_param_is(Info & i)
|
||||
{
|
||||
i.res = request.IsParam(i.par.c_str());
|
||||
i.res = request->IsParam(i.par.c_str());
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +64,7 @@ void winix_loadavg_now(Info & i)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
sprintf(buf, "%.2f", (double)data.load_avg.LoadAvgNow());
|
||||
sprintf(buf, "%.2f", (double)system->load_avg.LoadAvgNow());
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
@@ -72,7 +73,7 @@ void winix_loadavg_1(Info & i)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
sprintf(buf, "%.2f", (double)data.load_avg.LoadAvg1());
|
||||
sprintf(buf, "%.2f", (double)system->load_avg.LoadAvg1());
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
@@ -81,7 +82,7 @@ void winix_loadavg_5(Info & i)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
sprintf(buf, "%.2f", (double)data.load_avg.LoadAvg5());
|
||||
sprintf(buf, "%.2f", (double)system->load_avg.LoadAvg5());
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
@@ -90,7 +91,7 @@ void winix_loadavg_15(Info & i)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
sprintf(buf, "%.2f", (double)data.load_avg.LoadAvg15());
|
||||
sprintf(buf, "%.2f", (double)system->load_avg.LoadAvg15());
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
@@ -99,7 +100,7 @@ void winix_req_per_sec_now(Info & i)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
sprintf(buf, "%.2f", (double)data.load_avg.ReqPerSecNow());
|
||||
sprintf(buf, "%.2f", (double)system->load_avg.ReqPerSecNow());
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
@@ -108,7 +109,7 @@ void winix_req_per_sec_1(Info & i)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
sprintf(buf, "%.2f", (double)data.load_avg.ReqPerSec1());
|
||||
sprintf(buf, "%.2f", (double)system->load_avg.ReqPerSec1());
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
@@ -117,7 +118,7 @@ void winix_req_per_sec_5(Info & i)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
sprintf(buf, "%.2f", (double)data.load_avg.ReqPerSec5());
|
||||
sprintf(buf, "%.2f", (double)system->load_avg.ReqPerSec5());
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
@@ -126,7 +127,7 @@ void winix_req_per_sec_15(Info & i)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
sprintf(buf, "%.2f", (double)data.load_avg.ReqPerSec15());
|
||||
sprintf(buf, "%.2f", (double)system->load_avg.ReqPerSec15());
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
@@ -134,13 +135,13 @@ char buf[20];
|
||||
void winix_err_is(Info & i)
|
||||
{
|
||||
int value = atoi( i.par.c_str() );
|
||||
i.res = (request.status == value);
|
||||
i.res = (request->status == value);
|
||||
}
|
||||
|
||||
|
||||
void winix_err_code(Info & i)
|
||||
{
|
||||
i.out << request.status;
|
||||
i.out << request->status;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +153,7 @@ void winix_is_err_in_locales(Info & i)
|
||||
{
|
||||
char buff[40];
|
||||
|
||||
sprintf(buff, "winix_err_%d", request.status);
|
||||
sprintf(buff, "winix_err_%d", request->status);
|
||||
winix_error_key = buff;
|
||||
|
||||
i.res = locale.IsKey(winix_error_key);
|
||||
@@ -163,7 +164,7 @@ void winix_err_msg_from_locales(Info & i)
|
||||
{
|
||||
char buff[40];
|
||||
|
||||
sprintf(buff, "winix_err_%d", request.status);
|
||||
sprintf(buff, "winix_err_%d", request->status);
|
||||
winix_error_key = buff;
|
||||
|
||||
i.out << locale.Get(winix_error_key);
|
||||
@@ -172,8 +173,8 @@ char buff[40];
|
||||
|
||||
void winix_show_content_in_full_window(Info & i)
|
||||
{
|
||||
if( request.pfunction )
|
||||
i.res = (request.pfunction->code == FUN_CKEDITOR || request.pfunction->code == FUN_TINYMCE);
|
||||
if( request->pfunction )
|
||||
i.res = (request->pfunction->fun.url == "ckeditor" || request->pfunction->fun.url == "tinymce");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user