winix/templates/mount.cpp

69 lines
1.2 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(system->mounts.MountParPage(), i.par);
}
void mount_thread_is(Info & i)
{
i.res = system->mounts.pmount->IsArg(system->mounts.MountParThread(), i.par);
}
void mount_type_is_thread(Info & i)
{
i.res = system->mounts.pmount->type == system->mounts.MountTypeThread();
}
void mount_type_is_ticket(Info & i)
{
i.res = system->mounts.pmount->type == system->mounts.MountTypeTicket();
}
void mount_type_is_cms(Info & i)
{
i.res = system->mounts.pmount->type == system->mounts.MountTypeCms();
}
void mount_has_html_template(Info & i)
{
i.res = system->mounts.pmount->param[system->mounts.MountParHtmlTemplate()].defined;
}
void mount_first_html_template(Info & i)
{
Mount::ParamRow & par = system->mounts.pmount->param[system->mounts.MountParHtmlTemplate()];
if( par.defined && !par.arg.empty() )
HtmlEscape(i.out, par.arg[0]);
}
} // namespace TemplatesFunctions