added: functions: ckeditor, uptime
added: for function: login - a html pattern for GET request git-svn-id: svn://ttmath.org/publicrep/winix/trunk@567 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
60
templates/winix.cpp
Executable file
60
templates/winix.cpp
Executable file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ctime>
|
||||
#include "templates.h"
|
||||
#include "../core/data.h"
|
||||
#include "../core/request.h"
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
|
||||
|
||||
void winix_cur_time(Info & i)
|
||||
{
|
||||
static char buffer[100];
|
||||
|
||||
time_t t = time(0);
|
||||
tm * ptm = localtime(&t);
|
||||
|
||||
sprintf(buffer, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
|
||||
i.out << buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void winix_users_logged(Info & i)
|
||||
{
|
||||
i.out << data.how_many_logged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void winix_function_is(Info & i)
|
||||
{
|
||||
if( !request.pfunction || !i.is )
|
||||
return;
|
||||
|
||||
i.result = (request.pfunction->item.url == *i.is);
|
||||
}
|
||||
|
||||
|
||||
void winix_function_param_is(Info & i)
|
||||
{
|
||||
if( !i.is )
|
||||
return;
|
||||
|
||||
i.result = request.IsParam(i.is->c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace
|
Reference in New Issue
Block a user