winix/templates/mount.cpp

69 lines
1.0 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "templates.h"
#include "core/misc.h"
namespace TemplatesFunctions
{
void mount_page_is(Info & i)
{
i.res = system->mounts.pmount->IsArg(Mount::par_page, i.par);
}
void mount_thread_is(Info & i)
{
i.res = system->mounts.pmount->IsArg(Mount::par_thread, i.par);
}
void mount_type_is_thread(Info & i)
{
i.res = system->mounts.pmount->type == Mount::thread;
}
void mount_type_is_ticket(Info & i)
{
i.res = system->mounts.pmount->type == Mount::ticket;
}
void mount_type_is_cms(Info & i)
{
i.res = system->mounts.pmount->type == Mount::cms;
}
void mount_has_html_template(Info & i)
{
i.res = system->mounts.pmount->param[Mount::par_html_template].defined;
}
void mount_first_html_template(Info & i)
{
Mount::ParamRow & par = system->mounts.pmount->param[Mount::par_html_template];
if( par.defined && !par.arg.empty() )
HtmlEscape(i.out, par.arg[0]);
}
} // namespace TemplatesFunctions