Files
winix/templates/doc.cpp
Tomasz Sowa 09d427b4ba changed: rename cmslu to winix
changed: html templates are a part of winix now
         and the user can provide special html templates for its site
added:   locales
added:   html templates are using HtmlFilter now (locales)
changed: now we have html templates for each language



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@560 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-01-28 15:39:01 +00:00

91 lines
1.1 KiB
C++
Executable File

/*
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008-2009, Tomasz Sowa
* All rights reserved.
*
*/
#include "templates.h"
#include "../core/data.h"
#include "../core/request.h"
#include "../core/misc.h"
namespace TemplatesFunctions
{
void doc_title(Info & i)
{
size_t a = 0;
// from 1 means skipping the root directory
for(a = 1 ; a<request.dir_table.size() ; ++a)
{
i.out << " / ";
HtmlEscape(i.out, request.dir_table[a]->subject);
}
if( request.is_item )
{
i.out << " / ";
HtmlEscape(i.out, request.item.subject);
}
}
void doc_base_url(Info & i)
{
i.out << data.base_url;
}
void doc_base_url_static(Info & i)
{
i.out << data.base_url_static;
}
void doc_base_url_static_auth(Info & i)
{
i.out << data.base_url_static_auth;
}
void doc_current_url(Info & i)
{
i.out << request.env_request_uri;
}
void doc_is_error(Info & i)
{
i.result = request.status != Error::ok;
}
void doc_status(Info & i)
{
i.out << static_cast<int>( request.status );
}
} // namespace TemplatesFunctions